diff --git a/.github/scripts/close-invalid-link.cjs b/.github/scripts/close-invalid-link.cjs index e2205cee064..871adf87969 100644 --- a/.github/scripts/close-invalid-link.cjs +++ b/.github/scripts/close-invalid-link.cjs @@ -12,12 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -async function closeIssue(owner, repo, number) { +async function closeIssue(github, owner, repo, number) { + await github.rest.issues.createComment({ + owner: owner, + repo: repo, + issue_number: number, + body: "Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)" + }); await github.rest.issues.update({ owner: owner, repo: repo, issue_number: number, - state: "closed", + state: "closed" }); } module.exports = async ({ github, context }) => { @@ -35,13 +41,13 @@ module.exports = async ({ github, context }) => { if (isBugTemplate) { try { - const link = issue.data.body.match(/(https?:\/\/github.com\/.*)/)[0]; + const link = issue.data.body.split("\n")[18].match(/(https?:\/\/g?i?s?t\.?github.com\/.*)/); const isValidLink = (await fetch(link)).ok; if (!isValidLink) { - await closeIssue(owner, repo, number); + await closeIssue(github, owner, repo, number); } } catch (err) { - await closeIssue(owner, repo, number); + await closeIssue(github, owner, repo, number); } } }; diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 34141182c02..910a45392d1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { "packages/gapic-node-templating": "0.0.0", - "packages/google-ai-generativelanguage": "2.5.0", + "packages/google-ai-generativelanguage": "2.6.0", "packages/google-analytics-admin": "7.4.0", "packages/google-analytics-data": "4.7.0", "packages/google-api-apikeys": "1.3.0", @@ -11,7 +11,7 @@ "packages/google-area120-tables": "3.3.0", "packages/google-cloud-accessapproval": "3.3.0", "packages/google-cloud-advisorynotifications": "1.4.0", - "packages/google-cloud-aiplatform": "3.23.0", + "packages/google-cloud-aiplatform": "3.24.0", "packages/google-cloud-alloydb": "1.8.0", "packages/google-cloud-apigateway": "3.3.0", "packages/google-cloud-apigeeconnect": "3.3.0", @@ -20,7 +20,7 @@ "packages/google-cloud-assuredworkloads": "4.3.0", "packages/google-cloud-automl": "4.3.0", "packages/google-cloud-baremetalsolution": "1.4.0", - "packages/google-cloud-batch": "1.11.0", + "packages/google-cloud-batch": "1.12.0", "packages/google-cloud-beyondcorp-appconnections": "1.3.0", "packages/google-cloud-beyondcorp-appconnectors": "1.3.0", "packages/google-cloud-beyondcorp-appgateways": "1.3.0", @@ -51,8 +51,8 @@ "packages/google-cloud-dataform": "1.3.0", "packages/google-cloud-datafusion": "3.2.0", "packages/google-cloud-datalabeling": "4.2.0", - "packages/google-cloud-dataplex": "3.9.0", - "packages/google-cloud-dataproc": "5.6.0", + "packages/google-cloud-dataplex": "3.10.0", + "packages/google-cloud-dataproc": "5.7.0", "packages/google-cloud-dataqna": "3.2.0", "packages/google-cloud-datastream": "3.2.0", "packages/google-cloud-deploy": "3.7.0", @@ -70,14 +70,14 @@ "packages/google-cloud-functions": "3.4.0", "packages/google-cloud-gkebackup": "1.4.0", "packages/google-cloud-gkeconnect-gateway": "3.3.0", - "packages/google-cloud-gkehub": "4.4.0", + "packages/google-cloud-gkehub": "4.5.0", "packages/google-cloud-gkemulticloud": "1.4.0", "packages/google-cloud-gsuiteaddons": "1.3.0", "packages/google-cloud-iap": "3.4.0", "packages/google-cloud-ids": "3.3.0", "packages/google-cloud-iot": "4.3.0", - "packages/google-cloud-kms": "4.4.0", - "packages/google-cloud-kms-inventory": "1.4.0", + "packages/google-cloud-kms": "4.5.0", + "packages/google-cloud-kms-inventory": "1.5.0", "packages/google-cloud-language": "6.4.0", "packages/google-cloud-lifesciences": "3.3.0", "packages/google-cloud-managedidentities": "3.3.0", @@ -103,24 +103,24 @@ "packages/google-cloud-policytroubleshooter-iam": "0.5.0", "packages/google-cloud-privatecatalog": "3.3.0", "packages/google-cloud-rapidmigrationassessment": "1.3.0", - "packages/google-cloud-recaptchaenterprise": "5.9.0", + "packages/google-cloud-recaptchaenterprise": "5.10.0", "packages/google-cloud-recommender": "6.4.0", "packages/google-cloud-redis": "4.3.0", "packages/google-cloud-resourcemanager": "5.3.0", - "packages/google-cloud-retail": "3.4.0", + "packages/google-cloud-retail": "3.5.0", "packages/google-cloud-run": "1.3.0", "packages/google-cloud-scheduler": "4.3.0", "packages/google-cloud-secretmanager": "5.6.0", "packages/google-cloud-security-privateca": "5.4.0", "packages/google-cloud-security-publicca": "1.3.0", - "packages/google-cloud-securitycenter": "8.8.0", + "packages/google-cloud-securitycenter": "8.9.0", "packages/google-cloud-servicedirectory": "5.3.0", "packages/google-cloud-shell": "3.3.0", - "packages/google-cloud-speech": "6.6.0", - "packages/google-cloud-sql": "0.14.0", + "packages/google-cloud-speech": "6.6.1", + "packages/google-cloud-sql": "0.15.0", "packages/google-cloud-storageinsights": "1.3.0", "packages/google-cloud-support": "1.3.0", - "packages/google-cloud-talent": "6.3.0", + "packages/google-cloud-talent": "6.3.1", "packages/google-cloud-tasks": "5.4.0", "packages/google-cloud-texttospeech": "5.3.0", "packages/google-cloud-tpu": "3.5.0", @@ -155,7 +155,7 @@ "packages/google-storagetransfer": "3.3.0", "packages/grafeas": "5.4.0", "packages/typeless-sample-bot": "2.1.0", - "packages/google-cloud-edgenetwork": "0.5.0", + "packages/google-cloud-edgenetwork": "0.6.0", "packages/google-shopping-merchant-reports": "0.7.0", "packages/google-shopping-merchant-inventories": "0.6.0", "packages/google-shopping-css": "0.5.0", @@ -174,7 +174,7 @@ "packages/google-cloud-securesourcemanager": "0.2.0", "packages/google-shopping-merchant-notifications": "0.3.0", "packages/google-shopping-merchant-lfp": "0.3.0", - "packages/google-cloud-securitycentermanagement": "0.3.0", + "packages/google-cloud-securitycentermanagement": "0.4.0", "packages/google-shopping-merchant-conversions": "0.2.0", "packages/google-maps-solar": "0.2.0", "packages/google-maps-routeoptimization": "0.1.0", diff --git a/README.md b/README.md index 8337073f68c..131a485aa72 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ applications that interact with individual Google Cloud services: | [SQL Admin API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-sql) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/sql)](https://npm.im/@google-cloud/sql) | | [Stackdriver Monitoring](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-monitoring) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/monitoring)](https://npm.im/@google-cloud/monitoring) | | [Storage](https://github.com/googleapis/nodejs-storage) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storage)](https://npm.im/@google-cloud/storage) | +| [Storage API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storage-control) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storage-control)](https://npm.im/@google-cloud/storage-control) | | [Storage Insights API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-storageinsights) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storageinsights)](https://npm.im/@google-cloud/storageinsights) | | [Storage Transfer Service](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storagetransfer) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storage-transfer)](https://npm.im/@google-cloud/storage-transfer) | | [Support API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-support) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/support)](https://npm.im/@google-cloud/support) | @@ -161,6 +162,7 @@ applications that interact with individual Google Cloud services: | [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) | | [Workstations API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workstations) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/workstations)](https://npm.im/@google-cloud/workstations) | | [](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) | +| [Apache Kafka for BigQuery API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/managedkafka)](https://npm.im/@google-cloud/managedkafka) | | [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) | | [App Hub API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apphub) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/apphub)](https://npm.im/@google-cloud/apphub) | | [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) | @@ -173,6 +175,7 @@ applications that interact with individual Google Cloud services: | [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) | +| [Developer Connect API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-developerconnect) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/developerconnect)](https://npm.im/@google-cloud/developerconnect) | | [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) | @@ -199,7 +202,6 @@ applications that interact with individual Google Cloud services: | [Profiler API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/cloudprofiler)](https://npm.im/@google-cloud/cloudprofiler) | | [Route Optimization API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routeoptimization) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/routeoptimization)](https://npm.im/@googlemaps/routeoptimization) | | [Solar API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-solar) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/solar)](https://npm.im/@googlemaps/solar) | -| [Storage API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storage-control) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/storage-control)](https://npm.im/@google-cloud/storage-control) | | [Trace](https://github.com/googleapis/cloud-trace-nodejs) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/trace-agent)](https://npm.im/@google-cloud/trace-agent) | | [Vertex AI](https://github.com/googleapis/nodejs-vertexai) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/vertexai)](https://npm.im/@google-cloud/vertexai) | diff --git a/changelog.json b/changelog.json index 23f9da93ee5..3e92f4c1cf3 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,295 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "04e52ae670c14b47c80635a90761b3ee7fcd35c3", + "message": "[edgenetwork] A new field `bonding_type` is added to message `.google.cloud.edgenetwork.v1.Subnet`", + "issues": [ + "5505" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/edgenetwork", + "id": "16ef638e-321c-4792-a661-22d1fc6c64ff", + "createTime": "2024-06-26T22:23:49.050Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e0f0fd24a745bb3b072456aa012c37946f2084a4", + "message": "[sql] A new field `upgradable_database_versions` is added to message `.google.cloud.sql.v1beta4.DatabaseInstance`", + "issues": [ + "5478" + ] + } + ], + "version": "0.15.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/sql", + "id": "ec545c53-5a11-407b-87b5-08e2ed1d1d98", + "createTime": "2024-06-26T22:23:49.026Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "41a96b4231d6b98fac2c06ea8686597789ef6b1c", + "message": "[securitycenter] Add toxic_combination and group_memberships fields to finding", + "issues": [ + "5495" + ] + } + ], + "version": "8.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-center", + "id": "a1fa66a1-a862-4491-845b-ec114cc8409d", + "createTime": "2024-06-26T22:23:48.922Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "617956910ab08fb98763da804a85a6c3e6acec8d", + "message": "[recaptchaenterprise] added SMS Toll Fraud assessment", + "issues": [ + "5499" + ] + } + ], + "version": "5.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/recaptcha-enterprise", + "id": "fe45174f-cdcd-4a6f-aff1-ffa745001ec4", + "createTime": "2024-06-26T22:23:48.897Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "dc87003cc97da35701fca6127f41cfc088c5a99d", + "message": "[gkehub] add a new field `PENDING` under `DeploymentState` enum", + "issues": [ + "5472" + ] + } + ], + "version": "4.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-hub", + "id": "d17b37fc-bd24-46bc-94ab-ca02c8fe2a3f", + "createTime": "2024-06-26T22:23:48.883Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "910da3caf3602e360423db51ed171a42bba4f68a", + "message": "[dataproc] add the cohort and auto tuning configuration to the batch's RuntimeConfig", + "issues": [ + "5494" + ] + } + ], + "version": "5.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc", + "id": "a980b2cf-d4f0-440c-89dd-215f3de85be5", + "createTime": "2024-06-26T22:23:48.867Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f42b77d76efc700ade152faf7e42b3abf3fb8f44", + "message": "[batch] add a install_ops_agent field to InstancePolicyOrTemplate for Ops Agent support", + "issues": [ + "5500" + ] + } + ], + "version": "1.12.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/batch", + "id": "e17eb8ba-a0c4-48d7-842a-f47e59efa3f1", + "createTime": "2024-06-26T22:23:48.853Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "83498e9a326d0640bf3654491814dc19cc479def", + "message": "Add MALFORMED_FUNCTION_CALL to FinishReason", + "issues": [ + "5481" + ] + } + ], + "version": "3.24.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "eb27dfdf-0a7a-4476-81e9-549f32ef5a96", + "createTime": "2024-06-26T22:23:48.838Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "13034af24e1d08cccab85e1f1f448a8ff24e469c", + "message": "[generativelanguage] Add code execution", + "issues": [ + "5506" + ] + }, + { + "type": "feat", + "sha": "75c026f34b039e368c38bfb6242f01048d3bfb79", + "message": "[generativelanguage] Add content caching", + "issues": [ + "5451" + ] + } + ], + "version": "2.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "c8d5fb6e-a376-4ca8-9494-f7e90e58be8c", + "createTime": "2024-06-26T22:23:48.822Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "458d04e25c339b4bce483f2535e86af8b323f169", + "message": "[securitycentermanagement] add `TOXIC_COMBINATION` to `FindingClass` enum", + "issues": [ + "5489" + ] + }, + { + "type": "feat", + "sha": "50736554b0433c16534e771d6673dffe3efac7c9", + "message": "[securitycentermanagement] add an INGEST_ONLY EnablementState", + "issues": [ + "5445" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securitycentermanagement", + "id": "2fbd8fc4-18b4-401f-aa33-a4c17356bfad", + "createTime": "2024-06-21T18:05:56.946Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "616dee9c69245409909487ee9ebfd68121dab85e", + "message": "Update gax", + "issues": [ + "5487" + ], + "scope": "deps" + } + ], + "version": "6.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/talent", + "id": "c22ba18e-e309-40ad-aa5e-3f7d68869fbe", + "createTime": "2024-06-21T18:05:56.923Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "30aef59a85ea7d9835b08694f9be482b84e30c94", + "message": "Avoid unhandled exception on streamingRecognize", + "issues": [ + "5465" + ] + } + ], + "version": "6.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/speech", + "id": "5dce29cf-853d-489b-9957-39febca8da89", + "createTime": "2024-06-21T18:05:56.828Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "140597eac392a4b777c3e0fda197544b0f2912ba", + "message": "[retail] support merged facets", + "issues": [ + "5446" + ] + } + ], + "version": "3.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/retail", + "id": "6d1f8a02-d637-4357-9b97-2ef7ec6fa704", + "createTime": "2024-06-21T18:05:56.770Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "83da16fbfb5fc37d689b72ef9d6f607d7167ae95", + "message": "[kmsinventory] support Key Access Justifications policy configuration", + "issues": [ + "5480" + ] + } + ], + "version": "1.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/kms-inventory", + "id": "22518213-eaae-49f6-bc19-c1e5202b8561", + "createTime": "2024-06-21T18:05:56.750Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a6a77c9eda7428840ce2a01572ee2773b2760f36", + "message": "[kms] support Key Access Justifications policy configuration", + "issues": [ + "5479" + ] + } + ], + "version": "4.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/kms", + "id": "edab1c40-6ad6-42df-8642-a1995e1296f5", + "createTime": "2024-06-21T18:05:56.733Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "00ad68517838b0e231cac523dc0cc4adbf20621e", + "message": "[dataplex] exposing EntrySource.location field that contains location of a resource in the source system", + "issues": [ + "5483" + ] + } + ], + "version": "3.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "a6feda3b-480b-4635-8cfb-ea55783c6987", + "createTime": "2024-06-21T18:05:56.717Z" + }, { "changes": [ { @@ -34618,5 +34907,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2024-06-12T19:36:15.458Z" + "updateTime": "2024-06-26T22:23:49.050Z" } \ No newline at end of file diff --git a/ci/cloudbuild.yaml b/ci/cloudbuild.yaml index e147b663811..e12ed16f45f 100644 --- a/ci/cloudbuild.yaml +++ b/ci/cloudbuild.yaml @@ -26,7 +26,7 @@ logsBucket: 'gs://${_LOGS_BUCKET}/logs/google-cloud-node/${_BUILD_TYPE}/${COMMIT timeout: 32400s steps: - - name: 'gcr.io/kaniko-project/executor:v1.23.0' + - name: 'gcr.io/kaniko-project/executor:v1.23.1' args: [ '--log-format=text', '--context=dir:///workspace/testing', diff --git a/libraries.json b/libraries.json index dd5b0d25954..ac3f73115ef 100644 --- a/libraries.json +++ b/libraries.json @@ -2370,6 +2370,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/nodejs-storage", "support_documentation": "https://cloud.google.com/storage/docs/getting-support" }, + { + "name": "storage", + "name_pretty": "Storage API", + "product_documentation": "https://cloud.google.com/storage/docs/reference/rpc", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage-control/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/storage-control", + "api_id": "storage.googleapis.com", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "storage", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storage-control", + "support_documentation": "https://cloud.google.com/storage/docs/getting-support" + }, { "name": "storageinsights", "name_pretty": "Storage Insights API", @@ -2756,6 +2774,24 @@ "library_type": "GAPIC_AUTO", "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-datapolicies" }, + { + "name": "managedkafka", + "name_pretty": "Apache Kafka for BigQuery API", + "product_documentation": "https://cloud.google.com/managed-kafka", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/managedkafka/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/managedkafka", + "api_id": "managedkafka.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "managedkafka", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka", + "support_documentation": "https://cloud.google.com/managed-kafka/docs/getting-support" + }, { "name": "apigeeregistry", "name_pretty": "Apigee Registry API", @@ -2971,6 +3007,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataform", "support_documentation": "https://dataform.co/docs/getting-support" }, + { + "name": "developerconnect", + "name_pretty": "Developer Connect API", + "product_documentation": "https://cloud.google.com/developer-connect/docs/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/developerconnect/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/developerconnect", + "api_id": "developerconnect.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "developerconnect", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-developerconnect", + "support_documentation": "https://cloud.google.com/developer-connect/docs/getting-support" + }, { "name": "generativelanguage", "name_pretty": "Generative Language API", @@ -3439,24 +3493,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-solar", "support_documentation": "https://developers.google.com/maps/documentation/solar/overview/docs/getting-support" }, - { - "name": "storage", - "name_pretty": "Storage API", - "product_documentation": "https://cloud.google.com/storage/docs/overview", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage/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/storage-control", - "api_id": "storage.googleapis.com", - "default_version": "v2", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "storage", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storage-control", - "support_documentation": "https://cloud.google.com/storage/docs/getting-support" - }, { "name": "trace", "name_pretty": "Trace", diff --git a/packages/google-ai-generativelanguage/CHANGELOG.md b/packages/google-ai-generativelanguage/CHANGELOG.md index 6e6352ce0c8..e6813bc0495 100644 --- a/packages/google-ai-generativelanguage/CHANGELOG.md +++ b/packages/google-ai-generativelanguage/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.6.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.5.0...generativelanguage-v2.6.0) (2024-06-26) + + +### Features + +* [generativelanguage] Add code execution ([#5506](https://github.com/googleapis/google-cloud-node/issues/5506)) ([13034af](https://github.com/googleapis/google-cloud-node/commit/13034af24e1d08cccab85e1f1f448a8ff24e469c)) +* [generativelanguage] Add content caching ([#5451](https://github.com/googleapis/google-cloud-node/issues/5451)) ([75c026f](https://github.com/googleapis/google-cloud-node/commit/75c026f34b039e368c38bfb6242f01048d3bfb79)) + ## [2.5.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.4.0...generativelanguage-v2.5.0) (2024-05-21) diff --git a/packages/google-ai-generativelanguage/README.md b/packages/google-ai-generativelanguage/README.md index a65eea4c0fb..d8acb50d893 100644 --- a/packages/google-ai-generativelanguage/README.md +++ b/packages/google-ai-generativelanguage/README.md @@ -160,6 +160,11 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Generative_service.stream_generate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js) | [![Open in Cloud Shell][shell_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/v1/generative_service.stream_generate_content.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/v1/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/v1/model_service.get_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/v1/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/v1/model_service.list_models.js,packages/google-ai-generativelanguage/samples/README.md) | +| Cache_service.create_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js) | [![Open in Cloud Shell][shell_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/v1beta/cache_service.create_cached_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Cache_service.delete_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.delete_cached_content.js) | [![Open in Cloud Shell][shell_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/v1beta/cache_service.delete_cached_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Cache_service.get_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.get_cached_content.js) | [![Open in Cloud Shell][shell_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/v1beta/cache_service.get_cached_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Cache_service.list_cached_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_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-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_contents.js,packages/google-ai-generativelanguage/samples/README.md) | +| Cache_service.update_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.update_cached_content.js) | [![Open in Cloud Shell][shell_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/v1beta/cache_service.update_cached_content.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/v1beta/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/v1beta/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/v1beta/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/v1beta/discuss_service.generate_message.js,packages/google-ai-generativelanguage/samples/README.md) | | File_service.create_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.create_file.js) | [![Open in Cloud Shell][shell_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/v1beta/file_service.create_file.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 04415f7d628..d968fbdbe30 100644 --- a/packages/google-ai-generativelanguage/package.json +++ b/packages/google-ai-generativelanguage/package.json @@ -1,6 +1,6 @@ { "name": "@google-ai/generativelanguage", - "version": "2.5.0", + "version": "2.6.0", "description": "Generative Language API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cache_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cache_service.proto new file mode 100644 index 00000000000..b2dbe90a45e --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cache_service.proto @@ -0,0 +1,147 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1beta; + +import "google/ai/generativelanguage/v1beta/cached_content.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/apiv1beta/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CacheServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1beta"; + +// API for managing cache of content (CachedContent resources) that can be used +// in GenerativeService requests. This way generate content requests can benefit +// from preprocessing work being done earlier, possibly lowering their +// computational cost. It is intended to be used with large contexts. +service CacheService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Lists CachedContents. + rpc ListCachedContents(ListCachedContentsRequest) + returns (ListCachedContentsResponse) { + option (google.api.http) = { + get: "/v1beta/cachedContents" + }; + option (google.api.method_signature) = ""; + } + + // Creates CachedContent resource. + rpc CreateCachedContent(CreateCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + post: "/v1beta/cachedContents" + body: "cached_content" + }; + option (google.api.method_signature) = "cached_content"; + } + + // Reads CachedContent resource. + rpc GetCachedContent(GetCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + get: "/v1beta/{name=cachedContents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates CachedContent resource (only expiration is updatable). + rpc UpdateCachedContent(UpdateCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + patch: "/v1beta/{cached_content.name=cachedContents/*}" + body: "cached_content" + }; + option (google.api.method_signature) = "cached_content,update_mask"; + } + + // Deletes CachedContent resource. + rpc DeleteCachedContent(DeleteCachedContentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=cachedContents/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request to list CachedContents. +message ListCachedContentsRequest { + // Optional. The maximum number of cached contents to return. The service may + // return fewer than this value. If unspecified, some default (under maximum) + // number of items will be returned. The maximum value is 1000; values above + // 1000 will be coerced to 1000. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListCachedContents` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCachedContents` must + // match the call that provided the page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response with CachedContents list. +message ListCachedContentsResponse { + // List of cached contents. + repeated CachedContent cached_contents = 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 to create CachedContent. +message CreateCachedContentRequest { + // Required. The cached content to create. + CachedContent cached_content = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to read CachedContent. +message GetCachedContentRequest { + // Required. The resource name referring to the content cache entry. + // Format: `cachedContents/{id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/CachedContent" + } + ]; +} + +// Request to update CachedContent. +message UpdateCachedContentRequest { + // Required. The content cache entry to update + CachedContent cached_content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to update. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to delete CachedContent. +message DeleteCachedContentRequest { + // Required. The resource name referring to the content cache entry + // Format: `cachedContents/{id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/CachedContent" + } + ]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto new file mode 100644 index 00000000000..3d5ec8c3ba4 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto @@ -0,0 +1,125 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1beta; + +import "google/ai/generativelanguage/v1beta/content.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CachedContentProto"; +option java_package = "com.google.ai.generativelanguage.v1beta"; + +// Content that has been preprocessed and can be used in subsequent request +// to GenerativeService. +// +// Cached content can be only used with model it was created for. +message CachedContent { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/CachedContent" + pattern: "cachedContents/{id}" + plural: "cachedContents" + singular: "cachedContent" + }; + + // Metadata on the usage of the cached content. + message UsageMetadata { + // Total number of tokens that the cached content consumes. + int32 total_token_count = 1; + } + + // Specifies when this resource will expire. + oneof expiration { + // Timestamp in UTC of when this resource is considered expired. + // This is *always* provided on output, regardless of what was sent + // on input. + google.protobuf.Timestamp expire_time = 9; + + // Input only. New TTL for this resource, input only. + google.protobuf.Duration ttl = 10 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Optional. Identifier. The resource name referring to the cached content. + // Format: `cachedContents/{id}` + optional string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Immutable. The user-generated meaningful display name of the + // cached content. Maximum 128 Unicode characters. + optional string display_name = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The name of the `Model` to use for cached content + // Format: `models/{model}` + optional string model = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Optional. Input only. Immutable. Developer set system instruction. + // Currently text only. + optional Content system_instruction = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Optional. Input only. Immutable. The content to cache. + repeated Content contents = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Optional. Input only. Immutable. A list of `Tools` the model may use to + // generate the next response + repeated Tool tools = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Optional. Input only. Immutable. Tool config. This config is shared for all + // tools. + optional ToolConfig tool_config = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Creation time of the cache entry. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the cache entry was last updated in UTC time. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metadata on the usage of the cached content. + UsageMetadata usage_metadata = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto index 861b9359150..6368fe0f749 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/content.proto @@ -94,6 +94,12 @@ message Part { // URI based data. FileData file_data = 6; + + // Code generated by the model that is meant to be executed. + ExecutableCode executable_code = 9; + + // Result of executing the `ExecutableCode`. + CodeExecutionResult code_execution_result = 10; } } @@ -123,6 +129,59 @@ message FileData { string file_uri = 2 [(google.api.field_behavior) = REQUIRED]; } +// Code generated by the model that is meant to be executed, and the result +// returned to the model. +// +// Only generated when using the `CodeExecution` tool, in which the code will +// be automatically executed, and a corresponding `CodeExecutionResult` will +// also be generated. +message ExecutableCode { + // Supported programming languages for the generated code. + enum Language { + // Unspecified language. This value should not be used. + LANGUAGE_UNSPECIFIED = 0; + + // Python >= 3.10, with numpy and simpy available. + PYTHON = 1; + } + + // Required. Programming language of the `code`. + Language language = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The code to be executed. + string code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Result of executing the `ExecutableCode`. +// +// Only generated when using the `CodeExecution`, and always follows a `part` +// containing the `ExecutableCode`. +message CodeExecutionResult { + // Enumeration of possible outcomes of the code execution. + enum Outcome { + // Unspecified status. This value should not be used. + OUTCOME_UNSPECIFIED = 0; + + // Code execution completed successfully. + OUTCOME_OK = 1; + + // Code execution finished but with a failure. `stderr` should contain the + // reason. + OUTCOME_FAILED = 2; + + // Code execution ran for too long, and was cancelled. There may or may not + // be a partial output present. + OUTCOME_DEADLINE_EXCEEDED = 3; + } + + // Required. Outcome of the code execution. + Outcome outcome = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Contains stdout when code execution is successful, stderr or + // other description otherwise. + string output = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // Tool details that the model may use to generate response. // // A `Tool` is a piece of code that enables the system to interact with @@ -143,8 +202,18 @@ message Tool { // turn. repeated FunctionDeclaration function_declarations = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables the model to execute code as part of generation. + CodeExecution code_execution = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Tool that executes code generated by the model, and automatically returns +// the result to the model. +// +// See also `ExecutableCode` and `CodeExecutionResult` which are only generated +// when using this tool. +message CodeExecution {} + // The Tool configuration containing parameters for specifying `Tool` use // in the request. message ToolConfig { @@ -162,7 +231,7 @@ message FunctionCallingConfig { MODE_UNSPECIFIED = 0; // Default model behavior, model decides to predict either a function call - // or a natural language repspose. + // or a natural language response. AUTO = 1; // Model is constrained to always predicting a function call only. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto index b9ba40ae435..93a530ddad7 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/generative_service.proto @@ -188,6 +188,17 @@ message GenerateContentRequest { // Optional. Configuration options for model generation and outputs. optional GenerationConfig generation_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the cached content used as context to serve the + // prediction. Note: only used in explicit caching, where users can have + // control over caching (e.g. what content to cache) and enjoy guaranteed cost + // savings. Format: `cachedContents/{cachedContent}` + optional string cached_content = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/CachedContent" + } + ]; } // Configuration options for model generation and outputs. Not all parameters @@ -309,7 +320,7 @@ message GenerateContentResponse { // `safety_ratings` to understand which safety category blocked it. SAFETY = 1; - // Prompt was blocked due to unknown reaasons. + // Prompt was blocked due to unknown reasons. OTHER = 2; } @@ -324,9 +335,15 @@ message GenerateContentResponse { // Metadata on the generation request's token usage. message UsageMetadata { - // Number of tokens in the prompt. + // Number of tokens in the prompt. When cached_content is set, this is still + // the total effective prompt size. I.e. this includes the number of tokens + // in the cached content. int32 prompt_token_count = 1; + // Number of tokens in the cached part of the prompt, i.e. in the cached + // content. + int32 cached_content_token_count = 4; + // Total number of tokens across the generated candidates. int32 candidates_token_count = 2; @@ -704,6 +721,12 @@ message CountTokensRequest { message CountTokensResponse { // The number of tokens that the `model` tokenizes the `prompt` into. // - // Always non-negative. + // Always non-negative. When cached_content is set, this is still the total + // effective prompt size. I.e. this includes the number of tokens in the + // cached content. int32 total_tokens = 1; + + // Number of tokens in the cached part of the prompt, i.e. in the cached + // content. + int32 cached_content_token_count = 5; } diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto index 5320db5a2aa..2fe19b36df1 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model.proto @@ -77,13 +77,16 @@ message Model { // 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. + // Values can range over `[0.0,max_temperature]`, inclusive. A higher value + // 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; + // The maximum temperature this model can use. + optional float max_temperature = 13; + // For Nucleus sampling. // // Nucleus sampling considers the smallest set of tokens whose probability diff --git a/packages/google-ai-generativelanguage/protos/protos.d.ts b/packages/google-ai-generativelanguage/protos/protos.d.ts index b45ccd9a729..e53f7f0f4de 100644 --- a/packages/google-ai-generativelanguage/protos/protos.d.ts +++ b/packages/google-ai-generativelanguage/protos/protos.d.ts @@ -2960,228 +2960,1014 @@ export namespace google { /** Namespace v1beta. */ namespace v1beta { - /** Properties of a CitationMetadata. */ - interface ICitationMetadata { + /** Represents a CacheService */ + class CacheService extends $protobuf.rpc.Service { + + /** + * Constructs a new CacheService 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 CacheService 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): CacheService; + + /** + * Calls ListCachedContents. + * @param request ListCachedContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCachedContentsResponse + */ + public listCachedContents(request: google.ai.generativelanguage.v1beta.IListCachedContentsRequest, callback: google.ai.generativelanguage.v1beta.CacheService.ListCachedContentsCallback): void; + + /** + * Calls ListCachedContents. + * @param request ListCachedContentsRequest message or plain object + * @returns Promise + */ + public listCachedContents(request: google.ai.generativelanguage.v1beta.IListCachedContentsRequest): Promise; + + /** + * Calls CreateCachedContent. + * @param request CreateCachedContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CachedContent + */ + public createCachedContent(request: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.CreateCachedContentCallback): void; + + /** + * Calls CreateCachedContent. + * @param request CreateCachedContentRequest message or plain object + * @returns Promise + */ + public createCachedContent(request: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest): Promise; + + /** + * Calls GetCachedContent. + * @param request GetCachedContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CachedContent + */ + public getCachedContent(request: google.ai.generativelanguage.v1beta.IGetCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.GetCachedContentCallback): void; + + /** + * Calls GetCachedContent. + * @param request GetCachedContentRequest message or plain object + * @returns Promise + */ + public getCachedContent(request: google.ai.generativelanguage.v1beta.IGetCachedContentRequest): Promise; + + /** + * Calls UpdateCachedContent. + * @param request UpdateCachedContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CachedContent + */ + public updateCachedContent(request: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContentCallback): void; + + /** + * Calls UpdateCachedContent. + * @param request UpdateCachedContentRequest message or plain object + * @returns Promise + */ + public updateCachedContent(request: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest): Promise; + + /** + * Calls DeleteCachedContent. + * @param request DeleteCachedContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCachedContent(request: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, callback: google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContentCallback): void; + + /** + * Calls DeleteCachedContent. + * @param request DeleteCachedContentRequest message or plain object + * @returns Promise + */ + public deleteCachedContent(request: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): Promise; + } + + namespace CacheService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|listCachedContents}. + * @param error Error, if any + * @param [response] ListCachedContentsResponse + */ + type ListCachedContentsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.ListCachedContentsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|createCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type CreateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|getCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type GetCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|updateCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type UpdateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|deleteCachedContent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCachedContentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListCachedContentsRequest. */ + interface IListCachedContentsRequest { + + /** ListCachedContentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCachedContentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCachedContentsRequest. */ + class ListCachedContentsRequest implements IListCachedContentsRequest { + + /** + * Constructs a new ListCachedContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsRequest); + + /** ListCachedContentsRequest pageSize. */ + public pageSize: number; + + /** ListCachedContentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCachedContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCachedContentsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsRequest): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + + /** + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * @param message ListCachedContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IListCachedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * @param message ListCachedContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IListCachedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCachedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCachedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + + /** + * Verifies a ListCachedContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCachedContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + + /** + * Creates a plain object from a ListCachedContentsRequest message. Also converts values to other types if specified. + * @param message ListCachedContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.ListCachedContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCachedContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCachedContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCachedContentsResponse. */ + interface IListCachedContentsResponse { + + /** ListCachedContentsResponse cachedContents */ + cachedContents?: (google.ai.generativelanguage.v1beta.ICachedContent[]|null); + + /** ListCachedContentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCachedContentsResponse. */ + class ListCachedContentsResponse implements IListCachedContentsResponse { + + /** + * Constructs a new ListCachedContentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsResponse); + + /** ListCachedContentsResponse cachedContents. */ + public cachedContents: google.ai.generativelanguage.v1beta.ICachedContent[]; + + /** ListCachedContentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCachedContentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCachedContentsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsResponse): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + + /** + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages. + * @param message ListCachedContentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IListCachedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages. + * @param message ListCachedContentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IListCachedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCachedContentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCachedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + + /** + * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCachedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + + /** + * Verifies a ListCachedContentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCachedContentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + + /** + * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified. + * @param message ListCachedContentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.ListCachedContentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCachedContentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCachedContentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCachedContentRequest. */ + interface ICreateCachedContentRequest { + + /** CreateCachedContentRequest cachedContent */ + cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + } + + /** Represents a CreateCachedContentRequest. */ + class CreateCachedContentRequest implements ICreateCachedContentRequest { + + /** + * Constructs a new CreateCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest); + + /** CreateCachedContentRequest cachedContent. */ + public cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + + /** + * Creates a new CreateCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCachedContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest): google.ai.generativelanguage.v1beta.CreateCachedContentRequest; + + /** + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages. + * @param message CreateCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages. + * @param message CreateCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCachedContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CreateCachedContentRequest; + + /** + * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CreateCachedContentRequest; + + /** + * Verifies a CreateCachedContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCachedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CreateCachedContentRequest; + + /** + * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified. + * @param message CreateCachedContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.CreateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCachedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCachedContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCachedContentRequest. */ + interface IGetCachedContentRequest { + + /** GetCachedContentRequest name */ + name?: (string|null); + } + + /** Represents a GetCachedContentRequest. */ + class GetCachedContentRequest implements IGetCachedContentRequest { + + /** + * Constructs a new GetCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IGetCachedContentRequest); + + /** GetCachedContentRequest name. */ + public name: string; + + /** + * Creates a new GetCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCachedContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IGetCachedContentRequest): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + + /** + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * @param message GetCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IGetCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * @param message GetCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IGetCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCachedContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + + /** + * Decodes a GetCachedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + + /** + * Verifies a GetCachedContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCachedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + + /** + * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified. + * @param message GetCachedContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.GetCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCachedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCachedContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCachedContentRequest. */ + interface IUpdateCachedContentRequest { + + /** UpdateCachedContentRequest cachedContent */ + cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + + /** UpdateCachedContentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCachedContentRequest. */ + class UpdateCachedContentRequest implements IUpdateCachedContentRequest { + + /** + * Constructs a new UpdateCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest); + + /** UpdateCachedContentRequest cachedContent. */ + public cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + + /** UpdateCachedContentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCachedContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; - /** CitationMetadata citationSources */ - citationSources?: (google.ai.generativelanguage.v1beta.ICitationSource[]|null); + /** + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages. + * @param message UpdateCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages. + * @param message UpdateCachedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCachedContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; + + /** + * Decodes an UpdateCachedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; + + /** + * Verifies an UpdateCachedContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCachedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; + + /** + * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified. + * @param message UpdateCachedContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.UpdateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCachedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCachedContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a CitationMetadata. */ - class CitationMetadata implements ICitationMetadata { + /** Properties of a DeleteCachedContentRequest. */ + interface IDeleteCachedContentRequest { + + /** DeleteCachedContentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCachedContentRequest. */ + class DeleteCachedContentRequest implements IDeleteCachedContentRequest { /** - * Constructs a new CitationMetadata. + * Constructs a new DeleteCachedContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ICitationMetadata); + constructor(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest); - /** CitationMetadata citationSources. */ - public citationSources: google.ai.generativelanguage.v1beta.ICitationSource[]; + /** DeleteCachedContentRequest name. */ + public name: string; /** - * Creates a new CitationMetadata instance using the specified properties. + * Creates a new DeleteCachedContentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CitationMetadata instance + * @returns DeleteCachedContentRequest instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.ICitationMetadata): google.ai.generativelanguage.v1beta.CitationMetadata; + public static create(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; /** - * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. - * @param message CitationMetadata message or plain object to encode + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * @param message DeleteCachedContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. - * @param message CitationMetadata message or plain object to encode + * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * @param message DeleteCachedContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CitationMetadata message from the specified reader or buffer. + * Decodes a DeleteCachedContentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CitationMetadata + * @returns DeleteCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CitationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; /** - * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CitationMetadata + * @returns DeleteCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CitationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; /** - * Verifies a CitationMetadata message. + * Verifies a DeleteCachedContentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CitationMetadata + * @returns DeleteCachedContentRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CitationMetadata; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; /** - * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. - * @param message CitationMetadata + * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified. + * @param message DeleteCachedContentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CitationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1beta.DeleteCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CitationMetadata to JSON. + * Converts this DeleteCachedContentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CitationMetadata + * Gets the default type url for DeleteCachedContentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CitationSource. */ - interface ICitationSource { + /** Properties of a CachedContent. */ + interface ICachedContent { - /** CitationSource startIndex */ - startIndex?: (number|null); + /** CachedContent expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); - /** CitationSource endIndex */ - endIndex?: (number|null); + /** CachedContent ttl */ + ttl?: (google.protobuf.IDuration|null); - /** CitationSource uri */ - uri?: (string|null); + /** CachedContent name */ + name?: (string|null); - /** CitationSource license */ - license?: (string|null); + /** CachedContent displayName */ + displayName?: (string|null); + + /** CachedContent model */ + model?: (string|null); + + /** CachedContent systemInstruction */ + systemInstruction?: (google.ai.generativelanguage.v1beta.IContent|null); + + /** CachedContent contents */ + contents?: (google.ai.generativelanguage.v1beta.IContent[]|null); + + /** CachedContent tools */ + tools?: (google.ai.generativelanguage.v1beta.ITool[]|null); + + /** CachedContent toolConfig */ + toolConfig?: (google.ai.generativelanguage.v1beta.IToolConfig|null); + + /** CachedContent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent usageMetadata */ + usageMetadata?: (google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null); } - /** Represents a CitationSource. */ - class CitationSource implements ICitationSource { + /** Represents a CachedContent. */ + class CachedContent implements ICachedContent { /** - * Constructs a new CitationSource. + * Constructs a new CachedContent. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ICitationSource); + constructor(properties?: google.ai.generativelanguage.v1beta.ICachedContent); - /** CitationSource startIndex. */ - public startIndex?: (number|null); + /** CachedContent expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); - /** CitationSource endIndex. */ - public endIndex?: (number|null); + /** CachedContent ttl. */ + public ttl?: (google.protobuf.IDuration|null); - /** CitationSource uri. */ - public uri?: (string|null); + /** CachedContent name. */ + public name?: (string|null); - /** CitationSource license. */ - public license?: (string|null); + /** CachedContent displayName. */ + public displayName?: (string|null); - /** CitationSource _startIndex. */ - public _startIndex?: "startIndex"; + /** CachedContent model. */ + public model?: (string|null); - /** CitationSource _endIndex. */ - public _endIndex?: "endIndex"; + /** CachedContent systemInstruction. */ + public systemInstruction?: (google.ai.generativelanguage.v1beta.IContent|null); - /** CitationSource _uri. */ - public _uri?: "uri"; + /** CachedContent contents. */ + public contents: google.ai.generativelanguage.v1beta.IContent[]; - /** CitationSource _license. */ - public _license?: "license"; + /** CachedContent tools. */ + public tools: google.ai.generativelanguage.v1beta.ITool[]; + + /** CachedContent toolConfig. */ + public toolConfig?: (google.ai.generativelanguage.v1beta.IToolConfig|null); + + /** CachedContent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent usageMetadata. */ + public usageMetadata?: (google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null); + + /** CachedContent expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** CachedContent _name. */ + public _name?: "name"; + + /** CachedContent _displayName. */ + public _displayName?: "displayName"; + + /** CachedContent _model. */ + public _model?: "model"; + + /** CachedContent _systemInstruction. */ + public _systemInstruction?: "systemInstruction"; + + /** CachedContent _toolConfig. */ + public _toolConfig?: "toolConfig"; /** - * Creates a new CitationSource instance using the specified properties. + * Creates a new CachedContent instance using the specified properties. * @param [properties] Properties to set - * @returns CitationSource instance + * @returns CachedContent instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.ICitationSource): google.ai.generativelanguage.v1beta.CitationSource; + public static create(properties?: google.ai.generativelanguage.v1beta.ICachedContent): google.ai.generativelanguage.v1beta.CachedContent; /** - * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. - * @param message CitationSource message or plain object to encode + * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * @param message CachedContent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1beta.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. - * @param message CitationSource message or plain object to encode + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * @param message CachedContent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CitationSource message from the specified reader or buffer. + * Decodes a CachedContent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CitationSource + * @returns CachedContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CitationSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CachedContent; /** - * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * Decodes a CachedContent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CitationSource + * @returns CachedContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CitationSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CachedContent; /** - * Verifies a CitationSource message. + * Verifies a CachedContent message. * @param message Plain object 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. + * Creates a CachedContent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CitationSource + * @returns CachedContent */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CitationSource; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CachedContent; /** - * Creates a plain object from a CitationSource message. Also converts values to other types if specified. - * @param message CitationSource + * Creates a plain object from a CachedContent message. Also converts values to other types if specified. + * @param message CachedContent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CitationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1beta.CachedContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CitationSource to JSON. + * Converts this CachedContent 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; + /** + * Gets the default type url for CachedContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CachedContent { + + /** Properties of a UsageMetadata. */ + interface IUsageMetadata { + + /** UsageMetadata totalTokenCount */ + totalTokenCount?: (number|null); + } + + /** Represents a UsageMetadata. */ + class UsageMetadata implements IUsageMetadata { + + /** + * Constructs a new UsageMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata); + + /** UsageMetadata totalTokenCount. */ + public totalTokenCount: number; + + /** + * Creates a new UsageMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * @param message UsageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * @param message UsageMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + + /** + * Decodes a UsageMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + + /** + * Verifies a UsageMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + + /** + * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified. + * @param message UsageMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Type enum. */ @@ -3315,6 +4101,12 @@ export namespace google { /** Part fileData */ fileData?: (google.ai.generativelanguage.v1beta.IFileData|null); + + /** Part executableCode */ + executableCode?: (google.ai.generativelanguage.v1beta.IExecutableCode|null); + + /** Part codeExecutionResult */ + codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); } /** Represents a Part. */ @@ -3341,8 +4133,14 @@ export namespace google { /** Part fileData. */ public fileData?: (google.ai.generativelanguage.v1beta.IFileData|null); + /** Part executableCode. */ + public executableCode?: (google.ai.generativelanguage.v1beta.IExecutableCode|null); + + /** Part codeExecutionResult. */ + public codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); + /** Part data. */ - public data?: ("text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"); + public data?: ("text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"); /** * Creates a new Part instance using the specified properties. @@ -3628,97 +4426,420 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExecutableCode. */ + interface IExecutableCode { + + /** ExecutableCode language */ + language?: (google.ai.generativelanguage.v1beta.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1beta.ExecutableCode.Language|null); + + /** ExecutableCode code */ + code?: (string|null); + } + + /** Represents an ExecutableCode. */ + class ExecutableCode implements IExecutableCode { + + /** + * Constructs a new ExecutableCode. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IExecutableCode); + + /** ExecutableCode language. */ + public language: (google.ai.generativelanguage.v1beta.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1beta.ExecutableCode.Language); + + /** ExecutableCode code. */ + public code: string; + + /** + * Creates a new ExecutableCode instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutableCode instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IExecutableCode): google.ai.generativelanguage.v1beta.ExecutableCode; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * @param message ExecutableCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * @param message ExecutableCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.ExecutableCode; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.ExecutableCode; + + /** + * Verifies an ExecutableCode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutableCode + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ExecutableCode; + + /** + * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. + * @param message ExecutableCode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.ExecutableCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutableCode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutableCode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutableCode { + + /** Language enum. */ + enum Language { + LANGUAGE_UNSPECIFIED = 0, + PYTHON = 1 + } + } + + /** Properties of a CodeExecutionResult. */ + interface ICodeExecutionResult { + + /** CodeExecutionResult outcome */ + outcome?: (google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|null); + + /** CodeExecutionResult output */ + output?: (string|null); + } + + /** Represents a CodeExecutionResult. */ + class CodeExecutionResult implements ICodeExecutionResult { + + /** + * Constructs a new CodeExecutionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ICodeExecutionResult); + + /** CodeExecutionResult outcome. */ + public outcome: (google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome); + + /** CodeExecutionResult output. */ + public output: string; + + /** + * Creates a new CodeExecutionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeExecutionResult instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ICodeExecutionResult): google.ai.generativelanguage.v1beta.CodeExecutionResult; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * @param message CodeExecutionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * @param message CodeExecutionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CodeExecutionResult; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CodeExecutionResult; + + /** + * Verifies a CodeExecutionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeExecutionResult + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CodeExecutionResult; + + /** + * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. + * @param message CodeExecutionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.CodeExecutionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeExecutionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeExecutionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CodeExecutionResult { + + /** Outcome enum. */ + enum Outcome { + OUTCOME_UNSPECIFIED = 0, + OUTCOME_OK = 1, + OUTCOME_FAILED = 2, + OUTCOME_DEADLINE_EXCEEDED = 3 + } + } + /** Properties of a Tool. */ interface ITool { - /** Tool functionDeclarations */ - functionDeclarations?: (google.ai.generativelanguage.v1beta.IFunctionDeclaration[]|null); + /** Tool functionDeclarations */ + functionDeclarations?: (google.ai.generativelanguage.v1beta.IFunctionDeclaration[]|null); + + /** Tool codeExecution */ + codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + } + + /** Represents a Tool. */ + class Tool implements ITool { + + /** + * Constructs a new Tool. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ITool); + + /** Tool functionDeclarations. */ + public functionDeclarations: google.ai.generativelanguage.v1beta.IFunctionDeclaration[]; + + /** Tool codeExecution. */ + public codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + + /** + * Creates a new Tool instance using the specified properties. + * @param [properties] Properties to set + * @returns Tool instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ITool): google.ai.generativelanguage.v1beta.Tool; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * @param message Tool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.Tool; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.Tool; + + /** + * Verifies a Tool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tool + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Tool; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @param message Tool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CodeExecution. */ + interface ICodeExecution { } - /** Represents a Tool. */ - class Tool implements ITool { + /** Represents a CodeExecution. */ + class CodeExecution implements ICodeExecution { /** - * Constructs a new Tool. + * Constructs a new CodeExecution. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ITool); - - /** Tool functionDeclarations. */ - public functionDeclarations: google.ai.generativelanguage.v1beta.IFunctionDeclaration[]; + constructor(properties?: google.ai.generativelanguage.v1beta.ICodeExecution); /** - * Creates a new Tool instance using the specified properties. + * Creates a new CodeExecution instance using the specified properties. * @param [properties] Properties to set - * @returns Tool instance + * @returns CodeExecution instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.ITool): google.ai.generativelanguage.v1beta.Tool; + public static create(properties?: google.ai.generativelanguage.v1beta.ICodeExecution): google.ai.generativelanguage.v1beta.CodeExecution; /** - * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode + * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages. + * @param message CodeExecution message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1beta.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. - * @param message Tool message or plain object to encode + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages. + * @param message CodeExecution message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ITool, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Tool message from the specified reader or buffer. + * Decodes a CodeExecution message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Tool + * @returns CodeExecution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.Tool; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CodeExecution; /** - * Decodes a Tool message from the specified reader or buffer, length delimited. + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Tool + * @returns CodeExecution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.Tool; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CodeExecution; /** - * Verifies a Tool message. + * Verifies a CodeExecution message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Tool + * @returns CodeExecution */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Tool; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CodeExecution; /** - * Creates a plain object from a Tool message. Also converts values to other types if specified. - * @param message Tool + * Creates a plain object from a CodeExecution message. Also converts values to other types if specified. + * @param message CodeExecution * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1beta.CodeExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Tool to JSON. + * Converts this CodeExecution to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Tool + * Gets the default type url for CodeExecution * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -4534,65 +5655,289 @@ export namespace google { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IGroundingPassages, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1beta.IGroundingPassages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. + * @param message GroundingPassages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IGroundingPassages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingPassages message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingPassages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.GroundingPassages; + + /** + * Decodes a GroundingPassages message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingPassages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.GroundingPassages; + + /** + * Verifies a GroundingPassages message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingPassages message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingPassages + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.GroundingPassages; + + /** + * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified. + * @param message GroundingPassages + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.GroundingPassages, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingPassages to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingPassages + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CitationMetadata. */ + interface ICitationMetadata { + + /** CitationMetadata citationSources */ + citationSources?: (google.ai.generativelanguage.v1beta.ICitationSource[]|null); + } + + /** Represents a CitationMetadata. */ + class CitationMetadata implements ICitationMetadata { + + /** + * Constructs a new CitationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ICitationMetadata); + + /** CitationMetadata citationSources. */ + public citationSources: google.ai.generativelanguage.v1beta.ICitationSource[]; + + /** + * Creates a new CitationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CitationMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ICitationMetadata): google.ai.generativelanguage.v1beta.CitationMetadata; + + /** + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.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.v1beta.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.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.v1beta.ICitationMetadata, 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.v1beta.CitationMetadata; + + /** + * 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.v1beta.CitationMetadata; + + /** + * 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); + + /** + * 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.v1beta.CitationMetadata; + + /** + * 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.v1beta.CitationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [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; + } + + /** Properties of a CitationSource. */ + interface ICitationSource { + + /** CitationSource startIndex */ + startIndex?: (number|null); + + /** CitationSource endIndex */ + endIndex?: (number|null); + + /** CitationSource uri */ + uri?: (string|null); + + /** CitationSource license */ + license?: (string|null); + } + + /** Represents a CitationSource. */ + class CitationSource implements ICitationSource { + + /** + * Constructs a new CitationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ICitationSource); + + /** CitationSource startIndex. */ + public startIndex?: (number|null); + + /** CitationSource endIndex. */ + public endIndex?: (number|null); + + /** CitationSource uri. */ + public uri?: (string|null); + + /** CitationSource license. */ + public license?: (string|null); + + /** CitationSource _startIndex. */ + public _startIndex?: "startIndex"; + + /** CitationSource _endIndex. */ + public _endIndex?: "endIndex"; + + /** CitationSource _uri. */ + public _uri?: "uri"; + + /** CitationSource _license. */ + public _license?: "license"; + + /** + * Creates a new CitationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CitationSource instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ICitationSource): google.ai.generativelanguage.v1beta.CitationSource; + + /** + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.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.v1beta.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. - * @param message GroundingPassages message or plain object to encode + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.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.v1beta.IGroundingPassages, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroundingPassages message from the specified reader or buffer. + * 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 GroundingPassages + * @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.v1beta.GroundingPassages; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1beta.CitationSource; /** - * Decodes a GroundingPassages message from the specified reader or buffer, length delimited. + * Decodes a CitationSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroundingPassages + * @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.v1beta.GroundingPassages; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1beta.CitationSource; /** - * Verifies a GroundingPassages message. + * 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 GroundingPassages message from a plain object. Also converts values to their respective internal types. + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroundingPassages + * @returns CitationSource */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.GroundingPassages; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CitationSource; /** - * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified. - * @param message GroundingPassages + * 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.v1beta.GroundingPassages, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1beta.CitationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroundingPassages to JSON. + * Converts this CitationSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GroundingPassages + * Gets the default type url for CitationSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -7068,6 +8413,9 @@ export namespace google { /** GenerateContentRequest generationConfig */ generationConfig?: (google.ai.generativelanguage.v1beta.IGenerationConfig|null); + + /** GenerateContentRequest cachedContent */ + cachedContent?: (string|null); } /** Represents a GenerateContentRequest. */ @@ -7100,12 +8448,18 @@ export namespace google { /** GenerateContentRequest generationConfig. */ public generationConfig?: (google.ai.generativelanguage.v1beta.IGenerationConfig|null); + /** GenerateContentRequest cachedContent. */ + public cachedContent?: (string|null); + /** GenerateContentRequest _systemInstruction. */ public _systemInstruction?: "systemInstruction"; /** GenerateContentRequest _generationConfig. */ public _generationConfig?: "generationConfig"; + /** GenerateContentRequest _cachedContent. */ + public _cachedContent?: "cachedContent"; + /** * Creates a new GenerateContentRequest instance using the specified properties. * @param [properties] Properties to set @@ -7695,6 +9049,9 @@ export namespace google { /** UsageMetadata promptTokenCount */ promptTokenCount?: (number|null); + /** UsageMetadata cachedContentTokenCount */ + cachedContentTokenCount?: (number|null); + /** UsageMetadata candidatesTokenCount */ candidatesTokenCount?: (number|null); @@ -7714,6 +9071,9 @@ export namespace google { /** UsageMetadata promptTokenCount. */ public promptTokenCount: number; + /** UsageMetadata cachedContentTokenCount. */ + public cachedContentTokenCount: number; + /** UsageMetadata candidatesTokenCount. */ public candidatesTokenCount: number; @@ -9388,6 +10748,9 @@ export namespace google { /** CountTokensResponse totalTokens */ totalTokens?: (number|null); + + /** CountTokensResponse cachedContentTokenCount */ + cachedContentTokenCount?: (number|null); } /** Represents a CountTokensResponse. */ @@ -9402,6 +10765,9 @@ export namespace google { /** CountTokensResponse totalTokens. */ public totalTokens: number; + /** CountTokensResponse cachedContentTokenCount. */ + public cachedContentTokenCount: number; + /** * Creates a new CountTokensResponse instance using the specified properties. * @param [properties] Properties to set @@ -10430,6 +11796,9 @@ export namespace google { /** Model temperature */ temperature?: (number|null); + /** Model maxTemperature */ + maxTemperature?: (number|null); + /** Model topP */ topP?: (number|null); @@ -10473,6 +11842,9 @@ export namespace google { /** Model temperature. */ public temperature?: (number|null); + /** Model maxTemperature. */ + public maxTemperature?: (number|null); + /** Model topP. */ public topP?: (number|null); @@ -10482,6 +11854,9 @@ export namespace google { /** Model _temperature. */ public _temperature?: "temperature"; + /** Model _maxTemperature. */ + public _maxTemperature?: "maxTemperature"; + /** Model _topP. */ public _topP?: "topP"; @@ -34322,109 +35697,6 @@ export namespace google { 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 { } @@ -34612,6 +35884,109 @@ export namespace google { */ 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; + } } /** Namespace rpc. */ diff --git a/packages/google-ai-generativelanguage/protos/protos.js b/packages/google-ai-generativelanguage/protos/protos.js index 02be69110dd..2bd4927ce1c 100644 --- a/packages/google-ai-generativelanguage/protos/protos.js +++ b/packages/google-ai-generativelanguage/protos/protos.js @@ -7418,25 +7418,225 @@ */ var v1beta = {}; - v1beta.CitationMetadata = (function() { + v1beta.CacheService = (function() { /** - * Properties of a CitationMetadata. + * Constructs a new CacheService service. * @memberof google.ai.generativelanguage.v1beta - * @interface ICitationMetadata - * @property {Array.|null} [citationSources] CitationMetadata citationSources + * @classdesc Represents a CacheService + * @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 CacheService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CacheService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CacheService; /** - * Constructs a new CitationMetadata. + * Creates new CacheService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @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 {CacheService} RPC service. Useful where requests and/or responses are streamed. + */ + CacheService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|listCachedContents}. + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @typedef ListCachedContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} [response] ListCachedContentsResponse + */ + + /** + * Calls ListCachedContents. + * @function listCachedContents + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.CacheService.ListCachedContentsCallback} callback Node-style callback called with the error, if any, and ListCachedContentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CacheService.prototype.listCachedContents = function listCachedContents(request, callback) { + return this.rpcCall(listCachedContents, $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest, $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse, request, callback); + }, "name", { value: "ListCachedContents" }); + + /** + * Calls ListCachedContents. + * @function listCachedContents + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|createCachedContent}. + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @typedef CreateCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + */ + + /** + * Calls CreateCachedContent. + * @function createCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.CacheService.CreateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CacheService.prototype.createCachedContent = function createCachedContent(request, callback) { + return this.rpcCall(createCachedContent, $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback); + }, "name", { value: "CreateCachedContent" }); + + /** + * Calls CreateCachedContent. + * @function createCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|getCachedContent}. + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @typedef GetCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + */ + + /** + * Calls GetCachedContent. + * @function getCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} request GetCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.CacheService.GetCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CacheService.prototype.getCachedContent = function getCachedContent(request, callback) { + return this.rpcCall(getCachedContent, $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback); + }, "name", { value: "GetCachedContent" }); + + /** + * Calls GetCachedContent. + * @function getCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} request GetCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|updateCachedContent}. + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @typedef UpdateCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + */ + + /** + * Calls UpdateCachedContent. + * @function updateCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CacheService.prototype.updateCachedContent = function updateCachedContent(request, callback) { + return this.rpcCall(updateCachedContent, $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest, $root.google.ai.generativelanguage.v1beta.CachedContent, request, callback); + }, "name", { value: "UpdateCachedContent" }); + + /** + * Calls UpdateCachedContent. + * @function updateCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|deleteCachedContent}. + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @typedef DeleteCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCachedContent. + * @function deleteCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CacheService.prototype.deleteCachedContent = function deleteCachedContent(request, callback) { + return this.rpcCall(deleteCachedContent, $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCachedContent" }); + + /** + * Calls DeleteCachedContent. + * @function deleteCachedContent + * @memberof google.ai.generativelanguage.v1beta.CacheService + * @instance + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CacheService; + })(); + + v1beta.ListCachedContentsRequest = (function() { + + /** + * Properties of a ListCachedContentsRequest. * @memberof google.ai.generativelanguage.v1beta - * @classdesc Represents a CitationMetadata. - * @implements ICitationMetadata + * @interface IListCachedContentsRequest + * @property {number|null} [pageSize] ListCachedContentsRequest pageSize + * @property {string|null} [pageToken] ListCachedContentsRequest pageToken + */ + + /** + * Constructs a new ListCachedContentsRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ListCachedContentsRequest. + * @implements IListCachedContentsRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set */ - function CitationMetadata(properties) { - this.citationSources = []; + function ListCachedContentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7444,78 +7644,89 @@ } /** - * CitationMetadata citationSources. - * @member {Array.} citationSources - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * ListCachedContentsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @instance */ - CitationMetadata.prototype.citationSources = $util.emptyArray; + ListCachedContentsRequest.prototype.pageSize = 0; /** - * Creates a new CitationMetadata instance using the specified properties. + * ListCachedContentsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @instance + */ + ListCachedContentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCachedContentsRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata instance + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest instance */ - CitationMetadata.create = function create(properties) { - return new CitationMetadata(properties); + ListCachedContentsRequest.create = function create(properties) { + return new ListCachedContentsRequest(properties); }; /** - * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CitationMetadata.encode = function encode(message, writer) { + ListCachedContentsRequest.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.v1beta.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListCachedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CitationMetadata message from the specified reader or buffer. + * Decodes a ListCachedContentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest * @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) { + ListCachedContentsRequest.decode = function 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.v1beta.CitationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest(); 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.v1beta.CitationSource.decode(reader, reader.uint32())); + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); break; } default: @@ -7527,142 +7738,379 @@ }; /** - * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest * @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) { + ListCachedContentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CitationMetadata message. + * Verifies a ListCachedContentsRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest * @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) { + ListCachedContentsRequest.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.v1beta.CitationSource.verify(message.citationSources[i]); + 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 ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest + */ + ListCachedContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest(); + 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 ListCachedContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} message ListCachedContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCachedContentsRequest.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 ListCachedContentsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCachedContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCachedContentsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCachedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsRequest"; + }; + + return ListCachedContentsRequest; + })(); + + v1beta.ListCachedContentsResponse = (function() { + + /** + * Properties of a ListCachedContentsResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface IListCachedContentsResponse + * @property {Array.|null} [cachedContents] ListCachedContentsResponse cachedContents + * @property {string|null} [nextPageToken] ListCachedContentsResponse nextPageToken + */ + + /** + * Constructs a new ListCachedContentsResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ListCachedContentsResponse. + * @implements IListCachedContentsResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set + */ + function ListCachedContentsResponse(properties) { + this.cachedContents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCachedContentsResponse cachedContents. + * @member {Array.} cachedContents + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @instance + */ + ListCachedContentsResponse.prototype.cachedContents = $util.emptyArray; + + /** + * ListCachedContentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @instance + */ + ListCachedContentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCachedContentsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse instance + */ + ListCachedContentsResponse.create = function create(properties) { + return new ListCachedContentsResponse(properties); + }; + + /** + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCachedContentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cachedContents != null && message.cachedContents.length) + for (var i = 0; i < message.cachedContents.length; ++i) + $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContents[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 ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCachedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCachedContentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCachedContentsResponse.decode = function 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.v1beta.ListCachedContentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cachedContents && message.cachedContents.length)) + message.cachedContents = []; + message.cachedContents.push($root.google.ai.generativelanguage.v1beta.CachedContent.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCachedContentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCachedContentsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCachedContentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cachedContents != null && message.hasOwnProperty("cachedContents")) { + if (!Array.isArray(message.cachedContents)) + return "cachedContents: array expected"; + for (var i = 0; i < message.cachedContents.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContents[i]); if (error) - return "citationSources." + error; + return "cachedContents." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse */ - CitationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationMetadata) + ListCachedContentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); - if (object.citationSources) { - if (!Array.isArray(object.citationSources)) - throw TypeError(".google.ai.generativelanguage.v1beta.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.v1beta.CitationMetadata.citationSources: object expected"); - message.citationSources[i] = $root.google.ai.generativelanguage.v1beta.CitationSource.fromObject(object.citationSources[i]); + var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse(); + if (object.cachedContents) { + if (!Array.isArray(object.cachedContents)) + throw TypeError(".google.ai.generativelanguage.v1beta.ListCachedContentsResponse.cachedContents: array expected"); + message.cachedContents = []; + for (var i = 0; i < object.cachedContents.length; ++i) { + if (typeof object.cachedContents[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.ListCachedContentsResponse.cachedContents: object expected"); + message.cachedContents[i] = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContents[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse * @static - * @param {google.ai.generativelanguage.v1beta.CitationMetadata} message CitationMetadata + * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} message ListCachedContentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CitationMetadata.toObject = function toObject(message, options) { + ListCachedContentsResponse.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.v1beta.CitationSource.toObject(message.citationSources[j], options); + object.cachedContents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.cachedContents && message.cachedContents.length) { + object.cachedContents = []; + for (var j = 0; j < message.cachedContents.length; ++j) + object.cachedContents[j] = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContents[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CitationMetadata to JSON. + * Converts this ListCachedContentsResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse * @instance * @returns {Object.} JSON object */ - CitationMetadata.prototype.toJSON = function toJSON() { + ListCachedContentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CitationMetadata + * Gets the default type url for ListCachedContentsResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListCachedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationMetadata"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsResponse"; }; - return CitationMetadata; + return ListCachedContentsResponse; })(); - v1beta.CitationSource = (function() { + v1beta.CreateCachedContentRequest = (function() { /** - * Properties of a CitationSource. + * Properties of a CreateCachedContentRequest. * @memberof google.ai.generativelanguage.v1beta - * @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 + * @interface ICreateCachedContentRequest + * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent */ /** - * Constructs a new CitationSource. + * Constructs a new CreateCachedContentRequest. * @memberof google.ai.generativelanguage.v1beta - * @classdesc Represents a CitationSource. - * @implements ICitationSource + * @classdesc Represents a CreateCachedContentRequest. + * @implements ICreateCachedContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set */ - function CitationSource(properties) { + function CreateCachedContentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7670,164 +8118,1168 @@ } /** - * CitationSource startIndex. - * @member {number|null|undefined} startIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CreateCachedContentRequest cachedContent. + * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest * @instance */ - CitationSource.prototype.startIndex = null; + CreateCachedContentRequest.prototype.cachedContent = null; /** - * CitationSource endIndex. - * @member {number|null|undefined} endIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * Creates a new CreateCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest instance + */ + CreateCachedContentRequest.create = function create(properties) { + return new CreateCachedContentRequest(properties); + }; + + /** + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCachedContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent")) + $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCachedContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCachedContentRequest.decode = function 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.v1beta.CreateCachedContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCachedContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCachedContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContent); + if (error) + return "cachedContent." + error; + } + return null; + }; + + /** + * Creates a CreateCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest + */ + CreateCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest(); + if (object.cachedContent != null) { + if (typeof object.cachedContent !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CreateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContent); + } + return message; + }; + + /** + * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} message CreateCachedContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCachedContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cachedContent = null; + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) + object.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContent, options); + return object; + }; + + /** + * Converts this CreateCachedContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCachedContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCachedContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateCachedContentRequest"; + }; + + return CreateCachedContentRequest; + })(); + + v1beta.GetCachedContentRequest = (function() { + + /** + * Properties of a GetCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGetCachedContentRequest + * @property {string|null} [name] GetCachedContentRequest name + */ + + /** + * Constructs a new GetCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GetCachedContentRequest. + * @implements IGetCachedContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set + */ + function GetCachedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCachedContentRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @instance + */ + GetCachedContentRequest.prototype.name = ""; + + /** + * Creates a new GetCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest instance + */ + GetCachedContentRequest.create = function create(properties) { + return new GetCachedContentRequest(properties); + }; + + /** + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCachedContentRequest.encode = function encode(message, writer) { + 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 GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCachedContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCachedContentRequest.decode = function 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.v1beta.GetCachedContentRequest(); + 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 GetCachedContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCachedContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCachedContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCachedContentRequest.verify = function verify(message) { + if (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 GetCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest + */ + GetCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.GetCachedContentRequest} message GetCachedContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCachedContentRequest.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 GetCachedContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @instance + * @returns {Object.} JSON object + */ + GetCachedContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCachedContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetCachedContentRequest"; + }; + + return GetCachedContentRequest; + })(); + + v1beta.UpdateCachedContentRequest = (function() { + + /** + * Properties of an UpdateCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IUpdateCachedContentRequest + * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCachedContentRequest updateMask + */ + + /** + * Constructs a new UpdateCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an UpdateCachedContentRequest. + * @implements IUpdateCachedContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set + */ + function UpdateCachedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCachedContentRequest cachedContent. + * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @instance + */ + UpdateCachedContentRequest.prototype.cachedContent = null; + + /** + * UpdateCachedContentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @instance + */ + UpdateCachedContentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest instance + */ + UpdateCachedContentRequest.create = function create(properties) { + return new UpdateCachedContentRequest(properties); + }; + + /** + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCachedContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent")) + $root.google.ai.generativelanguage.v1beta.CachedContent.encode(message.cachedContent, 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 UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCachedContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCachedContentRequest.decode = function 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.v1beta.UpdateCachedContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.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 UpdateCachedContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCachedContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCachedContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCachedContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + var error = $root.google.ai.generativelanguage.v1beta.CachedContent.verify(message.cachedContent); + if (error) + return "cachedContent." + 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 UpdateCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest + */ + UpdateCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest(); + if (object.cachedContent != null) { + if (typeof object.cachedContent !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.fromObject(object.cachedContent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} message UpdateCachedContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCachedContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cachedContent = null; + object.updateMask = null; + } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) + object.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCachedContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCachedContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCachedContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateCachedContentRequest"; + }; + + return UpdateCachedContentRequest; + })(); + + v1beta.DeleteCachedContentRequest = (function() { + + /** + * Properties of a DeleteCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IDeleteCachedContentRequest + * @property {string|null} [name] DeleteCachedContentRequest name + */ + + /** + * Constructs a new DeleteCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a DeleteCachedContentRequest. + * @implements IDeleteCachedContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set + */ + function DeleteCachedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCachedContentRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @instance + */ + DeleteCachedContentRequest.prototype.name = ""; + + /** + * Creates a new DeleteCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest instance + */ + DeleteCachedContentRequest.create = function create(properties) { + return new DeleteCachedContentRequest(properties); + }; + + /** + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCachedContentRequest.encode = function encode(message, writer) { + 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 DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCachedContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCachedContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCachedContentRequest.decode = function 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.v1beta.DeleteCachedContentRequest(); + 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 DeleteCachedContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCachedContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCachedContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCachedContentRequest.verify = function verify(message) { + if (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 DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest + */ + DeleteCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} message DeleteCachedContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCachedContentRequest.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 DeleteCachedContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCachedContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCachedContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCachedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteCachedContentRequest"; + }; + + return DeleteCachedContentRequest; + })(); + + v1beta.CachedContent = (function() { + + /** + * Properties of a CachedContent. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICachedContent + * @property {google.protobuf.ITimestamp|null} [expireTime] CachedContent expireTime + * @property {google.protobuf.IDuration|null} [ttl] CachedContent ttl + * @property {string|null} [name] CachedContent name + * @property {string|null} [displayName] CachedContent displayName + * @property {string|null} [model] CachedContent model + * @property {google.ai.generativelanguage.v1beta.IContent|null} [systemInstruction] CachedContent systemInstruction + * @property {Array.|null} [contents] CachedContent contents + * @property {Array.|null} [tools] CachedContent tools + * @property {google.ai.generativelanguage.v1beta.IToolConfig|null} [toolConfig] CachedContent toolConfig + * @property {google.protobuf.ITimestamp|null} [createTime] CachedContent createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CachedContent updateTime + * @property {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null} [usageMetadata] CachedContent usageMetadata + */ + + /** + * Constructs a new CachedContent. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CachedContent. + * @implements ICachedContent + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set + */ + function CachedContent(properties) { + this.contents = []; + this.tools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CachedContent expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.expireTime = null; + + /** + * CachedContent ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.ttl = null; + + /** + * CachedContent name. + * @member {string|null|undefined} name + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.name = null; + + /** + * CachedContent displayName. + * @member {string|null|undefined} displayName + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.displayName = null; + + /** + * CachedContent model. + * @member {string|null|undefined} model + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.model = null; + + /** + * CachedContent systemInstruction. + * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.systemInstruction = null; + + /** + * CachedContent contents. + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.contents = $util.emptyArray; + + /** + * CachedContent tools. + * @member {Array.} tools + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.tools = $util.emptyArray; + + /** + * CachedContent toolConfig. + * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.toolConfig = null; + + /** + * CachedContent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.createTime = null; + + /** + * CachedContent updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + CachedContent.prototype.updateTime = null; + + /** + * CachedContent usageMetadata. + * @member {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null|undefined} usageMetadata + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - CitationSource.prototype.endIndex = null; + CachedContent.prototype.usageMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * CitationSource uri. - * @member {string|null|undefined} uri - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - CitationSource.prototype.uri = null; + Object.defineProperty(CachedContent.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * CitationSource license. - * @member {string|null|undefined} license - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent _name. + * @member {"name"|undefined} _name + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - CitationSource.prototype.license = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Object.defineProperty(CachedContent.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * CitationSource _startIndex. - * @member {"startIndex"|undefined} _startIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - Object.defineProperty(CitationSource.prototype, "_startIndex", { - get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + Object.defineProperty(CachedContent.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), set: $util.oneOfSetter($oneOfFields) }); /** - * CitationSource _endIndex. - * @member {"endIndex"|undefined} _endIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent _model. + * @member {"model"|undefined} _model + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - Object.defineProperty(CitationSource.prototype, "_endIndex", { - get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + Object.defineProperty(CachedContent.prototype, "_model", { + get: $util.oneOfGetter($oneOfFields = ["model"]), set: $util.oneOfSetter($oneOfFields) }); /** - * CitationSource _uri. - * @member {"uri"|undefined} _uri - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - Object.defineProperty(CitationSource.prototype, "_uri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), + Object.defineProperty(CachedContent.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), set: $util.oneOfSetter($oneOfFields) }); /** - * CitationSource _license. - * @member {"license"|undefined} _license - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * CachedContent _toolConfig. + * @member {"toolConfig"|undefined} _toolConfig + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance */ - Object.defineProperty(CitationSource.prototype, "_license", { - get: $util.oneOfGetter($oneOfFields = ["license"]), + Object.defineProperty(CachedContent.prototype, "_toolConfig", { + get: $util.oneOfGetter($oneOfFields = ["toolConfig"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new CitationSource instance using the specified properties. + * Creates a new CachedContent instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource instance + * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent instance */ - CitationSource.create = function create(properties) { - return new CitationSource(properties); + CachedContent.create = function create(properties) { + return new CachedContent(properties); }; /** - * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. + * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CitationSource.encode = function encode(message, writer) { + CachedContent.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); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) + $root.google.ai.generativelanguage.v1beta.Content.encode(message.systemInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.ai.generativelanguage.v1beta.Content.encode(message.contents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.ai.generativelanguage.v1beta.Tool.encode(message.tools[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolConfig != null && Object.hasOwnProperty.call(message, "toolConfig")) + $root.google.ai.generativelanguage.v1beta.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, 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.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata")) + $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CitationSource.encodeDelimited = function encodeDelimited(message, writer) { + CachedContent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CitationSource message from the specified reader or buffer. + * Decodes a CachedContent message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent * @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) { + CachedContent.decode = function 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.v1beta.CitationSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CachedContent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 9: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } case 1: { - message.startIndex = reader.int32(); + message.name = reader.string(); + break; + } + case 11: { + message.displayName = reader.string(); break; } case 2: { - message.endIndex = reader.int32(); + message.model = reader.string(); break; } case 3: { - message.uri = reader.string(); + message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); break; } case 4: { - message.license = reader.string(); + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.ai.generativelanguage.v1beta.Tool.decode(reader, reader.uint32())); + break; + } + case 6: { + message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.decode(reader, reader.uint32()); break; } default: @@ -7839,142 +9291,500 @@ }; /** - * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * Decodes a CachedContent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent * @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) { + CachedContent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CitationSource message. + * Verifies a CachedContent message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @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) { + CachedContent.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.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } } - if (message.endIndex != null && message.hasOwnProperty("endIndex")) { - properties._endIndex = 1; - if (!$util.isInteger(message.endIndex)) - return "endIndex: integer expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } } - if (message.uri != null && message.hasOwnProperty("uri")) { - properties._uri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; } - if (message.license != null && message.hasOwnProperty("license")) { - properties._license = 1; - if (!$util.isString(message.license)) - return "license: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.model != null && message.hasOwnProperty("model")) { + properties._model = 1; + if (!$util.isString(message.model)) + return "model: string expected"; + } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + properties._systemInstruction = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.systemInstruction); + if (error) + return "systemInstruction." + error; + } + } + if (message.contents != null && message.hasOwnProperty("contents")) { + if (!Array.isArray(message.contents)) + return "contents: array expected"; + for (var i = 0; i < message.contents.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } + if (message.tools != null && message.hasOwnProperty("tools")) { + if (!Array.isArray(message.tools)) + return "tools: array expected"; + for (var i = 0; i < message.tools.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) { + properties._toolConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig); + if (error) + return "toolConfig." + 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; + } + if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) { + var error = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify(message.usageMetadata); + if (error) + return "usageMetadata." + error; } return null; }; /** - * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. + * Creates a CachedContent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent */ - CitationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationSource) + CachedContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent) return object; - var message = new $root.google.ai.generativelanguage.v1beta.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); + var message = new $root.google.ai.generativelanguage.v1beta.CachedContent(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.model != null) + message.model = String(object.model); + if (object.systemInstruction != null) { + if (typeof object.systemInstruction !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.systemInstruction: object expected"); + message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.systemInstruction); + } + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]); + } + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.tools: object expected"); + message.tools[i] = $root.google.ai.generativelanguage.v1beta.Tool.fromObject(object.tools[i]); + } + } + if (object.toolConfig != null) { + if (typeof object.toolConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.toolConfig: object expected"); + message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.fromObject(object.toolConfig); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.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.v1beta.CachedContent.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.usageMetadata != null) { + if (typeof object.usageMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.usageMetadata: object expected"); + message.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.fromObject(object.usageMetadata); + } return message; }; /** - * Creates a plain object from a CitationSource message. Also converts values to other types if specified. + * Creates a plain object from a CachedContent message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.CitationSource} message CitationSource + * @param {google.ai.generativelanguage.v1beta.CachedContent} message CachedContent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CitationSource.toObject = function toObject(message, options) { + CachedContent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.startIndex != null && message.hasOwnProperty("startIndex")) { - object.startIndex = message.startIndex; + if (options.arrays || options.defaults) { + object.contents = []; + object.tools = []; + } + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.usageMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; if (options.oneofs) - object._startIndex = "startIndex"; + object._name = "name"; } - if (message.endIndex != null && message.hasOwnProperty("endIndex")) { - object.endIndex = message.endIndex; + if (message.model != null && message.hasOwnProperty("model")) { + object.model = message.model; if (options.oneofs) - object._endIndex = "endIndex"; + object._model = "model"; } - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options); if (options.oneofs) - object._uri = "uri"; + object._systemInstruction = "systemInstruction"; } - if (message.license != null && message.hasOwnProperty("license")) { - object.license = message.license; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.contents[j], options); + } + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.ai.generativelanguage.v1beta.Tool.toObject(message.tools[j], options); + } + if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) { + object.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.toObject(message.toolConfig, options); if (options.oneofs) - object._license = "license"; + object._toolConfig = "toolConfig"; + } + 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.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; } + if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) + object.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.toObject(message.usageMetadata, options); return object; }; /** - * Converts this CitationSource to JSON. + * Converts this CachedContent to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @instance * @returns {Object.} JSON object */ - CitationSource.prototype.toJSON = function toJSON() { + CachedContent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CitationSource + * Gets the default type url for CachedContent * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1beta.CachedContent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CachedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationSource"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent"; }; - return CitationSource; + CachedContent.UsageMetadata = (function() { + + /** + * Properties of a UsageMetadata. + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @interface IUsageMetadata + * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount + */ + + /** + * Constructs a new UsageMetadata. + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @classdesc Represents a UsageMetadata. + * @implements IUsageMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set + */ + function UsageMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageMetadata totalTokenCount. + * @member {number} totalTokenCount + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.totalTokenCount = 0; + + /** + * Creates a new UsageMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata instance + */ + UsageMetadata.create = function create(properties) { + return new UsageMetadata(properties); + }; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokenCount); + return writer; + }; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageMetadata.decode = function 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.v1beta.CachedContent.UsageMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalTokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount")) + if (!$util.isInteger(message.totalTokenCount)) + return "totalTokenCount: integer expected"; + return null; + }; + + /** + * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata + */ + UsageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata(); + if (object.totalTokenCount != null) + message.totalTokenCount = object.totalTokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} message UsageMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.totalTokenCount = 0; + if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount")) + object.totalTokenCount = message.totalTokenCount; + return object; + }; + + /** + * Converts this UsageMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @instance + * @returns {Object.} JSON object + */ + UsageMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata"; + }; + + return UsageMetadata; + })(); + + return CachedContent; })(); /** @@ -8260,6 +10070,8 @@ * @property {google.ai.generativelanguage.v1beta.IFunctionCall|null} [functionCall] Part functionCall * @property {google.ai.generativelanguage.v1beta.IFunctionResponse|null} [functionResponse] Part functionResponse * @property {google.ai.generativelanguage.v1beta.IFileData|null} [fileData] Part fileData + * @property {google.ai.generativelanguage.v1beta.IExecutableCode|null} [executableCode] Part executableCode + * @property {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult */ /** @@ -8302,32 +10114,48 @@ Part.prototype.functionCall = null; /** - * Part functionResponse. - * @member {google.ai.generativelanguage.v1beta.IFunctionResponse|null|undefined} functionResponse + * Part functionResponse. + * @member {google.ai.generativelanguage.v1beta.IFunctionResponse|null|undefined} functionResponse + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.functionResponse = null; + + /** + * Part fileData. + * @member {google.ai.generativelanguage.v1beta.IFileData|null|undefined} fileData + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.fileData = null; + + /** + * Part executableCode. + * @member {google.ai.generativelanguage.v1beta.IExecutableCode|null|undefined} executableCode * @memberof google.ai.generativelanguage.v1beta.Part * @instance */ - Part.prototype.functionResponse = null; + Part.prototype.executableCode = null; /** - * Part fileData. - * @member {google.ai.generativelanguage.v1beta.IFileData|null|undefined} fileData + * Part codeExecutionResult. + * @member {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null|undefined} codeExecutionResult * @memberof google.ai.generativelanguage.v1beta.Part * @instance */ - Part.prototype.fileData = null; + Part.prototype.codeExecutionResult = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Part data. - * @member {"text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|undefined} data + * @member {"text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"|undefined} data * @memberof google.ai.generativelanguage.v1beta.Part * @instance */ Object.defineProperty(Part.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "functionCall", "functionResponse", "fileData"]), + get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "functionCall", "functionResponse", "fileData", "executableCode", "codeExecutionResult"]), set: $util.oneOfSetter($oneOfFields) }); @@ -8365,6 +10193,10 @@ $root.google.ai.generativelanguage.v1beta.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.fileData != null && Object.hasOwnProperty.call(message, "fileData")) $root.google.ai.generativelanguage.v1beta.FileData.encode(message.fileData, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executableCode != null && Object.hasOwnProperty.call(message, "executableCode")) + $root.google.ai.generativelanguage.v1beta.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult")) + $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -8419,6 +10251,14 @@ message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.decode(reader, reader.uint32()); break; } + case 9: { + message.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.decode(reader, reader.uint32()); + break; + } + case 10: { + message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8500,6 +10340,26 @@ return "fileData." + error; } } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.ExecutableCode.verify(message.executableCode); + if (error) + return "executableCode." + error; + } + } + if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.verify(message.codeExecutionResult); + if (error) + return "codeExecutionResult." + error; + } + } return null; }; @@ -8537,6 +10397,16 @@ throw TypeError(".google.ai.generativelanguage.v1beta.Part.fileData: object expected"); message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.fromObject(object.fileData); } + if (object.executableCode != null) { + if (typeof object.executableCode !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.executableCode: object expected"); + message.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.fromObject(object.executableCode); + } + if (object.codeExecutionResult != null) { + if (typeof object.codeExecutionResult !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.codeExecutionResult: object expected"); + message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.fromObject(object.codeExecutionResult); + } return message; }; @@ -8578,6 +10448,16 @@ if (options.oneofs) object.data = "fileData"; } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + object.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.toObject(message.executableCode, options); + if (options.oneofs) + object.data = "executableCode"; + } + if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) { + object.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.toObject(message.codeExecutionResult, options); + if (options.oneofs) + object.data = "codeExecutionResult"; + } return object; }; @@ -9073,6 +10953,540 @@ return FileData; })(); + v1beta.ExecutableCode = (function() { + + /** + * Properties of an ExecutableCode. + * @memberof google.ai.generativelanguage.v1beta + * @interface IExecutableCode + * @property {google.ai.generativelanguage.v1beta.ExecutableCode.Language|null} [language] ExecutableCode language + * @property {string|null} [code] ExecutableCode code + */ + + /** + * Constructs a new ExecutableCode. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an ExecutableCode. + * @implements IExecutableCode + * @constructor + * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set + */ + function ExecutableCode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutableCode language. + * @member {google.ai.generativelanguage.v1beta.ExecutableCode.Language} language + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @instance + */ + ExecutableCode.prototype.language = 0; + + /** + * ExecutableCode code. + * @member {string} code + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @instance + */ + ExecutableCode.prototype.code = ""; + + /** + * Creates a new ExecutableCode instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode instance + */ + ExecutableCode.create = function create(properties) { + return new ExecutableCode(properties); + }; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutableCode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.language); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.code); + return writer; + }; + + /** + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutableCode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutableCode.decode = function 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.v1beta.ExecutableCode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.language = reader.int32(); + break; + } + case 2: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutableCode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutableCode message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutableCode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.language != null && message.hasOwnProperty("language")) + switch (message.language) { + default: + return "language: enum value expected"; + case 0: + case 1: + break; + } + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode + */ + ExecutableCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ExecutableCode) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ExecutableCode(); + switch (object.language) { + default: + if (typeof object.language === "number") { + message.language = object.language; + break; + } + break; + case "LANGUAGE_UNSPECIFIED": + case 0: + message.language = 0; + break; + case "PYTHON": + case 1: + message.language = 1; + break; + } + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {google.ai.generativelanguage.v1beta.ExecutableCode} message ExecutableCode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutableCode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.language = options.enums === String ? "LANGUAGE_UNSPECIFIED" : 0; + object.code = ""; + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = options.enums === String ? $root.google.ai.generativelanguage.v1beta.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.ai.generativelanguage.v1beta.ExecutableCode.Language[message.language] : message.language; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this ExecutableCode to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @instance + * @returns {Object.} JSON object + */ + ExecutableCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutableCode + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutableCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ExecutableCode"; + }; + + /** + * Language enum. + * @name google.ai.generativelanguage.v1beta.ExecutableCode.Language + * @enum {number} + * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value + * @property {number} PYTHON=1 PYTHON value + */ + ExecutableCode.Language = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LANGUAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PYTHON"] = 1; + return values; + })(); + + return ExecutableCode; + })(); + + v1beta.CodeExecutionResult = (function() { + + /** + * Properties of a CodeExecutionResult. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICodeExecutionResult + * @property {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome + * @property {string|null} [output] CodeExecutionResult output + */ + + /** + * Constructs a new CodeExecutionResult. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CodeExecutionResult. + * @implements ICodeExecutionResult + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set + */ + function CodeExecutionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CodeExecutionResult outcome. + * @member {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome} outcome + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.outcome = 0; + + /** + * CodeExecutionResult output. + * @member {string} output + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.output = ""; + + /** + * Creates a new CodeExecutionResult instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult instance + */ + CodeExecutionResult.create = function create(properties) { + return new CodeExecutionResult(properties); + }; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecutionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.outcome); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.output); + return writer; + }; + + /** + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecutionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecutionResult.decode = function 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.v1beta.CodeExecutionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outcome = reader.int32(); + break; + } + case 2: { + message.output = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecutionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeExecutionResult message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeExecutionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult + */ + CodeExecutionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecutionResult) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CodeExecutionResult(); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "OUTCOME_OK": + case 1: + message.outcome = 1; + break; + case "OUTCOME_FAILED": + case 2: + message.outcome = 2; + break; + case "OUTCOME_DEADLINE_EXCEEDED": + case 3: + message.outcome = 3; + break; + } + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {google.ai.generativelanguage.v1beta.CodeExecutionResult} message CodeExecutionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeExecutionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.output = ""; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome[message.outcome] : message.outcome; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this CodeExecutionResult to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @instance + * @returns {Object.} JSON object + */ + CodeExecutionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeExecutionResult + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeExecutionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecutionResult"; + }; + + /** + * Outcome enum. + * @name google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome + * @enum {number} + * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value + * @property {number} OUTCOME_OK=1 OUTCOME_OK value + * @property {number} OUTCOME_FAILED=2 OUTCOME_FAILED value + * @property {number} OUTCOME_DEADLINE_EXCEEDED=3 OUTCOME_DEADLINE_EXCEEDED value + */ + CodeExecutionResult.Outcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTCOME_OK"] = 1; + values[valuesById[2] = "OUTCOME_FAILED"] = 2; + values[valuesById[3] = "OUTCOME_DEADLINE_EXCEEDED"] = 3; + return values; + })(); + + return CodeExecutionResult; + })(); + v1beta.Tool = (function() { /** @@ -9080,6 +11494,7 @@ * @memberof google.ai.generativelanguage.v1beta * @interface ITool * @property {Array.|null} [functionDeclarations] Tool functionDeclarations + * @property {google.ai.generativelanguage.v1beta.ICodeExecution|null} [codeExecution] Tool codeExecution */ /** @@ -9106,6 +11521,14 @@ */ Tool.prototype.functionDeclarations = $util.emptyArray; + /** + * Tool codeExecution. + * @member {google.ai.generativelanguage.v1beta.ICodeExecution|null|undefined} codeExecution + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.codeExecution = null; + /** * Creates a new Tool instance using the specified properties. * @function create @@ -9133,6 +11556,8 @@ if (message.functionDeclarations != null && message.functionDeclarations.length) for (var i = 0; i < message.functionDeclarations.length; ++i) $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.encode(message.functionDeclarations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution")) + $root.google.ai.generativelanguage.v1beta.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9173,6 +11598,10 @@ message.functionDeclarations.push($root.google.ai.generativelanguage.v1beta.FunctionDeclaration.decode(reader, reader.uint32())); break; } + case 3: { + message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9217,6 +11646,11 @@ return "functionDeclarations." + error; } } + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) { + var error = $root.google.ai.generativelanguage.v1beta.CodeExecution.verify(message.codeExecution); + if (error) + return "codeExecution." + error; + } return null; }; @@ -9242,6 +11676,11 @@ message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.fromObject(object.functionDeclarations[i]); } } + if (object.codeExecution != null) { + if (typeof object.codeExecution !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.codeExecution: object expected"); + message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.fromObject(object.codeExecution); + } return message; }; @@ -9260,11 +11699,15 @@ var object = {}; if (options.arrays || options.defaults) object.functionDeclarations = []; + if (options.defaults) + object.codeExecution = null; if (message.functionDeclarations && message.functionDeclarations.length) { object.functionDeclarations = []; for (var j = 0; j < message.functionDeclarations.length; ++j) object.functionDeclarations[j] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.toObject(message.functionDeclarations[j], options); } + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) + object.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.toObject(message.codeExecution, options); return object; }; @@ -9297,6 +11740,181 @@ return Tool; })(); + v1beta.CodeExecution = (function() { + + /** + * Properties of a CodeExecution. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICodeExecution + */ + + /** + * Constructs a new CodeExecution. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CodeExecution. + * @implements ICodeExecution + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set + */ + function CodeExecution(properties) { + if (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 CodeExecution instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution instance + */ + CodeExecution.create = function create(properties) { + return new CodeExecution(properties); + }; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeExecution message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecution.decode = function 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.v1beta.CodeExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeExecution message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution + */ + CodeExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecution) + return object; + return new $root.google.ai.generativelanguage.v1beta.CodeExecution(); + }; + + /** + * Creates a plain object from a CodeExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {google.ai.generativelanguage.v1beta.CodeExecution} message CodeExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeExecution.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CodeExecution to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @instance + * @returns {Object.} JSON object + */ + CodeExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeExecution + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecution"; + }; + + return CodeExecution; + })(); + v1beta.ToolConfig = (function() { /** @@ -11077,12 +13695,468 @@ /** * Constructs a new GroundingPassage. * @memberof google.ai.generativelanguage.v1beta - * @classdesc Represents a GroundingPassage. - * @implements IGroundingPassage + * @classdesc Represents a GroundingPassage. + * @implements IGroundingPassage + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set + */ + function GroundingPassage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingPassage id. + * @member {string} id + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @instance + */ + GroundingPassage.prototype.id = ""; + + /** + * GroundingPassage content. + * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @instance + */ + GroundingPassage.prototype.content = null; + + /** + * Creates a new GroundingPassage instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage instance + */ + GroundingPassage.create = function create(properties) { + return new GroundingPassage(properties); + }; + + /** + * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassage.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingPassage message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassage.decode = function 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.v1beta.GroundingPassage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingPassage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingPassage message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingPassage.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.content != null && message.hasOwnProperty("content")) { + var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content); + if (error) + return "content." + error; + } + return null; + }; + + /** + * Creates a GroundingPassage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + */ + GroundingPassage.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassage) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassage(); + if (object.id != null) + message.id = String(object.id); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassage.content: object expected"); + message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content); + } + return message; + }; + + /** + * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {google.ai.generativelanguage.v1beta.GroundingPassage} message GroundingPassage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingPassage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.content = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options); + return object; + }; + + /** + * Converts this GroundingPassage to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @instance + * @returns {Object.} JSON object + */ + GroundingPassage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingPassage + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingPassage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassage"; + }; + + return GroundingPassage; + })(); + + v1beta.GroundingPassages = (function() { + + /** + * Properties of a GroundingPassages. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGroundingPassages + * @property {Array.|null} [passages] GroundingPassages passages + */ + + /** + * Constructs a new GroundingPassages. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GroundingPassages. + * @implements IGroundingPassages + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set + */ + function GroundingPassages(properties) { + this.passages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingPassages passages. + * @member {Array.} passages + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @instance + */ + GroundingPassages.prototype.passages = $util.emptyArray; + + /** + * Creates a new GroundingPassages instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages instance + */ + GroundingPassages.create = function create(properties) { + return new GroundingPassages(properties); + }; + + /** + * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassages.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.passages != null && message.passages.length) + for (var i = 0; i < message.passages.length; ++i) + $root.google.ai.generativelanguage.v1beta.GroundingPassage.encode(message.passages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassages.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingPassages message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassages.decode = function 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.v1beta.GroundingPassages(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.passages && message.passages.length)) + message.passages = []; + message.passages.push($root.google.ai.generativelanguage.v1beta.GroundingPassage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingPassages message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassages.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingPassages message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingPassages.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.passages != null && message.hasOwnProperty("passages")) { + if (!Array.isArray(message.passages)) + return "passages: array expected"; + for (var i = 0; i < message.passages.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.GroundingPassage.verify(message.passages[i]); + if (error) + return "passages." + error; + } + } + return null; + }; + + /** + * Creates a GroundingPassages message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + */ + GroundingPassages.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassages) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassages(); + if (object.passages) { + if (!Array.isArray(object.passages)) + throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: array expected"); + message.passages = []; + for (var i = 0; i < object.passages.length; ++i) { + if (typeof object.passages[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: object expected"); + message.passages[i] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.fromObject(object.passages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {google.ai.generativelanguage.v1beta.GroundingPassages} message GroundingPassages + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingPassages.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.passages = []; + if (message.passages && message.passages.length) { + object.passages = []; + for (var j = 0; j < message.passages.length; ++j) + object.passages[j] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.toObject(message.passages[j], options); + } + return object; + }; + + /** + * Converts this GroundingPassages to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @instance + * @returns {Object.} JSON object + */ + GroundingPassages.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingPassages + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingPassages.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassages"; + }; + + return GroundingPassages; + })(); + + v1beta.CitationMetadata = (function() { + + /** + * Properties of a CitationMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICitationMetadata + * @property {Array.|null} [citationSources] CitationMetadata citationSources + */ + + /** + * Constructs a new CitationMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CitationMetadata. + * @implements ICitationMetadata * @constructor - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set */ - function GroundingPassage(properties) { + function CitationMetadata(properties) { + this.citationSources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11090,89 +14164,78 @@ } /** - * GroundingPassage id. - * @member {string} id - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage - * @instance - */ - GroundingPassage.prototype.id = ""; - - /** - * GroundingPassage content. - * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * CitationMetadata citationSources. + * @member {Array.} citationSources + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @instance */ - GroundingPassage.prototype.content = null; + CitationMetadata.prototype.citationSources = $util.emptyArray; /** - * Creates a new GroundingPassage instance using the specified properties. + * Creates a new CitationMetadata instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage instance + * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata instance */ - GroundingPassage.create = function create(properties) { - return new GroundingPassage(properties); + CitationMetadata.create = function create(properties) { + return new CitationMetadata(properties); }; /** - * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages. + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingPassage.encode = function encode(message, writer) { + CitationMetadata.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.content != null && Object.hasOwnProperty.call(message, "content")) - $root.google.ai.generativelanguage.v1beta.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.citationSources != null && message.citationSources.length) + for (var i = 0; i < message.citationSources.length; ++i) + $root.google.ai.generativelanguage.v1beta.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassage.verify|verify} messages. + * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingPassage.encodeDelimited = function encodeDelimited(message, writer) { + CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroundingPassage message from the specified reader or buffer. + * Decodes a CitationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.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.v1beta.GroundingPassage} GroundingPassage + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingPassage.decode = function decode(reader, length) { + 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.v1beta.GroundingPassage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + if (!(message.citationSources && message.citationSources.length)) + message.citationSources = []; + message.citationSources.push($root.google.ai.generativelanguage.v1beta.CitationSource.decode(reader, reader.uint32())); break; } default: @@ -11184,137 +14247,142 @@ }; /** - * Decodes a GroundingPassage message from the specified reader or buffer, length delimited. + * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingPassage.decodeDelimited = function decodeDelimited(reader) { + CitationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroundingPassage message. + * Verifies a CitationMetadata message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroundingPassage.verify = function verify(message) { + CitationMetadata.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.content != null && message.hasOwnProperty("content")) { - var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.content); - if (error) - return "content." + error; + 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.v1beta.CitationSource.verify(message.citationSources[i]); + if (error) + return "citationSources." + error; + } } return null; }; /** - * Creates a GroundingPassage message from a plain object. Also converts values to their respective internal types. + * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata */ - GroundingPassage.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassage) + CitationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationMetadata) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassage(); - if (object.id != null) - message.id = String(object.id); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassage.content: object expected"); - message.content = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.content); + var message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); + if (object.citationSources) { + if (!Array.isArray(object.citationSources)) + throw TypeError(".google.ai.generativelanguage.v1beta.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.v1beta.CitationMetadata.citationSources: object expected"); + message.citationSources[i] = $root.google.ai.generativelanguage.v1beta.CitationSource.fromObject(object.citationSources[i]); + } } return message; }; /** - * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified. + * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.GroundingPassage} message GroundingPassage + * @param {google.ai.generativelanguage.v1beta.CitationMetadata} message CitationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroundingPassage.toObject = function toObject(message, options) { + CitationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.id = ""; - object.content = null; + 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.v1beta.CitationSource.toObject(message.citationSources[j], options); } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.content, options); return object; }; /** - * Converts this GroundingPassage to JSON. + * Converts this CitationMetadata to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @instance * @returns {Object.} JSON object */ - GroundingPassage.prototype.toJSON = function toJSON() { + CitationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GroundingPassage + * Gets the default type url for CitationMetadata * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GroundingPassage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassage"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationMetadata"; }; - return GroundingPassage; + return CitationMetadata; })(); - v1beta.GroundingPassages = (function() { + v1beta.CitationSource = (function() { /** - * Properties of a GroundingPassages. + * Properties of a CitationSource. * @memberof google.ai.generativelanguage.v1beta - * @interface IGroundingPassages - * @property {Array.|null} [passages] GroundingPassages passages + * @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 GroundingPassages. + * Constructs a new CitationSource. * @memberof google.ai.generativelanguage.v1beta - * @classdesc Represents a GroundingPassages. - * @implements IGroundingPassages + * @classdesc Represents a CitationSource. + * @implements ICitationSource * @constructor - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set */ - function GroundingPassages(properties) { - this.passages = []; + function CitationSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11322,78 +14390,164 @@ } /** - * GroundingPassages passages. - * @member {Array.} passages - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * CitationSource startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @instance */ - GroundingPassages.prototype.passages = $util.emptyArray; + CitationSource.prototype.startIndex = null; /** - * Creates a new GroundingPassages instance using the specified properties. + * CitationSource endIndex. + * @member {number|null|undefined} endIndex + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + CitationSource.prototype.endIndex = null; + + /** + * CitationSource uri. + * @member {string|null|undefined} uri + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + CitationSource.prototype.uri = null; + + /** + * CitationSource license. + * @member {string|null|undefined} license + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + CitationSource.prototype.license = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CitationSource _startIndex. + * @member {"startIndex"|undefined} _startIndex + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CitationSource _endIndex. + * @member {"endIndex"|undefined} _endIndex + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_endIndex", { + get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CitationSource _uri. + * @member {"uri"|undefined} _uri + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CitationSource _license. + * @member {"license"|undefined} _license + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_license", { + get: $util.oneOfGetter($oneOfFields = ["license"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CitationSource instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages instance + * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource instance */ - GroundingPassages.create = function create(properties) { - return new GroundingPassages(properties); + CitationSource.create = function create(properties) { + return new CitationSource(properties); }; /** - * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingPassages.encode = function encode(message, writer) { + CitationSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.passages != null && message.passages.length) - for (var i = 0; i < message.passages.length; ++i) - $root.google.ai.generativelanguage.v1beta.GroundingPassage.encode(message.passages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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; }; /** - * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GroundingPassages.verify|verify} messages. + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingPassages.encodeDelimited = function encodeDelimited(message, writer) { + CitationSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroundingPassages message from the specified reader or buffer. + * Decodes a CitationSource message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.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.v1beta.GroundingPassages} GroundingPassages + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingPassages.decode = function decode(reader, length) { + 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.v1beta.GroundingPassages(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.passages && message.passages.length)) - message.passages = []; - message.passages.push($root.google.ai.generativelanguage.v1beta.GroundingPassage.decode(reader, reader.uint32())); + 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: @@ -11405,119 +14559,142 @@ }; /** - * Decodes a GroundingPassages message from the specified reader or buffer, length delimited. + * Decodes a CitationSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingPassages.decodeDelimited = function decodeDelimited(reader) { + CitationSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroundingPassages message. + * Verifies a CitationSource message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroundingPassages.verify = function verify(message) { + CitationSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.passages != null && message.hasOwnProperty("passages")) { - if (!Array.isArray(message.passages)) - return "passages: array expected"; - for (var i = 0; i < message.passages.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.GroundingPassage.verify(message.passages[i]); - if (error) - return "passages." + error; - } + 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; }; /** - * Creates a GroundingPassages message from a plain object. Also converts values to their respective internal types. + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource */ - GroundingPassages.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassages) + CitationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationSource) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassages(); - if (object.passages) { - if (!Array.isArray(object.passages)) - throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: array expected"); - message.passages = []; - for (var i = 0; i < object.passages.length; ++i) { - if (typeof object.passages[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: object expected"); - message.passages[i] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.fromObject(object.passages[i]); - } - } + var message = new $root.google.ai.generativelanguage.v1beta.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; }; /** - * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified. + * Creates a plain object from a CitationSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.GroundingPassages} message GroundingPassages + * @param {google.ai.generativelanguage.v1beta.CitationSource} message CitationSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroundingPassages.toObject = function toObject(message, options) { + CitationSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.passages = []; - if (message.passages && message.passages.length) { - object.passages = []; - for (var j = 0; j < message.passages.length; ++j) - object.passages[j] = $root.google.ai.generativelanguage.v1beta.GroundingPassage.toObject(message.passages[j], options); + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + object.startIndex = message.startIndex; + if (options.oneofs) + object._startIndex = "startIndex"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + object.endIndex = message.endIndex; + if (options.oneofs) + object._endIndex = "endIndex"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.license != null && message.hasOwnProperty("license")) { + object.license = message.license; + if (options.oneofs) + object._license = "license"; } return object; }; /** - * Converts this GroundingPassages to JSON. + * Converts this CitationSource to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @instance * @returns {Object.} JSON object */ - GroundingPassages.prototype.toJSON = function toJSON() { + CitationSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GroundingPassages + * Gets the default type url for CitationSource * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1beta.CitationSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GroundingPassages.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassages"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationSource"; }; - return GroundingPassages; + return CitationSource; })(); v1beta.DiscussService = (function() { @@ -17345,6 +20522,7 @@ * @property {google.ai.generativelanguage.v1beta.IToolConfig|null} [toolConfig] GenerateContentRequest toolConfig * @property {Array.|null} [safetySettings] GenerateContentRequest safetySettings * @property {google.ai.generativelanguage.v1beta.IGenerationConfig|null} [generationConfig] GenerateContentRequest generationConfig + * @property {string|null} [cachedContent] GenerateContentRequest cachedContent */ /** @@ -17421,6 +20599,14 @@ */ GenerateContentRequest.prototype.generationConfig = null; + /** + * GenerateContentRequest cachedContent. + * @member {string|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.cachedContent = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -17446,6 +20632,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * GenerateContentRequest _cachedContent. + * @member {"cachedContent"|undefined} _cachedContent + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + Object.defineProperty(GenerateContentRequest.prototype, "_cachedContent", { + get: $util.oneOfGetter($oneOfFields = ["cachedContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new GenerateContentRequest instance using the specified properties. * @function create @@ -17487,6 +20684,8 @@ $root.google.ai.generativelanguage.v1beta.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) $root.google.ai.generativelanguage.v1beta.Content.encode(message.systemInstruction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cachedContent); return writer; }; @@ -17555,6 +20754,10 @@ message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.decode(reader, reader.uint32()); break; } + case 9: { + message.cachedContent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -17642,6 +20845,11 @@ return "generationConfig." + error; } } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + properties._cachedContent = 1; + if (!$util.isString(message.cachedContent)) + return "cachedContent: string expected"; + } return null; }; @@ -17704,6 +20912,8 @@ throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.generationConfig: object expected"); message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.fromObject(object.generationConfig); } + if (object.cachedContent != null) + message.cachedContent = String(object.cachedContent); return message; }; @@ -17758,6 +20968,11 @@ if (options.oneofs) object._systemInstruction = "systemInstruction"; } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + object.cachedContent = message.cachedContent; + if (options.oneofs) + object._cachedContent = "cachedContent"; + } return object; }; @@ -19187,6 +22402,7 @@ * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse * @interface IUsageMetadata * @property {number|null} [promptTokenCount] UsageMetadata promptTokenCount + * @property {number|null} [cachedContentTokenCount] UsageMetadata cachedContentTokenCount * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount */ @@ -19214,6 +22430,14 @@ */ UsageMetadata.prototype.promptTokenCount = 0; + /** + * UsageMetadata cachedContentTokenCount. + * @member {number} cachedContentTokenCount + * @memberof google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.cachedContentTokenCount = 0; + /** * UsageMetadata candidatesTokenCount. * @member {number} candidatesTokenCount @@ -19260,6 +22484,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.candidatesTokenCount); if (message.totalTokenCount != null && Object.hasOwnProperty.call(message, "totalTokenCount")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalTokenCount); + if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cachedContentTokenCount); return writer; }; @@ -19298,6 +22524,10 @@ message.promptTokenCount = reader.int32(); break; } + case 4: { + message.cachedContentTokenCount = reader.int32(); + break; + } case 2: { message.candidatesTokenCount = reader.int32(); break; @@ -19344,6 +22574,9 @@ if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount")) if (!$util.isInteger(message.promptTokenCount)) return "promptTokenCount: integer expected"; + if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) + if (!$util.isInteger(message.cachedContentTokenCount)) + return "cachedContentTokenCount: integer expected"; if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount")) if (!$util.isInteger(message.candidatesTokenCount)) return "candidatesTokenCount: integer expected"; @@ -19367,6 +22600,8 @@ var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata(); if (object.promptTokenCount != null) message.promptTokenCount = object.promptTokenCount | 0; + if (object.cachedContentTokenCount != null) + message.cachedContentTokenCount = object.cachedContentTokenCount | 0; if (object.candidatesTokenCount != null) message.candidatesTokenCount = object.candidatesTokenCount | 0; if (object.totalTokenCount != null) @@ -19391,6 +22626,7 @@ object.promptTokenCount = 0; object.candidatesTokenCount = 0; object.totalTokenCount = 0; + object.cachedContentTokenCount = 0; } if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount")) object.promptTokenCount = message.promptTokenCount; @@ -19398,6 +22634,8 @@ object.candidatesTokenCount = message.candidatesTokenCount; if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount")) object.totalTokenCount = message.totalTokenCount; + if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) + object.cachedContentTokenCount = message.cachedContentTokenCount; return object; }; @@ -23537,6 +26775,7 @@ * @memberof google.ai.generativelanguage.v1beta * @interface ICountTokensResponse * @property {number|null} [totalTokens] CountTokensResponse totalTokens + * @property {number|null} [cachedContentTokenCount] CountTokensResponse cachedContentTokenCount */ /** @@ -23562,6 +26801,14 @@ */ CountTokensResponse.prototype.totalTokens = 0; + /** + * CountTokensResponse cachedContentTokenCount. + * @member {number} cachedContentTokenCount + * @memberof google.ai.generativelanguage.v1beta.CountTokensResponse + * @instance + */ + CountTokensResponse.prototype.cachedContentTokenCount = 0; + /** * Creates a new CountTokensResponse instance using the specified properties. * @function create @@ -23588,6 +26835,8 @@ writer = $Writer.create(); if (message.totalTokens != null && Object.hasOwnProperty.call(message, "totalTokens")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens); + if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.cachedContentTokenCount); return writer; }; @@ -23626,6 +26875,10 @@ message.totalTokens = reader.int32(); break; } + case 5: { + message.cachedContentTokenCount = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -23664,6 +26917,9 @@ if (message.totalTokens != null && message.hasOwnProperty("totalTokens")) if (!$util.isInteger(message.totalTokens)) return "totalTokens: integer expected"; + if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) + if (!$util.isInteger(message.cachedContentTokenCount)) + return "cachedContentTokenCount: integer expected"; return null; }; @@ -23681,6 +26937,8 @@ var message = new $root.google.ai.generativelanguage.v1beta.CountTokensResponse(); if (object.totalTokens != null) message.totalTokens = object.totalTokens | 0; + if (object.cachedContentTokenCount != null) + message.cachedContentTokenCount = object.cachedContentTokenCount | 0; return message; }; @@ -23697,10 +26955,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.totalTokens = 0; + object.cachedContentTokenCount = 0; + } if (message.totalTokens != null && message.hasOwnProperty("totalTokens")) object.totalTokens = message.totalTokens; + if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) + object.cachedContentTokenCount = message.cachedContentTokenCount; return object; }; @@ -26115,6 +29377,7 @@ * @property {number|null} [outputTokenLimit] Model outputTokenLimit * @property {Array.|null} [supportedGenerationMethods] Model supportedGenerationMethods * @property {number|null} [temperature] Model temperature + * @property {number|null} [maxTemperature] Model maxTemperature * @property {number|null} [topP] Model topP * @property {number|null} [topK] Model topK */ @@ -26207,6 +29470,14 @@ */ Model.prototype.temperature = null; + /** + * Model maxTemperature. + * @member {number|null|undefined} maxTemperature + * @memberof google.ai.generativelanguage.v1beta.Model + * @instance + */ + Model.prototype.maxTemperature = null; + /** * Model topP. * @member {number|null|undefined} topP @@ -26237,6 +29508,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * Model _maxTemperature. + * @member {"maxTemperature"|undefined} _maxTemperature + * @memberof google.ai.generativelanguage.v1beta.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_maxTemperature", { + get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Model _topP. * @member {"topP"|undefined} _topP @@ -26306,6 +29588,8 @@ 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); + if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature")) + writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature); return writer; }; @@ -26378,6 +29662,10 @@ message.temperature = reader.float(); break; } + case 13: { + message.maxTemperature = reader.float(); + break; + } case 10: { message.topP = reader.float(); break; @@ -26455,6 +29743,11 @@ if (typeof message.temperature !== "number") return "temperature: number expected"; } + if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) { + properties._maxTemperature = 1; + if (typeof message.maxTemperature !== "number") + return "maxTemperature: number expected"; + } if (message.topP != null && message.hasOwnProperty("topP")) { properties._topP = 1; if (typeof message.topP !== "number") @@ -26503,6 +29796,8 @@ } if (object.temperature != null) message.temperature = Number(object.temperature); + if (object.maxTemperature != null) + message.maxTemperature = Number(object.maxTemperature); if (object.topP != null) message.topP = Number(object.topP); if (object.topK != null) @@ -26568,6 +29863,11 @@ if (options.oneofs) object._topK = "topK"; } + if (message.maxTemperature != null && message.hasOwnProperty("maxTemperature")) { + object.maxTemperature = options.json && !isFinite(message.maxTemperature) ? String(message.maxTemperature) : message.maxTemperature; + if (options.oneofs) + object._maxTemperature = "maxTemperature"; + } return object; }; @@ -85588,242 +88888,6 @@ 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.Empty = (function() { /** @@ -86218,6 +89282,242 @@ return FieldMask; })(); + 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; + })(); + return protobuf; })(); diff --git a/packages/google-ai-generativelanguage/protos/protos.json b/packages/google-ai-generativelanguage/protos/protos.json index 058401725d7..8627a47ba22 100644 --- a/packages/google-ai-generativelanguage/protos/protos.json +++ b/packages/google-ai-generativelanguage/protos/protos.json @@ -906,70 +906,327 @@ "java_package": "com.google.ai.generativelanguage.v1beta" }, "nested": { - "CitationMetadata": { + "CacheService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "ListCachedContents": { + "requestType": "ListCachedContentsRequest", + "responseType": "ListCachedContentsResponse", + "options": { + "(google.api.http).get": "/v1beta/cachedContents", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/cachedContents" + } + }, + { + "(google.api.method_signature)": "" + } + ] + }, + "CreateCachedContent": { + "requestType": "CreateCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).post": "/v1beta/cachedContents", + "(google.api.http).body": "cached_content", + "(google.api.method_signature)": "cached_content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/cachedContents", + "body": "cached_content" + } + }, + { + "(google.api.method_signature)": "cached_content" + } + ] + }, + "GetCachedContent": { + "requestType": "GetCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).get": "/v1beta/{name=cachedContents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=cachedContents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCachedContent": { + "requestType": "UpdateCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).patch": "/v1beta/{cached_content.name=cachedContents/*}", + "(google.api.http).body": "cached_content", + "(google.api.method_signature)": "cached_content,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{cached_content.name=cachedContents/*}", + "body": "cached_content" + } + }, + { + "(google.api.method_signature)": "cached_content,update_mask" + } + ] + }, + "DeleteCachedContent": { + "requestType": "DeleteCachedContentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=cachedContents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=cachedContents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListCachedContentsRequest": { "fields": { - "citationSources": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCachedContentsResponse": { + "fields": { + "cachedContents": { "rule": "repeated", - "type": "CitationSource", + "type": "CachedContent", "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 } } }, - "CitationSource": { + "CreateCachedContentRequest": { + "fields": { + "cachedContent": { + "type": "CachedContent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCachedContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/CachedContent" + } + } + } + }, + "UpdateCachedContentRequest": { + "fields": { + "cachedContent": { + "type": "CachedContent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteCachedContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/CachedContent" + } + } + } + }, + "CachedContent": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/CachedContent", + "(google.api.resource).pattern": "cachedContents/{id}", + "(google.api.resource).plural": "cachedContents", + "(google.api.resource).singular": "cachedContent" + }, "oneofs": { - "_startIndex": { + "expiration": { "oneof": [ - "startIndex" + "expireTime", + "ttl" ] }, - "_endIndex": { + "_name": { "oneof": [ - "endIndex" + "name" ] }, - "_uri": { + "_displayName": { "oneof": [ - "uri" + "displayName" ] }, - "_license": { + "_model": { "oneof": [ - "license" + "model" + ] + }, + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] + }, + "_toolConfig": { + "oneof": [ + "toolConfig" ] } }, "fields": { - "startIndex": { - "type": "int32", + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 10, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "name": { + "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } }, - "endIndex": { - "type": "int32", - "id": 2, + "displayName": { + "type": "string", + "id": 11, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "IMMUTABLE", "proto3_optional": true } }, - "uri": { + "model": { "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model", + "proto3_optional": true + } + }, + "systemInstruction": { + "type": "Content", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "INPUT_ONLY", "proto3_optional": true } }, - "license": { - "type": "string", + "contents": { + "rule": "repeated", + "type": "Content", "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 5, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "toolConfig": { + "type": "ToolConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY", "proto3_optional": true } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "usageMetadata": { + "type": "UsageMetadata", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "UsageMetadata": { + "fields": { + "totalTokenCount": { + "type": "int32", + "id": 1 + } + } } } }, @@ -1008,7 +1265,9 @@ "inlineData", "functionCall", "functionResponse", - "fileData" + "fileData", + "executableCode", + "codeExecutionResult" ] } }, @@ -1032,6 +1291,14 @@ "fileData": { "type": "FileData", "id": 6 + }, + "executableCode": { + "type": "ExecutableCode", + "id": 9 + }, + "codeExecutionResult": { + "type": "CodeExecutionResult", + "id": 10 } } }, @@ -1065,6 +1332,60 @@ } } }, + "ExecutableCode": { + "fields": { + "language": { + "type": "Language", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "code": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Language": { + "values": { + "LANGUAGE_UNSPECIFIED": 0, + "PYTHON": 1 + } + } + } + }, + "CodeExecutionResult": { + "fields": { + "outcome": { + "type": "Outcome", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "output": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Outcome": { + "values": { + "OUTCOME_UNSPECIFIED": 0, + "OUTCOME_OK": 1, + "OUTCOME_FAILED": 2, + "OUTCOME_DEADLINE_EXCEEDED": 3 + } + } + } + }, "Tool": { "fields": { "functionDeclarations": { @@ -1074,9 +1395,19 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "codeExecution": { + "type": "CodeExecution", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, + "CodeExecution": { + "fields": {} + }, "ToolConfig": { "fields": { "functionCallingConfig": { @@ -1286,6 +1617,73 @@ } } }, + "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" @@ -2073,6 +2471,11 @@ "oneof": [ "generationConfig" ] + }, + "_cachedContent": { + "oneof": [ + "cachedContent" + ] } }, "fields": { @@ -2130,6 +2533,15 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "cachedContent": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/CachedContent", + "proto3_optional": true + } } } }, @@ -2331,6 +2743,10 @@ "type": "int32", "id": 1 }, + "cachedContentTokenCount": { + "type": "int32", + "id": 4 + }, "candidatesTokenCount": { "type": "int32", "id": 2 @@ -2777,6 +3193,10 @@ "totalTokens": { "type": "int32", "id": 1 + }, + "cachedContentTokenCount": { + "type": "int32", + "id": 5 } } }, @@ -3055,6 +3475,11 @@ "temperature" ] }, + "_maxTemperature": { + "oneof": [ + "maxTemperature" + ] + }, "_topP": { "oneof": [ "topP" @@ -3116,6 +3541,13 @@ "proto3_optional": true } }, + "maxTemperature": { + "type": "float", + "id": 13, + "options": { + "proto3_optional": true + } + }, "topP": { "type": "float", "id": 10, @@ -9855,18 +10287,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Empty": { "fields": {} }, @@ -9878,6 +10298,18 @@ "id": 1 } } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } } } }, diff --git a/packages/google-ai-generativelanguage/samples/README.md b/packages/google-ai-generativelanguage/samples/README.md index a59aacafb15..12ec64d908e 100644 --- a/packages/google-ai-generativelanguage/samples/README.md +++ b/packages/google-ai-generativelanguage/samples/README.md @@ -19,6 +19,11 @@ * [Generative_service.stream_generate_content](#generative_service.stream_generate_content) * [Model_service.get_model](#model_service.get_model) * [Model_service.list_models](#model_service.list_models) + * [Cache_service.create_cached_content](#cache_service.create_cached_content) + * [Cache_service.delete_cached_content](#cache_service.delete_cached_content) + * [Cache_service.get_cached_content](#cache_service.get_cached_content) + * [Cache_service.list_cached_contents](#cache_service.list_cached_contents) + * [Cache_service.update_cached_content](#cache_service.update_cached_content) * [Discuss_service.count_message_tokens](#discuss_service.count_message_tokens) * [Discuss_service.generate_message](#discuss_service.generate_message) * [File_service.create_file](#file_service.create_file) @@ -229,6 +234,91 @@ __Usage:__ +### Cache_service.create_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js). + +[![Open in Cloud Shell][shell_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/v1beta/cache_service.create_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js` + + +----- + + + + +### Cache_service.delete_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.delete_cached_content.js). + +[![Open in Cloud Shell][shell_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/v1beta/cache_service.delete_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.delete_cached_content.js` + + +----- + + + + +### Cache_service.get_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.get_cached_content.js). + +[![Open in Cloud Shell][shell_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/v1beta/cache_service.get_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.get_cached_content.js` + + +----- + + + + +### Cache_service.list_cached_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_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-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_contents.js` + + +----- + + + + +### Cache_service.update_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.update_cached_content.js). + +[![Open in Cloud Shell][shell_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/v1beta/cache_service.update_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.update_cached_content.js` + + +----- + + + + ### Discuss_service.count_message_tokens View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.count_message_tokens.js). diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json index 52db7f89834..2513a58c883 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1/snippet_metadata_google.ai.generativelanguage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "2.5.0", + "version": "2.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js new file mode 100644 index 00000000000..9a0c2d33609 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cachedContent) { + // [START generativelanguage_v1beta_generated_CacheService_CreateCachedContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 cached content to create. + */ + // const cachedContent = {} + + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-ai/generativelanguage').v1beta; + + // Instantiates a client + const generativelanguageClient = new CacheServiceClient(); + + async function callCreateCachedContent() { + // Construct request + const request = { + cachedContent, + }; + + // Run request + const response = await generativelanguageClient.createCachedContent(request); + console.log(response); + } + + callCreateCachedContent(); + // [END generativelanguage_v1beta_generated_CacheService_CreateCachedContent_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/v1beta/cache_service.delete_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.delete_cached_content.js new file mode 100644 index 00000000000..d7aea77c3b0 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.delete_cached_content.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v1beta_generated_CacheService_DeleteCachedContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 referring to the content cache entry + * Format: `cachedContents/{id}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-ai/generativelanguage').v1beta; + + // Instantiates a client + const generativelanguageClient = new CacheServiceClient(); + + async function callDeleteCachedContent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteCachedContent(request); + console.log(response); + } + + callDeleteCachedContent(); + // [END generativelanguage_v1beta_generated_CacheService_DeleteCachedContent_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/v1beta/cache_service.get_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.get_cached_content.js new file mode 100644 index 00000000000..13d13fcde5f --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.get_cached_content.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v1beta_generated_CacheService_GetCachedContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 referring to the content cache entry. + * Format: `cachedContents/{id}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-ai/generativelanguage').v1beta; + + // Instantiates a client + const generativelanguageClient = new CacheServiceClient(); + + async function callGetCachedContent() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getCachedContent(request); + console.log(response); + } + + callGetCachedContent(); + // [END generativelanguage_v1beta_generated_CacheService_GetCachedContent_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/v1beta/cache_service.list_cached_contents.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_contents.js new file mode 100644 index 00000000000..6ebd9aea606 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.list_cached_contents.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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_v1beta_generated_CacheService_ListCachedContents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 cached contents to return. The service may + * return fewer than this value. If unspecified, some default (under maximum) + * number of items will be returned. The maximum value is 1000; values above + * 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListCachedContents` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCachedContents` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-ai/generativelanguage').v1beta; + + // Instantiates a client + const generativelanguageClient = new CacheServiceClient(); + + async function callListCachedContents() { + // Construct request + const request = { + }; + + // Run request + const iterable = generativelanguageClient.listCachedContentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCachedContents(); + // [END generativelanguage_v1beta_generated_CacheService_ListCachedContents_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/v1beta/cache_service.update_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.update_cached_content.js new file mode 100644 index 00000000000..2fa9bbff4eb --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.update_cached_content.js @@ -0,0 +1,65 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cachedContent) { + // [START generativelanguage_v1beta_generated_CacheService_UpdateCachedContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 content cache entry to update + */ + // const cachedContent = {} + /** + * The list of fields to update. + */ + // const updateMask = {} + + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-ai/generativelanguage').v1beta; + + // Instantiates a client + const generativelanguageClient = new CacheServiceClient(); + + async function callUpdateCachedContent() { + // Construct request + const request = { + cachedContent, + }; + + // Run request + const response = await generativelanguageClient.updateCachedContent(request); + console.log(response); + } + + callUpdateCachedContent(); + // [END generativelanguage_v1beta_generated_CacheService_UpdateCachedContent_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/v1beta/generative_service.generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js index 2f4b7e144eb..08e1ef7db2b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_content.js @@ -76,6 +76,13 @@ function main(model, contents) { * Optional. Configuration options for model generation and outputs. */ // const generationConfig = {} + /** + * Optional. The name of the cached content used as context to serve the + * prediction. Note: only used in explicit caching, where users can have + * control over caching (e.g. what content to cache) and enjoy guaranteed cost + * savings. Format: `cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' // Imports the Generativelanguage library const {GenerativeServiceClient} = require('@google-ai/generativelanguage').v1beta; diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js index f0a6e33d067..45d60f0e222 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.stream_generate_content.js @@ -76,6 +76,13 @@ function main(model, contents) { * Optional. Configuration options for model generation and outputs. */ // const generationConfig = {} + /** + * Optional. The name of the cached content used as context to serve the + * prediction. Note: only used in explicit caching, where users can have + * control over caching (e.g. what content to cache) and enjoy guaranteed cost + * savings. Format: `cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' // Imports the Generativelanguage library const {GenerativeServiceClient} = require('@google-ai/generativelanguage').v1beta; diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json index 33a3f03b659..89dde0e87c6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/snippet_metadata_google.ai.generativelanguage.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "2.5.0", + "version": "2.6.0", "language": "TYPESCRIPT", "apis": [ { @@ -11,9 +11,217 @@ ] }, "snippets": [ + { + "regionTag": "generativelanguage_v1beta_generated_CacheService_ListCachedContents_async", + "title": "CacheService listCachedContents Sample", + "origin": "API_DEFINITION", + "description": " Lists CachedContents.", + "canonical": true, + "file": "cache_service.list_cached_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCachedContents", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.ListCachedContents", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta.ListCachedContentsResponse", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1beta.CacheServiceClient" + }, + "method": { + "shortName": "ListCachedContents", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.ListCachedContents", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1beta.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta_generated_CacheService_CreateCachedContent_async", + "title": "CacheService createCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Creates CachedContent resource.", + "canonical": true, + "file": "cache_service.create_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.CreateCachedContent", + "async": true, + "parameters": [ + { + "name": "cached_content", + "type": ".google.ai.generativelanguage.v1beta.CachedContent" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1beta.CacheServiceClient" + }, + "method": { + "shortName": "CreateCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.CreateCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1beta.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta_generated_CacheService_GetCachedContent_async", + "title": "CacheService getCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Reads CachedContent resource.", + "canonical": true, + "file": "cache_service.get_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.GetCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1beta.CacheServiceClient" + }, + "method": { + "shortName": "GetCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.GetCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1beta.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta_generated_CacheService_UpdateCachedContent_async", + "title": "CacheService updateCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Updates CachedContent resource (only expiration is updatable).", + "canonical": true, + "file": "cache_service.update_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContent", + "async": true, + "parameters": [ + { + "name": "cached_content", + "type": ".google.ai.generativelanguage.v1beta.CachedContent" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1beta.CacheServiceClient" + }, + "method": { + "shortName": "UpdateCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.UpdateCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1beta.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta_generated_CacheService_DeleteCachedContent_async", + "title": "CacheService deleteCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Deletes CachedContent resource.", + "canonical": true, + "file": "cache_service.delete_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1beta.CacheServiceClient" + }, + "method": { + "shortName": "DeleteCachedContent", + "fullName": "google.ai.generativelanguage.v1beta.CacheService.DeleteCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1beta.CacheService" + } + } + } + }, { "regionTag": "generativelanguage_v1beta_generated_DiscussService_GenerateMessage_async", - "title": "DiscussService generateMessage Sample", + "title": "CacheService generateMessage Sample", "origin": "API_DEFINITION", "description": " Generates a response from the model given an input `MessagePrompt`.", "canonical": true, @@ -73,7 +281,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_DiscussService_CountMessageTokens_async", - "title": "DiscussService countMessageTokens Sample", + "title": "CacheService countMessageTokens Sample", "origin": "API_DEFINITION", "description": " Runs a model's tokenizer on a string and returns the token count.", "canonical": true, @@ -117,7 +325,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_FileService_CreateFile_async", - "title": "DiscussService createFile Sample", + "title": "CacheService createFile Sample", "origin": "API_DEFINITION", "description": " Creates a `File`.", "canonical": true, @@ -157,7 +365,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_FileService_ListFiles_async", - "title": "DiscussService listFiles Sample", + "title": "CacheService listFiles Sample", "origin": "API_DEFINITION", "description": " Lists the metadata for `File`s owned by the requesting project.", "canonical": true, @@ -201,7 +409,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_FileService_GetFile_async", - "title": "DiscussService getFile Sample", + "title": "CacheService getFile Sample", "origin": "API_DEFINITION", "description": " Gets the metadata for the given `File`.", "canonical": true, @@ -241,7 +449,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_FileService_DeleteFile_async", - "title": "DiscussService deleteFile Sample", + "title": "CacheService deleteFile Sample", "origin": "API_DEFINITION", "description": " Deletes the `File`.", "canonical": true, @@ -281,7 +489,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_GenerateContent_async", - "title": "DiscussService generateContent Sample", + "title": "CacheService generateContent Sample", "origin": "API_DEFINITION", "description": " Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.", "canonical": true, @@ -290,7 +498,7 @@ "segments": [ { "start": 25, - "end": 98, + "end": 105, "type": "FULL" } ], @@ -326,6 +534,10 @@ { "name": "generation_config", "type": ".google.ai.generativelanguage.v1beta.GenerationConfig" + }, + { + "name": "cached_content", + "type": "TYPE_STRING" } ], "resultType": ".google.ai.generativelanguage.v1beta.GenerateContentResponse", @@ -345,7 +557,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_GenerateAnswer_async", - "title": "DiscussService generateAnswer Sample", + "title": "CacheService generateAnswer Sample", "origin": "API_DEFINITION", "description": " Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", "canonical": true, @@ -409,7 +621,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_StreamGenerateContent_async", - "title": "DiscussService streamGenerateContent Sample", + "title": "CacheService streamGenerateContent Sample", "origin": "API_DEFINITION", "description": " Generates a streamed response from the model given an input `GenerateContentRequest`.", "canonical": true, @@ -418,7 +630,7 @@ "segments": [ { "start": 25, - "end": 100, + "end": 107, "type": "FULL" } ], @@ -454,6 +666,10 @@ { "name": "generation_config", "type": ".google.ai.generativelanguage.v1beta.GenerationConfig" + }, + { + "name": "cached_content", + "type": "TYPE_STRING" } ], "resultType": ".google.ai.generativelanguage.v1beta.GenerateContentResponse", @@ -473,7 +689,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_EmbedContent_async", - "title": "DiscussService embedContent Sample", + "title": "CacheService embedContent Sample", "origin": "API_DEFINITION", "description": " Generates an embedding from the model given an input `Content`.", "canonical": true, @@ -529,7 +745,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_BatchEmbedContents_async", - "title": "DiscussService batchEmbedContents Sample", + "title": "CacheService batchEmbedContents Sample", "origin": "API_DEFINITION", "description": " Generates multiple embeddings from the model given input text in a synchronous call.", "canonical": true, @@ -573,7 +789,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_GenerativeService_CountTokens_async", - "title": "DiscussService countTokens Sample", + "title": "CacheService countTokens Sample", "origin": "API_DEFINITION", "description": " Runs a model's tokenizer on input content and returns the token count.", "canonical": true, @@ -621,7 +837,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_GetModel_async", - "title": "DiscussService getModel Sample", + "title": "CacheService getModel Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific Model.", "canonical": true, @@ -661,7 +877,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_ListModels_async", - "title": "DiscussService listModels Sample", + "title": "CacheService listModels Sample", "origin": "API_DEFINITION", "description": " Lists models available through the API.", "canonical": true, @@ -705,7 +921,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_GetTunedModel_async", - "title": "DiscussService getTunedModel Sample", + "title": "CacheService getTunedModel Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific TunedModel.", "canonical": true, @@ -745,7 +961,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_ListTunedModels_async", - "title": "DiscussService listTunedModels Sample", + "title": "CacheService listTunedModels Sample", "origin": "API_DEFINITION", "description": " Lists tuned models owned by the user.", "canonical": true, @@ -793,7 +1009,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_CreateTunedModel_async", - "title": "DiscussService createTunedModel Sample", + "title": "CacheService 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, @@ -837,7 +1053,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_UpdateTunedModel_async", - "title": "DiscussService updateTunedModel Sample", + "title": "CacheService updateTunedModel Sample", "origin": "API_DEFINITION", "description": " Updates a tuned model.", "canonical": true, @@ -881,7 +1097,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_ModelService_DeleteTunedModel_async", - "title": "DiscussService deleteTunedModel Sample", + "title": "CacheService deleteTunedModel Sample", "origin": "API_DEFINITION", "description": " Deletes a tuned model.", "canonical": true, @@ -921,7 +1137,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_CreatePermission_async", - "title": "DiscussService createPermission Sample", + "title": "CacheService createPermission Sample", "origin": "API_DEFINITION", "description": " Create a permission to a specific resource.", "canonical": true, @@ -965,7 +1181,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_GetPermission_async", - "title": "DiscussService getPermission Sample", + "title": "CacheService getPermission Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific Permission.", "canonical": true, @@ -1005,7 +1221,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_ListPermissions_async", - "title": "DiscussService listPermissions Sample", + "title": "CacheService listPermissions Sample", "origin": "API_DEFINITION", "description": " Lists permissions for the specific resource.", "canonical": true, @@ -1053,7 +1269,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_UpdatePermission_async", - "title": "DiscussService updatePermission Sample", + "title": "CacheService updatePermission Sample", "origin": "API_DEFINITION", "description": " Updates the permission.", "canonical": true, @@ -1097,7 +1313,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_DeletePermission_async", - "title": "DiscussService deletePermission Sample", + "title": "CacheService deletePermission Sample", "origin": "API_DEFINITION", "description": " Deletes the permission.", "canonical": true, @@ -1137,7 +1353,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_PermissionService_TransferOwnership_async", - "title": "DiscussService transferOwnership Sample", + "title": "CacheService 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, @@ -1181,7 +1397,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_CreateCorpus_async", - "title": "DiscussService createCorpus Sample", + "title": "CacheService createCorpus Sample", "origin": "API_DEFINITION", "description": " Creates an empty `Corpus`.", "canonical": true, @@ -1221,7 +1437,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_GetCorpus_async", - "title": "DiscussService getCorpus Sample", + "title": "CacheService getCorpus Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific `Corpus`.", "canonical": true, @@ -1261,7 +1477,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_UpdateCorpus_async", - "title": "DiscussService updateCorpus Sample", + "title": "CacheService updateCorpus Sample", "origin": "API_DEFINITION", "description": " Updates a `Corpus`.", "canonical": true, @@ -1305,7 +1521,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_DeleteCorpus_async", - "title": "DiscussService deleteCorpus Sample", + "title": "CacheService deleteCorpus Sample", "origin": "API_DEFINITION", "description": " Deletes a `Corpus`.", "canonical": true, @@ -1349,7 +1565,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_ListCorpora_async", - "title": "DiscussService listCorpora Sample", + "title": "CacheService listCorpora Sample", "origin": "API_DEFINITION", "description": " Lists all `Corpora` owned by the user.", "canonical": true, @@ -1393,7 +1609,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_QueryCorpus_async", - "title": "DiscussService queryCorpus Sample", + "title": "CacheService queryCorpus Sample", "origin": "API_DEFINITION", "description": " Performs semantic search over a `Corpus`.", "canonical": true, @@ -1445,7 +1661,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_CreateDocument_async", - "title": "DiscussService createDocument Sample", + "title": "CacheService createDocument Sample", "origin": "API_DEFINITION", "description": " Creates an empty `Document`.", "canonical": true, @@ -1489,7 +1705,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_GetDocument_async", - "title": "DiscussService getDocument Sample", + "title": "CacheService getDocument Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific `Document`.", "canonical": true, @@ -1529,7 +1745,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_UpdateDocument_async", - "title": "DiscussService updateDocument Sample", + "title": "CacheService updateDocument Sample", "origin": "API_DEFINITION", "description": " Updates a `Document`.", "canonical": true, @@ -1573,7 +1789,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_DeleteDocument_async", - "title": "DiscussService deleteDocument Sample", + "title": "CacheService deleteDocument Sample", "origin": "API_DEFINITION", "description": " Deletes a `Document`.", "canonical": true, @@ -1617,7 +1833,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_ListDocuments_async", - "title": "DiscussService listDocuments Sample", + "title": "CacheService listDocuments Sample", "origin": "API_DEFINITION", "description": " Lists all `Document`s in a `Corpus`.", "canonical": true, @@ -1665,7 +1881,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_QueryDocument_async", - "title": "DiscussService queryDocument Sample", + "title": "CacheService queryDocument Sample", "origin": "API_DEFINITION", "description": " Performs semantic search over a `Document`.", "canonical": true, @@ -1717,7 +1933,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_CreateChunk_async", - "title": "DiscussService createChunk Sample", + "title": "CacheService createChunk Sample", "origin": "API_DEFINITION", "description": " Creates a `Chunk`.", "canonical": true, @@ -1761,7 +1977,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_BatchCreateChunks_async", - "title": "DiscussService batchCreateChunks Sample", + "title": "CacheService batchCreateChunks Sample", "origin": "API_DEFINITION", "description": " Batch create `Chunk`s.", "canonical": true, @@ -1805,7 +2021,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_GetChunk_async", - "title": "DiscussService getChunk Sample", + "title": "CacheService getChunk Sample", "origin": "API_DEFINITION", "description": " Gets information about a specific `Chunk`.", "canonical": true, @@ -1845,7 +2061,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_UpdateChunk_async", - "title": "DiscussService updateChunk Sample", + "title": "CacheService updateChunk Sample", "origin": "API_DEFINITION", "description": " Updates a `Chunk`.", "canonical": true, @@ -1889,7 +2105,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_BatchUpdateChunks_async", - "title": "DiscussService batchUpdateChunks Sample", + "title": "CacheService batchUpdateChunks Sample", "origin": "API_DEFINITION", "description": " Batch update `Chunk`s.", "canonical": true, @@ -1933,7 +2149,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_DeleteChunk_async", - "title": "DiscussService deleteChunk Sample", + "title": "CacheService deleteChunk Sample", "origin": "API_DEFINITION", "description": " Deletes a `Chunk`.", "canonical": true, @@ -1973,7 +2189,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_BatchDeleteChunks_async", - "title": "DiscussService batchDeleteChunks Sample", + "title": "CacheService batchDeleteChunks Sample", "origin": "API_DEFINITION", "description": " Batch delete `Chunk`s.", "canonical": true, @@ -2017,7 +2233,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_RetrieverService_ListChunks_async", - "title": "DiscussService listChunks Sample", + "title": "CacheService listChunks Sample", "origin": "API_DEFINITION", "description": " Lists all `Chunk`s in a `Document`.", "canonical": true, @@ -2065,7 +2281,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_TextService_GenerateText_async", - "title": "DiscussService generateText Sample", + "title": "CacheService generateText Sample", "origin": "API_DEFINITION", "description": " Generates a response from the model given an input message.", "canonical": true, @@ -2137,7 +2353,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_TextService_EmbedText_async", - "title": "DiscussService embedText Sample", + "title": "CacheService embedText Sample", "origin": "API_DEFINITION", "description": " Generates an embedding from the model given an input message.", "canonical": true, @@ -2181,7 +2397,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_TextService_BatchEmbedText_async", - "title": "DiscussService batchEmbedText Sample", + "title": "CacheService batchEmbedText Sample", "origin": "API_DEFINITION", "description": " Generates multiple embeddings from the model given input text in a synchronous call.", "canonical": true, @@ -2229,7 +2445,7 @@ }, { "regionTag": "generativelanguage_v1beta_generated_TextService_CountTextTokens_async", - "title": "DiscussService countTextTokens Sample", + "title": "CacheService countTextTokens Sample", "origin": "API_DEFINITION", "description": " Runs a model's tokenizer on a text and returns the token count.", "canonical": true, 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 7ed5ca47be4..c193d5820e2 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": "2.5.0", + "version": "2.6.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 7ed5ca47be4..c193d5820e2 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": "2.5.0", + "version": "2.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json b/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json index fd0f75661b6..799a79ce4df 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-generativelanguage", - "version": "2.5.0", + "version": "2.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/package.json b/packages/google-ai-generativelanguage/samples/package.json index 7ef4d3d7ac0..342a51957d9 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": "^2.5.0" + "@google-ai/generativelanguage": "^2.6.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-ai-generativelanguage/src/index.ts b/packages/google-ai-generativelanguage/src/index.ts index ea611c077e6..a36b63f07ea 100644 --- a/packages/google-ai-generativelanguage/src/index.ts +++ b/packages/google-ai-generativelanguage/src/index.ts @@ -21,6 +21,8 @@ import * as v1beta from './v1beta'; import * as v1beta2 from './v1beta2'; import * as v1beta3 from './v1beta3'; +const CacheServiceClient = v1beta.CacheServiceClient; +type CacheServiceClient = v1beta.CacheServiceClient; const DiscussServiceClient = v1beta.DiscussServiceClient; type DiscussServiceClient = v1beta.DiscussServiceClient; const FileServiceClient = v1beta.FileServiceClient; @@ -41,6 +43,7 @@ export { v1beta, v1beta2, v1beta3, + CacheServiceClient, DiscussServiceClient, FileServiceClient, GenerativeServiceClient, @@ -54,6 +57,7 @@ export default { v1beta, v1beta2, v1beta3, + CacheServiceClient, DiscussServiceClient, FileServiceClient, GenerativeServiceClient, diff --git a/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts new file mode 100644 index 00000000000..9841ecf7b16 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts @@ -0,0 +1,1288 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/cache_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cache_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * API for managing cache of content (CachedContent resources) that can be used + * in GenerativeService requests. This way generate content requests can benefit + * from preprocessing work being done earlier, possibly lowering their + * computational cost. It is intended to be used with large contexts. + * @class + * @memberof v1beta + */ +export class CacheServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + 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}; + cacheServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CacheServiceClient. + * + * @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 CacheServiceClient({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 CacheServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'generativelanguage.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), + chunkPathTemplate: new this._gaxModule.PathTemplate( + 'corpora/{corpus}/documents/{document}/chunks/{chunk}' + ), + corpusPathTemplate: new this._gaxModule.PathTemplate('corpora/{corpus}'), + corpusPermissionPathTemplate: new this._gaxModule.PathTemplate( + 'corpora/{corpus}/permissions/{permission}' + ), + documentPathTemplate: new this._gaxModule.PathTemplate( + 'corpora/{corpus}/documents/{document}' + ), + filePathTemplate: new this._gaxModule.PathTemplate('files/{file}'), + modelPathTemplate: new this._gaxModule.PathTemplate('models/{model}'), + tunedModelPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}' + ), + tunedModelPermissionPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}/permissions/{permission}' + ), + }; + + // 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 = { + listCachedContents: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cachedContents' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1beta.CacheService', + 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.cacheServiceStub) { + return this.cacheServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1beta.CacheService. + this.cacheServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1beta.CacheService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1beta + .CacheService, + 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 cacheServiceStubMethods = [ + 'listCachedContents', + 'createCachedContent', + 'getCachedContent', + 'updateCachedContent', + 'deleteCachedContent', + ]; + for (const methodName of cacheServiceStubMethods) { + const callPromise = this.cacheServiceStub.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.cacheServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return []; + } + + 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 CachedContent resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1beta.CachedContent} request.cachedContent + * Required. The cached content 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.v1beta.CachedContent|CachedContent}. + * 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/v1beta/cache_service.create_cached_content.js + * region_tag:generativelanguage_v1beta_generated_CacheService_CreateCachedContent_async + */ + createCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + createCachedContent( + request: protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request: protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | 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.createCachedContent(request, options, callback); + } + /** + * Reads CachedContent resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name referring to the content cache entry. + * Format: `cachedContents/{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.v1beta.CachedContent|CachedContent}. + * 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/v1beta/cache_service.get_cached_content.js + * region_tag:generativelanguage_v1beta_generated_CacheService_GetCachedContent_async + */ + getCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + getCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | 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.getCachedContent(request, options, callback); + } + /** + * Updates CachedContent resource (only expiration is updatable). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1beta.CachedContent} request.cachedContent + * Required. The content cache entry to update + * @param {google.protobuf.FieldMask} request.updateMask + * 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.v1beta.CachedContent|CachedContent}. + * 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/v1beta/cache_service.update_cached_content.js + * region_tag:generativelanguage_v1beta_generated_CacheService_UpdateCachedContent_async + */ + updateCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + updateCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | 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({ + 'cached_content.name': request.cachedContent!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCachedContent(request, options, callback); + } + /** + * Deletes CachedContent resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name referring to the content cache entry + * Format: `cachedContents/{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/v1beta/cache_service.delete_cached_content.js + * region_tag:generativelanguage_v1beta_generated_CacheService_DeleteCachedContent_async + */ + deleteCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request: protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request?: protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | 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.deleteCachedContent(request, options, callback); + } + + /** + * Lists CachedContents. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of cached contents to return. The service may + * return fewer than this value. If unspecified, some default (under maximum) + * number of items will be returned. The maximum value is 1000; values above + * 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCachedContents` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCachedContents` 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.v1beta.CachedContent|CachedContent}. + * 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 `listCachedContentsAsync()` + * 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. + */ + listCachedContents( + request?: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent[], + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse, + ] + >; + listCachedContents( + request: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICachedContent + > + ): void; + listCachedContents( + request: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICachedContent + > + ): void; + listCachedContents( + request?: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICachedContent + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICachedContent + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta.ICachedContent[], + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof 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.listCachedContents(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 cached contents to return. The service may + * return fewer than this value. If unspecified, some default (under maximum) + * number of items will be returned. The maximum value is 1000; values above + * 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCachedContents` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCachedContents` 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.v1beta.CachedContent|CachedContent} 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 `listCachedContentsAsync()` + * 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. + */ + listCachedContentsStream( + request?: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listCachedContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCachedContents.createStream( + this.innerApiCalls.listCachedContents as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCachedContents`, 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 cached contents to return. The service may + * return fewer than this value. If unspecified, some default (under maximum) + * number of items will be returned. The maximum value is 1000; values above + * 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCachedContents` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCachedContents` 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.v1beta.CachedContent|CachedContent}. 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/v1beta/cache_service.list_cached_contents.js + * region_tag:generativelanguage_v1beta_generated_CacheService_ListCachedContents_async + */ + listCachedContentsAsync( + request?: protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listCachedContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCachedContents.asyncIterate( + this.innerApiCalls['listCachedContents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + + /** + * Return a fully-qualified chunk resource name string. + * + * @param {string} corpus + * @param {string} document + * @param {string} chunk + * @returns {string} Resource name string. + */ + chunkPath(corpus: string, document: string, chunk: string) { + return this.pathTemplates.chunkPathTemplate.render({ + corpus: corpus, + document: document, + chunk: chunk, + }); + } + + /** + * Parse the corpus from Chunk resource. + * + * @param {string} chunkName + * A fully-qualified path representing Chunk resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromChunkName(chunkName: string) { + return this.pathTemplates.chunkPathTemplate.match(chunkName).corpus; + } + + /** + * Parse the document from Chunk resource. + * + * @param {string} chunkName + * A fully-qualified path representing Chunk resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromChunkName(chunkName: string) { + return this.pathTemplates.chunkPathTemplate.match(chunkName).document; + } + + /** + * Parse the chunk from Chunk resource. + * + * @param {string} chunkName + * A fully-qualified path representing Chunk resource. + * @returns {string} A string representing the chunk. + */ + matchChunkFromChunkName(chunkName: string) { + return this.pathTemplates.chunkPathTemplate.match(chunkName).chunk; + } + + /** + * Return a fully-qualified corpus resource name string. + * + * @param {string} corpus + * @returns {string} Resource name string. + */ + corpusPath(corpus: string) { + return this.pathTemplates.corpusPathTemplate.render({ + corpus: corpus, + }); + } + + /** + * Parse the corpus from Corpus resource. + * + * @param {string} corpusName + * A fully-qualified path representing Corpus resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusName(corpusName: string) { + return this.pathTemplates.corpusPathTemplate.match(corpusName).corpus; + } + + /** + * Return a fully-qualified corpusPermission resource name string. + * + * @param {string} corpus + * @param {string} permission + * @returns {string} Resource name string. + */ + corpusPermissionPath(corpus: string, permission: string) { + return this.pathTemplates.corpusPermissionPathTemplate.render({ + corpus: corpus, + permission: permission, + }); + } + + /** + * Parse the corpus from CorpusPermission resource. + * + * @param {string} corpusPermissionName + * A fully-qualified path representing corpus_permission resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromCorpusPermissionName(corpusPermissionName: string) { + return this.pathTemplates.corpusPermissionPathTemplate.match( + corpusPermissionName + ).corpus; + } + + /** + * Parse the permission from CorpusPermission resource. + * + * @param {string} corpusPermissionName + * A fully-qualified path representing corpus_permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromCorpusPermissionName(corpusPermissionName: string) { + return this.pathTemplates.corpusPermissionPathTemplate.match( + corpusPermissionName + ).permission; + } + + /** + * Return a fully-qualified document resource name string. + * + * @param {string} corpus + * @param {string} document + * @returns {string} Resource name string. + */ + documentPath(corpus: string, document: string) { + return this.pathTemplates.documentPathTemplate.render({ + corpus: corpus, + document: document, + }); + } + + /** + * Parse the corpus from Document resource. + * + * @param {string} documentName + * A fully-qualified path representing Document resource. + * @returns {string} A string representing the corpus. + */ + matchCorpusFromDocumentName(documentName: string) { + return this.pathTemplates.documentPathTemplate.match(documentName).corpus; + } + + /** + * Parse the document from Document resource. + * + * @param {string} documentName + * A fully-qualified path representing Document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromDocumentName(documentName: string) { + return this.pathTemplates.documentPathTemplate.match(documentName).document; + } + + /** + * Return a fully-qualified file resource name string. + * + * @param {string} file + * @returns {string} Resource name string. + */ + filePath(file: string) { + return this.pathTemplates.filePathTemplate.render({ + file: file, + }); + } + + /** + * Parse the file from File resource. + * + * @param {string} fileName + * A fully-qualified path representing File resource. + * @returns {string} A string representing the file. + */ + matchFileFromFileName(fileName: string) { + return this.pathTemplates.filePathTemplate.match(fileName).file; + } + + /** + * 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 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; + } + + /** + * Return a fully-qualified tunedModelPermission resource name string. + * + * @param {string} tuned_model + * @param {string} permission + * @returns {string} Resource name string. + */ + tunedModelPermissionPath(tunedModel: string, permission: string) { + return this.pathTemplates.tunedModelPermissionPathTemplate.render({ + tuned_model: tunedModel, + permission: permission, + }); + } + + /** + * Parse the tuned_model from TunedModelPermission resource. + * + * @param {string} tunedModelPermissionName + * A fully-qualified path representing tuned_model_permission resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromTunedModelPermissionName( + tunedModelPermissionName: string + ) { + return this.pathTemplates.tunedModelPermissionPathTemplate.match( + tunedModelPermissionName + ).tuned_model; + } + + /** + * Parse the permission from TunedModelPermission resource. + * + * @param {string} tunedModelPermissionName + * A fully-qualified path representing tuned_model_permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromTunedModelPermissionName( + tunedModelPermissionName: string + ) { + return this.pathTemplates.tunedModelPermissionPathTemplate.match( + tunedModelPermissionName + ).permission; + } + + /** + * 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.cacheServiceStub && !this._terminated) { + return this.cacheServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta/cache_service_client_config.json b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client_config.json new file mode 100644 index 00000000000..1a57fd1ea86 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1beta.CacheService": { + "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": { + "ListCachedContents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCachedContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCachedContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCachedContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCachedContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta/cache_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/cache_service_proto_list.json new file mode 100644 index 00000000000..16db08ec00a --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta/cache_service_proto_list.json @@ -0,0 +1,19 @@ +[ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1beta/citation.proto", + "../../protos/google/ai/generativelanguage/v1beta/content.proto", + "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/file.proto", + "../../protos/google/ai/generativelanguage/v1beta/file_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/model.proto", + "../../protos/google/ai/generativelanguage/v1beta/model_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/permission.proto", + "../../protos/google/ai/generativelanguage/v1beta/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/retriever.proto", + "../../protos/google/ai/generativelanguage/v1beta/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/safety.proto", + "../../protos/google/ai/generativelanguage/v1beta/text_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts index 69cd08b0342..6585f4e09f8 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts @@ -200,6 +200,9 @@ export class DiscussServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -622,6 +625,30 @@ export class DiscussServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/discuss_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/discuss_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/discuss_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/discuss_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts index 30788a52d40..abd49249b24 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts @@ -199,6 +199,9 @@ export class FileServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -842,6 +845,30 @@ export class FileServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/file_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/file_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/file_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/file_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/gapic_metadata.json b/packages/google-ai-generativelanguage/src/v1beta/gapic_metadata.json index 2ca685798db..8a898aa047f 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/gapic_metadata.json +++ b/packages/google-ai-generativelanguage/src/v1beta/gapic_metadata.json @@ -5,6 +5,74 @@ "protoPackage": "google.ai.generativelanguage.v1beta", "libraryPackage": "@google-ai/generativelanguage", "services": { + "CacheService": { + "clients": { + "grpc": { + "libraryClient": "CacheServiceClient", + "rpcs": { + "CreateCachedContent": { + "methods": [ + "createCachedContent" + ] + }, + "GetCachedContent": { + "methods": [ + "getCachedContent" + ] + }, + "UpdateCachedContent": { + "methods": [ + "updateCachedContent" + ] + }, + "DeleteCachedContent": { + "methods": [ + "deleteCachedContent" + ] + }, + "ListCachedContents": { + "methods": [ + "listCachedContents", + "listCachedContentsStream", + "listCachedContentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CacheServiceClient", + "rpcs": { + "CreateCachedContent": { + "methods": [ + "createCachedContent" + ] + }, + "GetCachedContent": { + "methods": [ + "getCachedContent" + ] + }, + "UpdateCachedContent": { + "methods": [ + "updateCachedContent" + ] + }, + "DeleteCachedContent": { + "methods": [ + "deleteCachedContent" + ] + }, + "ListCachedContents": { + "methods": [ + "listCachedContents", + "listCachedContentsStream", + "listCachedContentsAsync" + ] + } + } + } + } + }, "DiscussService": { "clients": { "grpc": { diff --git a/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts index f7638d8d042..adc8f5c8a94 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts @@ -198,6 +198,9 @@ export class GenerativeServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -460,6 +463,11 @@ export class GenerativeServiceClient { * HARM_CATEGORY_HARASSMENT are supported. * @param {google.ai.generativelanguage.v1beta.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. + * @param {string} [request.cachedContent] + * Optional. The name of the cached content used as context to serve the + * prediction. Note: only used in explicit caching, where users can have + * control over caching (e.g. what content to cache) and enjoy guaranteed cost + * savings. Format: `cachedContents/{cachedContent}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1060,6 +1068,11 @@ export class GenerativeServiceClient { * HARM_CATEGORY_HARASSMENT are supported. * @param {google.ai.generativelanguage.v1beta.GenerationConfig} [request.generationConfig] * Optional. Configuration options for model generation and outputs. + * @param {string} [request.cachedContent] + * Optional. The name of the cached content used as context to serve the + * prediction. Note: only used in explicit caching, where users can have + * control over caching (e.g. what content to cache) and enjoy guaranteed cost + * savings. Format: `cachedContents/{cachedContent}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1089,6 +1102,30 @@ export class GenerativeServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/generative_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/generative_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/generative_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/generative_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/index.ts b/packages/google-ai-generativelanguage/src/v1beta/index.ts index 5fd52512a63..ce43394f242 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/index.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/index.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export {CacheServiceClient} from './cache_service_client'; export {DiscussServiceClient} from './discuss_service_client'; export {FileServiceClient} from './file_service_client'; export {GenerativeServiceClient} from './generative_service_client'; diff --git a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts index 34fa9553064..9de69ffaafc 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts @@ -202,6 +202,9 @@ export class ModelServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -1600,6 +1603,30 @@ export class ModelServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/model_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/model_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/model_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/model_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts index a6c825b5f91..c4ab828ea2b 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts @@ -199,6 +199,9 @@ export class PermissionServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -1138,6 +1141,30 @@ export class PermissionServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/permission_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/permission_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/permission_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/permission_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts index 40cff0f407a..b4ec9ba5060 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts @@ -199,6 +199,9 @@ export class RetrieverServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -2812,6 +2815,30 @@ export class RetrieverServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/retriever_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/retriever_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/retriever_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/retriever_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts index 57fa1f47303..2600061389a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts @@ -200,6 +200,9 @@ export class TextServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'cachedContents/{id}' + ), chunkPathTemplate: new this._gaxModule.PathTemplate( 'corpora/{corpus}/documents/{document}/chunks/{chunk}' ), @@ -861,6 +864,30 @@ export class TextServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} id + * @returns {string} Resource name string. + */ + cachedContentPath(id: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + id: id, + }); + } + + /** + * Parse the id from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the id. + */ + matchIdFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .id; + } + /** * Return a fully-qualified chunk resource name string. * diff --git a/packages/google-ai-generativelanguage/src/v1beta/text_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta/text_service_proto_list.json index 022d89ef82c..16db08ec00a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/text_service_proto_list.json +++ b/packages/google-ai-generativelanguage/src/v1beta/text_service_proto_list.json @@ -1,4 +1,6 @@ [ + "../../protos/google/ai/generativelanguage/v1beta/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1beta/cached_content.proto", "../../protos/google/ai/generativelanguage/v1beta/citation.proto", "../../protos/google/ai/generativelanguage/v1beta/content.proto", "../../protos/google/ai/generativelanguage/v1beta/discuss_service.proto", diff --git a/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.js b/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.js index 8a2ae0771a6..80fbd1f1d18 100644 --- a/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.js +++ b/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.js @@ -20,6 +20,7 @@ const generativelanguage = require('@google-ai/generativelanguage'); function main() { + const cacheServiceClient = new generativelanguage.CacheServiceClient(); const discussServiceClient = new generativelanguage.DiscussServiceClient(); const fileServiceClient = new generativelanguage.FileServiceClient(); const generativeServiceClient = diff --git a/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.ts b/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.ts index 7ebb2af3725..db13e2772f1 100644 --- a/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-ai-generativelanguage/system-test/fixtures/sample/src/index.ts @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** import { + CacheServiceClient, DiscussServiceClient, FileServiceClient, GenerativeServiceClient, @@ -27,6 +28,9 @@ import { } from '@google-ai/generativelanguage'; // check that the client class type name can be used +function doStuffWithCacheServiceClient(client: CacheServiceClient) { + client.close(); +} function doStuffWithDiscussServiceClient(client: DiscussServiceClient) { client.close(); } @@ -50,6 +54,9 @@ function doStuffWithTextServiceClient(client: TextServiceClient) { } function main() { + // check that the client instance can be created + const cacheServiceClient = new CacheServiceClient(); + doStuffWithCacheServiceClient(cacheServiceClient); // check that the client instance can be created const discussServiceClient = new DiscussServiceClient(); doStuffWithDiscussServiceClient(discussServiceClient); diff --git a/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts new file mode 100644 index 00000000000..a3123a40fa4 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts @@ -0,0 +1,1455 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 cacheserviceModule 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('v1beta.CacheServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + cacheserviceModule.v1beta.CacheServiceClient.servicePath; + assert.strictEqual(servicePath, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + cacheserviceModule.v1beta.CacheServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new cacheserviceModule.v1beta.CacheServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'generativelanguage.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new cacheserviceModule.v1beta.CacheServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = cacheserviceModule.v1beta.CacheServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cacheServiceStub, undefined); + await client.initialize(); + assert(client.cacheServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cacheServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cacheServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + 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 cacheserviceModule.v1beta.CacheServiceClient({ + 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('createCachedContent', () => { + it('invokes createCachedContent without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CreateCachedContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.createCachedContent = + stubSimpleCall(expectedResponse); + const [response] = await client.createCachedContent(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createCachedContent without error using callback', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CreateCachedContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.createCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta.ICachedContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createCachedContent with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CreateCachedContentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createCachedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCachedContent(request), expectedError); + }); + + it('invokes createCachedContent with closed client', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CreateCachedContentRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCachedContent(request), expectedError); + }); + }); + + describe('getCachedContent', () => { + it('invokes getCachedContent without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.getCachedContent = stubSimpleCall(expectedResponse); + const [response] = await client.getCachedContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCachedContent without error using callback', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.getCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta.ICachedContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCachedContent with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCachedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCachedContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCachedContent with closed client', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCachedContent(request), expectedError); + }); + }); + + describe('updateCachedContent', () => { + it('invokes updateCachedContent without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.updateCachedContent = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCachedContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCachedContent without error using callback', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ); + client.innerApiCalls.updateCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta.ICachedContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCachedContent with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCachedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCachedContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCachedContent with closed client', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCachedContent(request), expectedError); + }); + }); + + describe('deleteCachedContent', () => { + it('invokes deleteCachedContent without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCachedContent = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteCachedContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCachedContent without error using callback', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCachedContent( + 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.deleteCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCachedContent with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCachedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCachedContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCachedContent with closed client', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCachedContent(request), expectedError); + }); + }); + + describe('listCachedContents', () => { + it('invokes listCachedContents without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + ]; + client.innerApiCalls.listCachedContents = + stubSimpleCall(expectedResponse); + const [response] = await client.listCachedContents(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listCachedContents without error using callback', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + ]; + client.innerApiCalls.listCachedContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCachedContents( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1beta.ICachedContent[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listCachedContents with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listCachedContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCachedContents(request), expectedError); + }); + + it('invokes listCachedContentsStream without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + ]; + client.descriptors.page.listCachedContents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCachedContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta.CachedContent[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta.CachedContent + ) => { + 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.listCachedContents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCachedContents, request) + ); + }); + + it('invokes listCachedContentsStream with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listCachedContents.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCachedContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta.CachedContent[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta.CachedContent + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCachedContents.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCachedContents, request) + ); + }); + + it('uses async iteration with listCachedContents without error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.CachedContent() + ), + ]; + client.descriptors.page.listCachedContents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1beta.ICachedContent[] = + []; + const iterable = client.listCachedContentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCachedContents.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listCachedContents with error', async () => { + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta.ListCachedContentsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listCachedContents.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCachedContentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1beta.ICachedContent[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCachedContents.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('chunk', () => { + const fakePath = '/rendered/path/chunk'; + const expectedParameters = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.chunkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.chunkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('chunkPath', () => { + const result = client.chunkPath( + 'corpusValue', + 'documentValue', + 'chunkValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.chunkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchCorpusFromChunkName', () => { + const result = client.matchCorpusFromChunkName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.chunkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromChunkName', () => { + const result = client.matchDocumentFromChunkName(fakePath); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.chunkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChunkFromChunkName', () => { + const result = client.matchChunkFromChunkName(fakePath); + assert.strictEqual(result, 'chunkValue'); + assert( + (client.pathTemplates.chunkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('corpus', () => { + const fakePath = '/rendered/path/corpus'; + const expectedParameters = { + corpus: 'corpusValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.corpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPath', () => { + const result = client.corpusPath('corpusValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.corpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchCorpusFromCorpusName', () => { + const result = client.matchCorpusFromCorpusName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('corpusPermission', () => { + const fakePath = '/rendered/path/corpusPermission'; + const expectedParameters = { + corpus: 'corpusValue', + permission: 'permissionValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.corpusPermissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.corpusPermissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('corpusPermissionPath', () => { + const result = client.corpusPermissionPath( + 'corpusValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.corpusPermissionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchCorpusFromCorpusPermissionName', () => { + const result = client.matchCorpusFromCorpusPermissionName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.corpusPermissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromCorpusPermissionName', () => { + const result = client.matchPermissionFromCorpusPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + (client.pathTemplates.corpusPermissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('document', () => { + const fakePath = '/rendered/path/document'; + const expectedParameters = { + corpus: 'corpusValue', + document: 'documentValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.documentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.documentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('documentPath', () => { + const result = client.documentPath('corpusValue', 'documentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.documentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchCorpusFromDocumentName', () => { + const result = client.matchCorpusFromDocumentName(fakePath); + assert.strictEqual(result, 'corpusValue'); + assert( + (client.pathTemplates.documentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromDocumentName', () => { + const result = client.matchDocumentFromDocumentName(fakePath); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.documentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('file', () => { + const fakePath = '/rendered/path/file'; + const expectedParameters = { + file: 'fileValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.filePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.filePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('filePath', () => { + const result = client.filePath('fileValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.filePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFileFromFileName', () => { + const result = client.matchFileFromFileName(fakePath); + assert.strictEqual(result, 'fileValue'); + assert( + (client.pathTemplates.filePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + model: 'modelValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + 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('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + 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) + ); + }); + }); + + describe('tunedModelPermission', () => { + const fakePath = '/rendered/path/tunedModelPermission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new cacheserviceModule.v1beta.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPermissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPermissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPermissionPath', () => { + const result = client.tunedModelPermissionPath( + 'tunedModelValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tunedModelPermissionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelPermissionName', () => { + const result = + client.matchTunedModelFromTunedModelPermissionName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + ( + client.pathTemplates.tunedModelPermissionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromTunedModelPermissionName', () => { + const result = + client.matchPermissionFromTunedModelPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + ( + client.pathTemplates.tunedModelPermissionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts index 58be95399c4..094d690a272 100644 --- a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts @@ -507,6 +507,44 @@ describe('v1beta.DiscussServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new discussserviceModule.v1beta.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts index 24e5390d9cc..0fc60e02f99 100644 --- a/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts @@ -880,6 +880,44 @@ describe('v1beta.FileServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new fileserviceModule.v1beta.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts index 1f8e2c88586..6d71f0a89bc 100644 --- a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts @@ -1164,6 +1164,46 @@ describe('v1beta.GenerativeServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new generativeserviceModule.v1beta.GenerativeServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts index bbc09c2b24c..132ada2d2cd 100644 --- a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts @@ -1780,6 +1780,44 @@ describe('v1beta.ModelServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new modelserviceModule.v1beta.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts index c4984672222..65329ffc45d 100644 --- a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts @@ -1365,6 +1365,46 @@ describe('v1beta.PermissionServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new permissionserviceModule.v1beta.PermissionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts index 640f910b656..c73d0278014 100644 --- a/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts @@ -3382,6 +3382,44 @@ describe('v1beta.RetrieverServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new retrieverserviceModule.v1beta.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts index bb6e62756be..6b399fb0f13 100644 --- a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts @@ -763,6 +763,44 @@ describe('v1beta.TextServiceClient', () => { }); describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new textserviceModule.v1beta.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cachedContentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cachedContentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cachedContentPath', () => { + const result = client.cachedContentPath('idValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchIdFromCachedContentName', () => { + const result = client.matchIdFromCachedContentName(fakePath); + assert.strictEqual(result, 'idValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('chunk', () => { const fakePath = '/rendered/path/chunk'; const expectedParameters = { diff --git a/packages/google-ai-generativelanguage/webpack.config.js b/packages/google-ai-generativelanguage/webpack.config.js index 4b32bfa74e3..6b6d6f8e33f 100644 --- a/packages/google-ai-generativelanguage/webpack.config.js +++ b/packages/google-ai-generativelanguage/webpack.config.js @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'DiscussService', - filename: './discuss-service.js', + library: 'CacheService', + filename: './cache-service.js', }, node: { child_process: 'empty', diff --git a/packages/google-chat/protos/google/chat/v1/chat_service.proto b/packages/google-chat/protos/google/chat/v1/chat_service.proto index 44aed729f93..9de4895a392 100644 --- a/packages/google-chat/protos/google/chat/v1/chat_service.proto +++ b/packages/google-chat/protos/google/chat/v1/chat_service.proto @@ -311,6 +311,17 @@ service ChatService { // you can add the user to the space by setting the `membership.member.name` // to `users/user@example.com` or `users/123456789`. // + // To specify the Google groups to add, add memberships with the + // appropriate `membership.group_member.name`. To add or invite a Google + // group, use `groups/{group}`, where `{group}` is the `id` for the group from + // the Cloud Identity Groups API. For example, you can use [Cloud Identity + // Groups lookup + // API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + // to retrieve the ID `123456789` for group email `group@example.com`, then + // you can add the group to the space by setting the + // `membership.group_member.name` to `groups/123456789`. Group email is not + // supported, and Google groups can only be added as members in named spaces. + // // For a named space or group chat, if the caller blocks, or is blocked // by some members, or doesn't have permission to add some members, then // those members aren't added to the created space. @@ -427,7 +438,8 @@ service ChatService { // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). // // To specify the member to add, set the `membership.member.name` for the - // human or app member. + // human or app member, or set the `membership.group_member.name` for the + // group member. // // - To add the calling app to a space or a direct message between two human // users, use `users/app`. Unable to add other @@ -440,6 +452,15 @@ service ChatService { // profile ID for `user@example.com` is `123456789`, you can add the user to // the space by setting the `membership.member.name` to // `users/user@example.com` or `users/123456789`. + // + // - To add or invite a Google group in a named space, use + // `groups/{group}`, where `{group}` is the `id` for the group from the Cloud + // Identity Groups API. For example, you can use [Cloud Identity Groups lookup + // API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + // to retrieve the ID `123456789` for group email `group@example.com`, then + // you can add or invite the group to a named space by setting the + // `membership.group_member.name` to `groups/123456789`. Group email is not + // supported, and Google groups can only be added as members in named spaces. rpc CreateMembership(CreateMembershipRequest) returns (Membership) { option (google.api.http) = { post: "/v1/{parent=spaces/*}/members" diff --git a/packages/google-chat/protos/google/chat/v1/membership.proto b/packages/google-chat/protos/google/chat/v1/membership.proto index 8751f7d6c92..6706f45520e 100644 --- a/packages/google-chat/protos/google/chat/v1/membership.proto +++ b/packages/google-chat/protos/google/chat/v1/membership.proto @@ -106,8 +106,6 @@ message Membership { User member = 3; // The Google Group the membership corresponds to. - // Only supports read operations. Other operations, like - // creating or updating a membership, aren't currently supported. Group group_member = 5; } diff --git a/packages/google-chat/protos/google/chat/v1/space_setup.proto b/packages/google-chat/protos/google/chat/v1/space_setup.proto index 17e42269e12..2377d28293a 100644 --- a/packages/google-chat/protos/google/chat/v1/space_setup.proto +++ b/packages/google-chat/protos/google/chat/v1/space_setup.proto @@ -64,8 +64,8 @@ message SetUpSpaceRequest { // authenticated user returns an error. string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The Google Chat users to invite to join the space. Omit the - // calling user, as they are added automatically. + // Optional. The Google Chat users or groups to invite to join the space. Omit + // the calling user, as they are added automatically. // // The set currently allows up to 20 memberships (in addition to the caller). // @@ -78,6 +78,10 @@ message SetUpSpaceRequest { // To invite Gmail users or users from external Google Workspace domains, // user's email must be used for `{user}`. // + // For Google group membership, the `Membership.group_member` field must + // contain a `group` with `name` populated (format `groups/{group}`). You + // can only add Google groups when setting `Space.spaceType` to `SPACE`. + // // Optional when setting `Space.spaceType` to `SPACE`. // // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at diff --git a/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js b/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js index ba3ae09de3f..2c897a86e80 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.set_up_space.js @@ -59,8 +59,8 @@ function main(space) { */ // const requestId = 'abc123' /** - * Optional. The Google Chat users to invite to join the space. Omit the - * calling user, as they are added automatically. + * Optional. The Google Chat users or groups to invite to join the space. Omit + * the calling user, as they are added automatically. * The set currently allows up to 20 memberships (in addition to the caller). * For human membership, the `Membership.member` field must contain a `user` * with `name` populated (format: `users/{user}`) and `type` set to @@ -70,6 +70,9 @@ function main(space) { * for {user}. For example, the `user.name` can be `users/example@gmail.com`. * To invite Gmail users or users from external Google Workspace domains, * user's email must be used for `{user}`. + * For Google group membership, the `Membership.group_member` field must + * contain a `group` with `name` populated (format `groups/{group}`). You + * can only add Google groups when setting `Space.spaceType` to `SPACE`. * Optional when setting `Space.spaceType` to `SPACE`. * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at * least two memberships. diff --git a/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json b/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json index 38b2c5e1a4e..c38d546e3fc 100644 --- a/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json +++ b/packages/google-chat/samples/generated/v1/snippet_metadata_google.chat.v1.json @@ -583,14 +583,14 @@ "regionTag": "chat_v1_generated_ChatService_SetUpSpace_async", "title": "ChatService setUpSpace Sample", "origin": "API_DEFINITION", - "description": " Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space with initial members](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", "canonical": true, "file": "chat_service.set_up_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 101, + "end": 104, "type": "FULL" } ], @@ -795,7 +795,7 @@ "regionTag": "chat_v1_generated_ChatService_CreateMembership_async", "title": "ChatService createMembership Sample", "origin": "API_DEFINITION", - "description": " Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [Invite or add a user or a Google Chat app to a space](https://developers.google.com/workspace/chat/create-members). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). To specify the member to add, set the `membership.member.name` for the human or app member. - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`.", + "description": " Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [Invite or add a user or a Google Chat app to a space](https://developers.google.com/workspace/chat/create-members). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). To specify the member to add, set the `membership.member.name` for the human or app member, or set the `membership.group_member.name` for the group member. - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. - To add or invite a Google group in a named space, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add or invite the group to a named space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces.", "canonical": true, "file": "chat_service.create_membership.js", "language": "JAVASCRIPT", diff --git a/packages/google-chat/src/v1/chat_service_client.ts b/packages/google-chat/src/v1/chat_service_client.ts index 39177071421..3a46d1fa67e 100644 --- a/packages/google-chat/src/v1/chat_service_client.ts +++ b/packages/google-chat/src/v1/chat_service_client.ts @@ -1418,6 +1418,17 @@ export class ChatServiceClient { * you can add the user to the space by setting the `membership.member.name` * to `users/user@example.com` or `users/123456789`. * + * To specify the Google groups to add, add memberships with the + * appropriate `membership.group_member.name`. To add or invite a Google + * group, use `groups/{group}`, where `{group}` is the `id` for the group from + * the Cloud Identity Groups API. For example, you can use [Cloud Identity + * Groups lookup + * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + * to retrieve the ID `123456789` for group email `group@example.com`, then + * you can add the group to the space by setting the + * `membership.group_member.name` to `groups/123456789`. Group email is not + * supported, and Google groups can only be added as members in named spaces. + * * For a named space or group chat, if the caller blocks, or is blocked * by some members, or doesn't have permission to add some members, then * those members aren't added to the created space. @@ -1479,8 +1490,8 @@ export class ChatServiceClient { * Specifying an existing request ID from the same Chat app with a different * authenticated user returns an error. * @param {number[]} [request.memberships] - * Optional. The Google Chat users to invite to join the space. Omit the - * calling user, as they are added automatically. + * Optional. The Google Chat users or groups to invite to join the space. Omit + * the calling user, as they are added automatically. * * The set currently allows up to 20 memberships (in addition to the caller). * @@ -1493,6 +1504,10 @@ export class ChatServiceClient { * To invite Gmail users or users from external Google Workspace domains, * user's email must be used for `{user}`. * + * For Google group membership, the `Membership.group_member` field must + * contain a `group` with `name` populated (format `groups/{group}`). You + * can only add Google groups when setting `Space.spaceType` to `SPACE`. + * * Optional when setting `Space.spaceType` to `SPACE`. * * Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at @@ -2004,7 +2019,8 @@ export class ChatServiceClient { * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). * * To specify the member to add, set the `membership.member.name` for the - * human or app member. + * human or app member, or set the `membership.group_member.name` for the + * group member. * * - To add the calling app to a space or a direct message between two human * users, use `users/app`. Unable to add other @@ -2018,6 +2034,15 @@ export class ChatServiceClient { * the space by setting the `membership.member.name` to * `users/user@example.com` or `users/123456789`. * + * - To add or invite a Google group in a named space, use + * `groups/{group}`, where `{group}` is the `id` for the group from the Cloud + * Identity Groups API. For example, you can use [Cloud Identity Groups lookup + * API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + * to retrieve the ID `123456789` for group email `group@example.com`, then + * you can add or invite the group to a named space by setting the + * `membership.group_member.name` to `groups/123456789`. Group email is not + * supported, and Google groups can only be added as members in named spaces. + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent diff --git a/packages/google-cloud-aiplatform/CHANGELOG.md b/packages/google-cloud-aiplatform/CHANGELOG.md index a7e8e70c833..9cf4061c6f6 100644 --- a/packages/google-cloud-aiplatform/CHANGELOG.md +++ b/packages/google-cloud-aiplatform/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.24.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.23.0...aiplatform-v3.24.0) (2024-06-26) + + +### Features + +* Add MALFORMED_FUNCTION_CALL to FinishReason ([#5481](https://github.com/googleapis/google-cloud-node/issues/5481)) ([83498e9](https://github.com/googleapis/google-cloud-node/commit/83498e9a326d0640bf3654491814dc19cc479def)) + ## [3.23.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.22.0...aiplatform-v3.23.0) (2024-06-05) diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index 6979a9747dd..adf6a329d95 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -656,6 +656,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Prediction_service.stream_direct_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_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-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_predict.js,packages/google-cloud-aiplatform/samples/README.md) | | Prediction_service.stream_direct_raw_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_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-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_predict.js,packages/google-cloud-aiplatform/samples/README.md) | | Prediction_service.stream_generate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_generate_content.js) | [![Open in Cloud Shell][shell_img]](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/prediction_service.stream_generate_content.js,packages/google-cloud-aiplatform/samples/README.md) | +| Prediction_service.stream_raw_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_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-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js,packages/google-cloud-aiplatform/samples/README.md) | | Prediction_service.streaming_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_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-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.js,packages/google-cloud-aiplatform/samples/README.md) | | Prediction_service.streaming_raw_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_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-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_predict.js,packages/google-cloud-aiplatform/samples/README.md) | | Reasoning_engine_execution_service.query_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.query_reasoning_engine.js) | [![Open in Cloud Shell][shell_img]](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/reasoning_engine_execution_service.query_reasoning_engine.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 841f008ff5b..12627837a91 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.23.0", + "version": "3.24.0", "description": "Vertex AI client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto index 7f31baa2a0c..82cdb3f63e7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto @@ -346,6 +346,9 @@ message Candidate { // The token generation was stopped as the response was flagged for // Sensitive Personally Identifiable Information (SPII) contents. SPII = 8; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 9; } // Output only. Index of the candidate. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto index 3a0567aa065..e31290cb963 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/pipeline_job.proto @@ -213,6 +213,9 @@ message PipelineJob { // Output only. The schedule resource name. // Only returned if the Pipeline is created by Schedule API. string schedule_name = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Whether to do component level validations before job creation. + bool preflight_validations = 26 [(google.api.field_behavior) = OPTIONAL]; } // Pipeline template metadata if diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto index 70ba277aef7..9e609e918a4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/prediction_service.proto @@ -98,10 +98,6 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict" body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict" - body: "*" - } }; } @@ -112,40 +108,18 @@ service PredictionService { option (google.api.http) = { post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict" body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict" - body: "*" - } }; } // Perform a streaming online prediction request to a gRPC model server for // Vertex first-party products and frameworks. rpc StreamDirectPredict(stream StreamDirectPredictRequest) - returns (stream StreamDirectPredictResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectPredict" - body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectPredict" - body: "*" - } - }; - } + returns (stream StreamDirectPredictResponse) {} // Perform a streaming online prediction request to a gRPC model server for // custom containers. rpc StreamDirectRawPredict(stream StreamDirectRawPredictRequest) - returns (stream StreamDirectRawPredictResponse) { - option (google.api.http) = { - post: "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectRawPredict" - body: "*" - additional_bindings { - post: "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectRawPredict" - body: "*" - } - }; - } + returns (stream StreamDirectRawPredictResponse) {} // Perform a streaming online prediction request for Vertex first-party // products and frameworks. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto index 90d39609316..803df182076 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tuning_job.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/content.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; import "google/cloud/aiplatform/v1/job_state.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; @@ -125,6 +126,11 @@ message TuningJob { // [TuningJob][google.cloud.aiplatform.v1.TuningJob]. TuningDataStats tuning_data_stats = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Customer-managed encryption key options for a TuningJob. If this is set, + // then all resources created by the TuningJob will be encrypted with the + // provided encryption key. + EncryptionSpec encryption_spec = 16; } // The Model Registry Model and Online Prediction Endpoint assiociated with diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/cached_content.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/cached_content.proto index ecb6e97a3d8..b57cdea1af7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/cached_content.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/cached_content.proto @@ -54,8 +54,8 @@ message CachedContent { [(google.api.field_behavior) = INPUT_ONLY]; } - // Immutable. Identifier. The resource name of the cached content - // Format: + // Immutable. Identifier. The server-generated resource name of the cached + // content Format: // projects/{project}/locations/{location}/cachedContents/{cached_content} string name = 1 [ (google.api.field_behavior) = IDENTIFIER, diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/content.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/content.proto index da636484727..f139feb2b03 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/content.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/content.proto @@ -346,6 +346,9 @@ message Candidate { // The token generation was stopped as the response was flagged for // Sensitive Personally Identifiable Information (SPII) contents. SPII = 8; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 9; } // Output only. Index of the candidate. @@ -390,6 +393,56 @@ message Segment { // Output only. End index in the given Part, measured in bytes. Offset from // the start of the Part, exclusive, starting at zero. int32 end_index = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The text corresponding to the segment from the response. + string text = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Grounding chunk. +message GroundingChunk { + // Chunk from the web. + message Web { + // URI reference of the chunk. + optional string uri = 1; + + // Title of the chunk. + optional string title = 2; + } + + // Chunk from context retrieved by the retrieval tools. + message RetrievedContext { + // URI reference of the attribution. + optional string uri = 1; + + // Title of the attribution. + optional string title = 2; + } + + // Chunk type. + oneof chunk_type { + // Grounding chunk from the web. + Web web = 1; + + // Grounding chunk from context retrieved by the retrieval tools. + RetrievedContext retrieved_context = 2; + } +} + +// Grounding support. +message GroundingSupport { + // Segment of the content this support belongs to. + optional Segment segment = 1; + + // A list of indices (into 'grounding_chunk') specifying the + // citations associated with the claim. For instance [1,3,4] means + // that grounding_chunk[1], grounding_chunk[3], + // grounding_chunk[4] are the retrieved content attributed to the claim. + repeated int32 grounding_chunk_indices = 2; + + // Confidence score of the support references. Ranges from 0 to 1. 1 is the + // most confident. This list must have the same size as the + // grounding_chunk_indices. + repeated float confidence_scores = 3; } // Grounding attribution. @@ -449,6 +502,13 @@ message GroundingMetadata { // Optional. List of grounding attributions. repeated GroundingAttribution grounding_attributions = 2 [(google.api.field_behavior) = OPTIONAL]; + + // List of supporting references retrieved from specified grounding source. + repeated GroundingChunk grounding_chunks = 5; + + // Optional. List of grounding support. + repeated GroundingSupport grounding_supports = 6 + [(google.api.field_behavior) = OPTIONAL]; } // Google search entry point. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto index 081039f5ed7..23188e990bf 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto @@ -41,7 +41,8 @@ message ModelMonitoringStatsDataPoint { message TypedValue { // Summary statistics for a population of values. message DistributionDataValue { - // tensorflow.metadata.v0.DatasetFeatureStatistics format. + // Predictive monitoring drift distribution in + // `tensorflow.metadata.v0.DatasetFeatureStatistics` format. google.protobuf.Value distribution = 1; // Distribution distance deviation from the current dataset's statistics diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto index e3621429115..05650bd27c3 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/prediction_service.proto @@ -78,6 +78,20 @@ service PredictionService { option (google.api.method_signature) = "endpoint,http_body"; } + // Perform a streaming online prediction with an arbitrary HTTP payload. + rpc StreamRawPredict(StreamRawPredictRequest) + returns (stream google.api.HttpBody) { + option (google.api.http) = { + post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict" + body: "*" + additional_bindings { + post: "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict" + body: "*" + } + }; + option (google.api.method_signature) = "endpoint,http_body"; + } + // Perform an unary online prediction request to a gRPC model server for // Vertex first-party products and frameworks. rpc DirectPredict(DirectPredictRequest) returns (DirectPredictResponse) { @@ -305,6 +319,23 @@ message RawPredictRequest { google.api.HttpBody http_body = 2; } +// Request message for +// [PredictionService.StreamRawPredict][google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredict]. +message StreamRawPredictRequest { + // Required. The name of the Endpoint requested to serve the prediction. + // Format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // The prediction input. Supports HTTP headers and arbitrary data payload. + google.api.HttpBody http_body = 2; +} + // Request message for // [PredictionService.DirectPredict][google.cloud.aiplatform.v1beta1.PredictionService.DirectPredict]. message DirectPredictRequest { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tool.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tool.proto index 17d09725375..290001c4239 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tool.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/tool.proto @@ -164,6 +164,7 @@ message FunctionResponse { // Defines a retrieval tool that model can call to access external knowledge. message Retrieval { + // The source of the retrieval. oneof source { // Set to use data source powered by Vertex AI Search. VertexAISearch vertex_ai_search = 2; diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 4617f76e351..d879750aeb3 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -9949,7 +9949,8 @@ export namespace google { OTHER = 5, BLOCKLIST = 6, PROHIBITED_CONTENT = 7, - SPII = 8 + SPII = 8, + MALFORMED_FUNCTION_CALL = 9 } } @@ -40535,6 +40536,9 @@ export namespace google { /** TuningJob tuningDataStats */ tuningDataStats?: (google.cloud.aiplatform.v1.ITuningDataStats|null); + + /** TuningJob encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); } /** Represents a TuningJob. */ @@ -40591,6 +40595,9 @@ export namespace google { /** TuningJob tuningDataStats. */ public tuningDataStats?: (google.cloud.aiplatform.v1.ITuningDataStats|null); + /** TuningJob encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + /** TuningJob sourceModel. */ public sourceModel?: "baseModel"; @@ -82484,6 +82491,9 @@ export namespace google { /** PipelineJob scheduleName */ scheduleName?: (string|null); + + /** PipelineJob preflightValidations */ + preflightValidations?: (boolean|null); } /** Represents a PipelineJob. */ @@ -82552,6 +82562,9 @@ export namespace google { /** PipelineJob scheduleName. */ public scheduleName: string; + /** PipelineJob preflightValidations. */ + public preflightValidations: boolean; + /** * Creates a new PipelineJob instance using the specified properties. * @param [properties] Properties to set @@ -117924,7 +117937,8 @@ export namespace google { OTHER = 5, BLOCKLIST = 6, PROHIBITED_CONTENT = 7, - SPII = 8 + SPII = 8, + MALFORMED_FUNCTION_CALL = 9 } } @@ -117939,6 +117953,9 @@ export namespace google { /** Segment endIndex */ endIndex?: (number|null); + + /** Segment text */ + text?: (string|null); } /** Represents a Segment. */ @@ -117959,6 +117976,9 @@ export namespace google { /** Segment endIndex. */ public endIndex: number; + /** Segment text. */ + public text: string; + /** * Creates a new Segment instance using the specified properties. * @param [properties] Properties to set @@ -118037,6 +118057,445 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GroundingChunk. */ + interface IGroundingChunk { + + /** GroundingChunk web */ + web?: (google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb|null); + + /** GroundingChunk retrievedContext */ + retrievedContext?: (google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext|null); + } + + /** Represents a GroundingChunk. */ + class GroundingChunk implements IGroundingChunk { + + /** + * Constructs a new GroundingChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IGroundingChunk); + + /** GroundingChunk web. */ + public web?: (google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb|null); + + /** GroundingChunk retrievedContext. */ + public retrievedContext?: (google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext|null); + + /** GroundingChunk chunkType. */ + public chunkType?: ("web"|"retrievedContext"); + + /** + * Creates a new GroundingChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingChunk instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IGroundingChunk): google.cloud.aiplatform.v1beta1.GroundingChunk; + + /** + * Encodes the specified GroundingChunk message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.verify|verify} messages. + * @param message GroundingChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IGroundingChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.verify|verify} messages. + * @param message GroundingChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IGroundingChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingChunk + * @throws {Error} If the payload is not a 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.GroundingChunk; + + /** + * Decodes a GroundingChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingChunk + * @throws {Error} If the payload is 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.GroundingChunk; + + /** + * Verifies a GroundingChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingChunk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.GroundingChunk; + + /** + * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified. + * @param message GroundingChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.GroundingChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroundingChunk { + + /** Properties of a Web. */ + interface IWeb { + + /** Web uri */ + uri?: (string|null); + + /** Web title */ + title?: (string|null); + } + + /** Represents a Web. */ + class Web implements IWeb { + + /** + * Constructs a new Web. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb); + + /** Web uri. */ + public uri?: (string|null); + + /** Web title. */ + public title?: (string|null); + + /** Web _uri. */ + public _uri?: "uri"; + + /** Web _title. */ + public _title?: "title"; + + /** + * Creates a new Web instance using the specified properties. + * @param [properties] Properties to set + * @returns Web instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb): google.cloud.aiplatform.v1beta1.GroundingChunk.Web; + + /** + * Encodes the specified Web message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.Web.verify|verify} messages. + * @param message Web message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Web message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.Web.verify|verify} messages. + * @param message Web message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Web message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Web + * @throws {Error} If the payload is not a 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.GroundingChunk.Web; + + /** + * Decodes a Web message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Web + * @throws {Error} If the payload is 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.GroundingChunk.Web; + + /** + * Verifies a Web message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Web message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Web + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.GroundingChunk.Web; + + /** + * Creates a plain object from a Web message. Also converts values to other types if specified. + * @param message Web + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.GroundingChunk.Web, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Web to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Web + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrievedContext. */ + interface IRetrievedContext { + + /** RetrievedContext uri */ + uri?: (string|null); + + /** RetrievedContext title */ + title?: (string|null); + } + + /** Represents a RetrievedContext. */ + class RetrievedContext implements IRetrievedContext { + + /** + * Constructs a new RetrievedContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext); + + /** RetrievedContext uri. */ + public uri?: (string|null); + + /** RetrievedContext title. */ + public title?: (string|null); + + /** RetrievedContext _uri. */ + public _uri?: "uri"; + + /** RetrievedContext _title. */ + public _title?: "title"; + + /** + * Creates a new RetrievedContext instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrievedContext instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext): google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext; + + /** + * Encodes the specified RetrievedContext message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.verify|verify} messages. + * @param message RetrievedContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrievedContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.verify|verify} messages. + * @param message RetrievedContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrievedContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrievedContext + * @throws {Error} If the payload is not a 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.GroundingChunk.RetrievedContext; + + /** + * Decodes a RetrievedContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrievedContext + * @throws {Error} If the payload is 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.GroundingChunk.RetrievedContext; + + /** + * Verifies a RetrievedContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrievedContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrievedContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext; + + /** + * Creates a plain object from a RetrievedContext message. Also converts values to other types if specified. + * @param message RetrievedContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrievedContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrievedContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GroundingSupport. */ + interface IGroundingSupport { + + /** GroundingSupport segment */ + segment?: (google.cloud.aiplatform.v1beta1.ISegment|null); + + /** GroundingSupport groundingChunkIndices */ + groundingChunkIndices?: (number[]|null); + + /** GroundingSupport confidenceScores */ + confidenceScores?: (number[]|null); + } + + /** Represents a GroundingSupport. */ + class GroundingSupport implements IGroundingSupport { + + /** + * Constructs a new GroundingSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IGroundingSupport); + + /** GroundingSupport segment. */ + public segment?: (google.cloud.aiplatform.v1beta1.ISegment|null); + + /** GroundingSupport groundingChunkIndices. */ + public groundingChunkIndices: number[]; + + /** GroundingSupport confidenceScores. */ + public confidenceScores: number[]; + + /** GroundingSupport _segment. */ + public _segment?: "segment"; + + /** + * Creates a new GroundingSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingSupport instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IGroundingSupport): google.cloud.aiplatform.v1beta1.GroundingSupport; + + /** + * Encodes the specified GroundingSupport message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingSupport.verify|verify} messages. + * @param message GroundingSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IGroundingSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingSupport.verify|verify} messages. + * @param message GroundingSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IGroundingSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingSupport + * @throws {Error} If the payload is not a 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.GroundingSupport; + + /** + * Decodes a GroundingSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingSupport + * @throws {Error} If the payload is 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.GroundingSupport; + + /** + * Verifies a GroundingSupport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingSupport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.GroundingSupport; + + /** + * Creates a plain object from a GroundingSupport message. Also converts values to other types if specified. + * @param message GroundingSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.GroundingSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GroundingAttribution. */ interface IGroundingAttribution { @@ -118381,6 +118840,12 @@ export namespace google { /** GroundingMetadata groundingAttributions */ groundingAttributions?: (google.cloud.aiplatform.v1beta1.IGroundingAttribution[]|null); + + /** GroundingMetadata groundingChunks */ + groundingChunks?: (google.cloud.aiplatform.v1beta1.IGroundingChunk[]|null); + + /** GroundingMetadata groundingSupports */ + groundingSupports?: (google.cloud.aiplatform.v1beta1.IGroundingSupport[]|null); } /** Represents a GroundingMetadata. */ @@ -118404,6 +118869,12 @@ export namespace google { /** GroundingMetadata groundingAttributions. */ public groundingAttributions: google.cloud.aiplatform.v1beta1.IGroundingAttribution[]; + /** GroundingMetadata groundingChunks. */ + public groundingChunks: google.cloud.aiplatform.v1beta1.IGroundingChunk[]; + + /** GroundingMetadata groundingSupports. */ + public groundingSupports: google.cloud.aiplatform.v1beta1.IGroundingSupport[]; + /** GroundingMetadata _searchEntryPoint. */ public _searchEntryPoint?: "searchEntryPoint"; @@ -212985,6 +213456,20 @@ export namespace google { */ public rawPredict(request: google.cloud.aiplatform.v1beta1.IRawPredictRequest): Promise; + /** + * Calls StreamRawPredict. + * @param request StreamRawPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public streamRawPredict(request: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest, callback: google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredictCallback): void; + + /** + * Calls StreamRawPredict. + * @param request StreamRawPredictRequest message or plain object + * @returns Promise + */ + public streamRawPredict(request: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest): Promise; + /** * Calls DirectPredict. * @param request DirectPredictRequest message or plain object @@ -213170,6 +213655,13 @@ export namespace google { */ type RawPredictCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.PredictionService|streamRawPredict}. + * @param error Error, if any + * @param [response] HttpBody + */ + type StreamRawPredictCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.PredictionService|directPredict}. * @param error Error, if any @@ -213594,6 +214086,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a StreamRawPredictRequest. */ + interface IStreamRawPredictRequest { + + /** StreamRawPredictRequest endpoint */ + endpoint?: (string|null); + + /** StreamRawPredictRequest httpBody */ + httpBody?: (google.api.IHttpBody|null); + } + + /** Represents a StreamRawPredictRequest. */ + class StreamRawPredictRequest implements IStreamRawPredictRequest { + + /** + * Constructs a new StreamRawPredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest); + + /** StreamRawPredictRequest endpoint. */ + public endpoint: string; + + /** StreamRawPredictRequest httpBody. */ + public httpBody?: (google.api.IHttpBody|null); + + /** + * Creates a new StreamRawPredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamRawPredictRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest): google.cloud.aiplatform.v1beta1.StreamRawPredictRequest; + + /** + * Encodes the specified StreamRawPredictRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamRawPredictRequest.verify|verify} messages. + * @param message StreamRawPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamRawPredictRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamRawPredictRequest.verify|verify} messages. + * @param message StreamRawPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamRawPredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamRawPredictRequest + * @throws {Error} If the payload is not a 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.StreamRawPredictRequest; + + /** + * Decodes a StreamRawPredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamRawPredictRequest + * @throws {Error} If the payload is 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.StreamRawPredictRequest; + + /** + * Verifies a StreamRawPredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamRawPredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamRawPredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.StreamRawPredictRequest; + + /** + * Creates a plain object from a StreamRawPredictRequest message. Also converts values to other types if specified. + * @param message StreamRawPredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.StreamRawPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamRawPredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamRawPredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DirectPredictRequest. */ interface IDirectPredictRequest { diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 4b50c000f0a..a81c8c5b9aa 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -25687,6 +25687,7 @@ case 6: case 7: case 8: + case 9: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -25778,6 +25779,10 @@ case 8: message.finishReason = 8; break; + case "MALFORMED_FUNCTION_CALL": + case 9: + message.finishReason = 9; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -25888,6 +25893,7 @@ * @property {number} BLOCKLIST=6 BLOCKLIST value * @property {number} PROHIBITED_CONTENT=7 PROHIBITED_CONTENT value * @property {number} SPII=8 SPII value + * @property {number} MALFORMED_FUNCTION_CALL=9 MALFORMED_FUNCTION_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -25900,6 +25906,7 @@ values[valuesById[6] = "BLOCKLIST"] = 6; values[valuesById[7] = "PROHIBITED_CONTENT"] = 7; values[valuesById[8] = "SPII"] = 8; + values[valuesById[9] = "MALFORMED_FUNCTION_CALL"] = 9; return values; })(); @@ -100152,6 +100159,7 @@ * @property {string|null} [experiment] TuningJob experiment * @property {google.cloud.aiplatform.v1.ITunedModel|null} [tunedModel] TuningJob tunedModel * @property {google.cloud.aiplatform.v1.ITuningDataStats|null} [tuningDataStats] TuningJob tuningDataStats + * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] TuningJob encryptionSpec */ /** @@ -100290,6 +100298,14 @@ */ TuningJob.prototype.tuningDataStats = null; + /** + * TuningJob encryptionSpec. + * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1.TuningJob + * @instance + */ + TuningJob.prototype.encryptionSpec = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -100370,6 +100386,8 @@ $root.google.cloud.aiplatform.v1.TunedModel.encode(message.tunedModel, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.tuningDataStats != null && Object.hasOwnProperty.call(message, "tuningDataStats")) $root.google.cloud.aiplatform.v1.TuningDataStats.encode(message.tuningDataStats, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); return writer; }; @@ -100483,6 +100501,10 @@ message.tuningDataStats = $root.google.cloud.aiplatform.v1.TuningDataStats.decode(reader, reader.uint32()); break; } + case 16: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -100605,6 +100627,11 @@ if (error) return "tuningDataStats." + error; } + 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; }; @@ -100733,6 +100760,11 @@ throw TypeError(".google.cloud.aiplatform.v1.TuningJob.tuningDataStats: object expected"); message.tuningDataStats = $root.google.cloud.aiplatform.v1.TuningDataStats.fromObject(object.tuningDataStats); } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TuningJob.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } return message; }; @@ -100764,6 +100796,7 @@ object.experiment = ""; object.tunedModel = null; object.tuningDataStats = null; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -100805,6 +100838,8 @@ object.tunedModel = $root.google.cloud.aiplatform.v1.TunedModel.toObject(message.tunedModel, options); if (message.tuningDataStats != null && message.hasOwnProperty("tuningDataStats")) object.tuningDataStats = $root.google.cloud.aiplatform.v1.TuningDataStats.toObject(message.tuningDataStats, options); + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -200447,6 +200482,7 @@ * @property {string|null} [templateUri] PipelineJob templateUri * @property {google.cloud.aiplatform.v1.IPipelineTemplateMetadata|null} [templateMetadata] PipelineJob templateMetadata * @property {string|null} [scheduleName] PipelineJob scheduleName + * @property {boolean|null} [preflightValidations] PipelineJob preflightValidations */ /** @@ -200618,6 +200654,14 @@ */ PipelineJob.prototype.scheduleName = ""; + /** + * PipelineJob preflightValidations. + * @member {boolean} preflightValidations + * @memberof google.cloud.aiplatform.v1.PipelineJob + * @instance + */ + PipelineJob.prototype.preflightValidations = false; + /** * Creates a new PipelineJob instance using the specified properties. * @function create @@ -200682,6 +200726,8 @@ if (message.reservedIpRanges != null && message.reservedIpRanges.length) for (var i = 0; i < message.reservedIpRanges.length; ++i) writer.uint32(/* id 25, wireType 2 =*/202).string(message.reservedIpRanges[i]); + if (message.preflightValidations != null && Object.hasOwnProperty.call(message, "preflightValidations")) + writer.uint32(/* id 26, wireType 0 =*/208).bool(message.preflightValidations); return writer; }; @@ -200813,6 +200859,10 @@ message.scheduleName = reader.string(); break; } + case 26: { + message.preflightValidations = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -200946,6 +200996,9 @@ if (message.scheduleName != null && message.hasOwnProperty("scheduleName")) if (!$util.isString(message.scheduleName)) return "scheduleName: string expected"; + if (message.preflightValidations != null && message.hasOwnProperty("preflightValidations")) + if (typeof message.preflightValidations !== "boolean") + return "preflightValidations: boolean expected"; return null; }; @@ -201081,6 +201134,8 @@ } if (object.scheduleName != null) message.scheduleName = String(object.scheduleName); + if (object.preflightValidations != null) + message.preflightValidations = Boolean(object.preflightValidations); return message; }; @@ -201119,6 +201174,7 @@ object.templateUri = ""; object.templateMetadata = null; object.scheduleName = ""; + object.preflightValidations = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -201165,6 +201221,8 @@ for (var j = 0; j < message.reservedIpRanges.length; ++j) object.reservedIpRanges[j] = message.reservedIpRanges[j]; } + if (message.preflightValidations != null && message.hasOwnProperty("preflightValidations")) + object.preflightValidations = message.preflightValidations; return object; }; @@ -287412,6 +287470,7 @@ case 6: case 7: case 8: + case 9: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -287503,6 +287562,10 @@ case 8: message.finishReason = 8; break; + case "MALFORMED_FUNCTION_CALL": + case 9: + message.finishReason = 9; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -287613,6 +287676,7 @@ * @property {number} BLOCKLIST=6 BLOCKLIST value * @property {number} PROHIBITED_CONTENT=7 PROHIBITED_CONTENT value * @property {number} SPII=8 SPII value + * @property {number} MALFORMED_FUNCTION_CALL=9 MALFORMED_FUNCTION_CALL value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -287625,6 +287689,7 @@ values[valuesById[6] = "BLOCKLIST"] = 6; values[valuesById[7] = "PROHIBITED_CONTENT"] = 7; values[valuesById[8] = "SPII"] = 8; + values[valuesById[9] = "MALFORMED_FUNCTION_CALL"] = 9; return values; })(); @@ -287640,6 +287705,7 @@ * @property {number|null} [partIndex] Segment partIndex * @property {number|null} [startIndex] Segment startIndex * @property {number|null} [endIndex] Segment endIndex + * @property {string|null} [text] Segment text */ /** @@ -287681,6 +287747,14 @@ */ Segment.prototype.endIndex = 0; + /** + * Segment text. + * @member {string} text + * @memberof google.cloud.aiplatform.v1beta1.Segment + * @instance + */ + Segment.prototype.text = ""; + /** * Creates a new Segment instance using the specified properties. * @function create @@ -287711,6 +287785,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startIndex); if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.endIndex); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); return writer; }; @@ -287757,6 +287833,10 @@ message.endIndex = reader.int32(); break; } + case 4: { + message.text = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -287801,6 +287881,9 @@ if (message.endIndex != null && message.hasOwnProperty("endIndex")) if (!$util.isInteger(message.endIndex)) return "endIndex: integer expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; @@ -287822,6 +287905,8 @@ message.startIndex = object.startIndex | 0; if (object.endIndex != null) message.endIndex = object.endIndex | 0; + if (object.text != null) + message.text = String(object.text); return message; }; @@ -287842,6 +287927,7 @@ object.partIndex = 0; object.startIndex = 0; object.endIndex = 0; + object.text = ""; } if (message.partIndex != null && message.hasOwnProperty("partIndex")) object.partIndex = message.partIndex; @@ -287849,6 +287935,8 @@ object.startIndex = message.startIndex; if (message.endIndex != null && message.hasOwnProperty("endIndex")) object.endIndex = message.endIndex; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; @@ -287881,27 +287969,25 @@ return Segment; })(); - v1beta1.GroundingAttribution = (function() { + v1beta1.GroundingChunk = (function() { /** - * Properties of a GroundingAttribution. + * Properties of a GroundingChunk. * @memberof google.cloud.aiplatform.v1beta1 - * @interface IGroundingAttribution - * @property {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb|null} [web] GroundingAttribution web - * @property {google.cloud.aiplatform.v1beta1.GroundingAttribution.IRetrievedContext|null} [retrievedContext] GroundingAttribution retrievedContext - * @property {google.cloud.aiplatform.v1beta1.ISegment|null} [segment] GroundingAttribution segment - * @property {number|null} [confidenceScore] GroundingAttribution confidenceScore + * @interface IGroundingChunk + * @property {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb|null} [web] GroundingChunk web + * @property {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext|null} [retrievedContext] GroundingChunk retrievedContext */ /** - * Constructs a new GroundingAttribution. + * Constructs a new GroundingChunk. * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a GroundingAttribution. - * @implements IGroundingAttribution + * @classdesc Represents a GroundingChunk. + * @implements IGroundingChunk * @constructor - * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1beta1.IGroundingChunk=} [properties] Properties to set */ - function GroundingAttribution(properties) { + function GroundingChunk(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287909,142 +287995,103 @@ } /** - * GroundingAttribution web. - * @member {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb|null|undefined} web - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution - * @instance - */ - GroundingAttribution.prototype.web = null; - - /** - * GroundingAttribution retrievedContext. - * @member {google.cloud.aiplatform.v1beta1.GroundingAttribution.IRetrievedContext|null|undefined} retrievedContext - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution - * @instance - */ - GroundingAttribution.prototype.retrievedContext = null; - - /** - * GroundingAttribution segment. - * @member {google.cloud.aiplatform.v1beta1.ISegment|null|undefined} segment - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * GroundingChunk web. + * @member {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb|null|undefined} web + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @instance */ - GroundingAttribution.prototype.segment = null; + GroundingChunk.prototype.web = null; /** - * GroundingAttribution confidenceScore. - * @member {number|null|undefined} confidenceScore - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * GroundingChunk retrievedContext. + * @member {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext|null|undefined} retrievedContext + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @instance */ - GroundingAttribution.prototype.confidenceScore = null; + GroundingChunk.prototype.retrievedContext = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GroundingAttribution reference. - * @member {"web"|"retrievedContext"|undefined} reference - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * GroundingChunk chunkType. + * @member {"web"|"retrievedContext"|undefined} chunkType + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @instance */ - Object.defineProperty(GroundingAttribution.prototype, "reference", { + Object.defineProperty(GroundingChunk.prototype, "chunkType", { get: $util.oneOfGetter($oneOfFields = ["web", "retrievedContext"]), set: $util.oneOfSetter($oneOfFields) }); /** - * GroundingAttribution _confidenceScore. - * @member {"confidenceScore"|undefined} _confidenceScore - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution - * @instance - */ - Object.defineProperty(GroundingAttribution.prototype, "_confidenceScore", { - get: $util.oneOfGetter($oneOfFields = ["confidenceScore"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GroundingAttribution instance using the specified properties. + * Creates a new GroundingChunk instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static - * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution instance + * @param {google.cloud.aiplatform.v1beta1.IGroundingChunk=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk} GroundingChunk instance */ - GroundingAttribution.create = function create(properties) { - return new GroundingAttribution(properties); + GroundingChunk.create = function create(properties) { + return new GroundingChunk(properties); }; /** - * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.verify|verify} messages. + * Encodes the specified GroundingChunk message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static - * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution} message GroundingAttribution message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IGroundingChunk} message GroundingChunk message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingAttribution.encode = function encode(message, writer) { + GroundingChunk.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) - $root.google.cloud.aiplatform.v1beta1.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidenceScore); if (message.web != null && Object.hasOwnProperty.call(message, "web")) - $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.encode(message.web, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web.encode(message.web, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.retrievedContext != null && Object.hasOwnProperty.call(message, "retrievedContext")) - $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.encode(message.retrievedContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.encode(message.retrievedContext, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.verify|verify} messages. + * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static - * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution} message GroundingAttribution message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IGroundingChunk} message GroundingChunk message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroundingAttribution.encodeDelimited = function encodeDelimited(message, writer) { + GroundingChunk.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroundingAttribution message from the specified reader or buffer. + * Decodes a GroundingChunk message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @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.GroundingAttribution} GroundingAttribution + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk} GroundingChunk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingAttribution.decode = function decode(reader, length) { + GroundingChunk.decode = function decode(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.GroundingAttribution(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.GroundingChunk(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: { - message.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.decode(reader, reader.uint32()); - break; - } - case 4: { - message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.decode(reader, reader.uint32()); - break; - } case 1: { - message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.decode(reader, reader.uint32()); + message.web = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web.decode(reader, reader.uint32()); break; } case 2: { - message.confidenceScore = reader.float(); + message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.decode(reader, reader.uint32()); break; } default: @@ -288056,162 +288103,136 @@ }; /** - * Decodes a GroundingAttribution message from the specified reader or buffer, length delimited. + * Decodes a GroundingChunk message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk} GroundingChunk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroundingAttribution.decodeDelimited = function decodeDelimited(reader) { + GroundingChunk.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroundingAttribution message. + * Verifies a GroundingChunk message. * @function verify - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroundingAttribution.verify = function verify(message) { + GroundingChunk.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.web != null && message.hasOwnProperty("web")) { - properties.reference = 1; + properties.chunkType = 1; { - var error = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify(message.web); + var error = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web.verify(message.web); if (error) return "web." + error; } } if (message.retrievedContext != null && message.hasOwnProperty("retrievedContext")) { - if (properties.reference === 1) - return "reference: multiple values"; - properties.reference = 1; + if (properties.chunkType === 1) + return "chunkType: multiple values"; + properties.chunkType = 1; { - var error = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.verify(message.retrievedContext); + var error = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.verify(message.retrievedContext); if (error) return "retrievedContext." + error; } } - if (message.segment != null && message.hasOwnProperty("segment")) { - var error = $root.google.cloud.aiplatform.v1beta1.Segment.verify(message.segment); - if (error) - return "segment." + error; - } - if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) { - properties._confidenceScore = 1; - if (typeof message.confidenceScore !== "number") - return "confidenceScore: number expected"; - } return null; }; /** - * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types. + * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk} GroundingChunk */ - GroundingAttribution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingAttribution) + GroundingChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingChunk) return object; - var message = new $root.google.cloud.aiplatform.v1beta1.GroundingAttribution(); + var message = new $root.google.cloud.aiplatform.v1beta1.GroundingChunk(); if (object.web != null) { if (typeof object.web !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.web: object expected"); - message.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.fromObject(object.web); + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingChunk.web: object expected"); + message.web = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web.fromObject(object.web); } if (object.retrievedContext != null) { if (typeof object.retrievedContext !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.retrievedContext: object expected"); - message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.fromObject(object.retrievedContext); - } - if (object.segment != null) { - if (typeof object.segment !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.segment: object expected"); - message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.fromObject(object.segment); + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingChunk.retrievedContext: object expected"); + message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.fromObject(object.retrievedContext); } - if (object.confidenceScore != null) - message.confidenceScore = Number(object.confidenceScore); return message; }; /** - * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified. + * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static - * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution} message GroundingAttribution + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk} message GroundingChunk * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroundingAttribution.toObject = function toObject(message, options) { + GroundingChunk.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.segment = null; - if (message.segment != null && message.hasOwnProperty("segment")) - object.segment = $root.google.cloud.aiplatform.v1beta1.Segment.toObject(message.segment, options); - if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) { - object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; - if (options.oneofs) - object._confidenceScore = "confidenceScore"; - } if (message.web != null && message.hasOwnProperty("web")) { - object.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.toObject(message.web, options); + object.web = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web.toObject(message.web, options); if (options.oneofs) - object.reference = "web"; + object.chunkType = "web"; } if (message.retrievedContext != null && message.hasOwnProperty("retrievedContext")) { - object.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.toObject(message.retrievedContext, options); + object.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.toObject(message.retrievedContext, options); if (options.oneofs) - object.reference = "retrievedContext"; + object.chunkType = "retrievedContext"; } return object; }; /** - * Converts this GroundingAttribution to JSON. + * Converts this GroundingChunk to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @instance * @returns {Object.} JSON object */ - GroundingAttribution.prototype.toJSON = function toJSON() { + GroundingChunk.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GroundingAttribution + * Gets the default type url for GroundingChunk * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GroundingAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GroundingChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingAttribution"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingChunk"; }; - GroundingAttribution.Web = (function() { + GroundingChunk.Web = (function() { /** * Properties of a Web. - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @interface IWeb * @property {string|null} [uri] Web uri * @property {string|null} [title] Web title @@ -288219,11 +288240,11 @@ /** * Constructs a new Web. - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk * @classdesc Represents a Web. * @implements IWeb * @constructor - * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb=} [properties] Properties to set */ function Web(properties) { if (properties) @@ -288234,38 +288255,63 @@ /** * Web uri. - * @member {string} uri - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @member {string|null|undefined} uri + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @instance */ - Web.prototype.uri = ""; + Web.prototype.uri = null; /** * Web title. - * @member {string} title - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @member {string|null|undefined} title + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @instance */ - Web.prototype.title = ""; + Web.prototype.title = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Web _uri. + * @member {"uri"|undefined} _uri + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @instance + */ + Object.defineProperty(Web.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Web _title. + * @member {"title"|undefined} _title + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @instance + */ + Object.defineProperty(Web.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new Web instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @static - * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution.Web} Web instance + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.Web} Web instance */ Web.create = function create(properties) { return new Web(properties); }; /** - * Encodes the specified Web message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify|verify} messages. + * Encodes the specified Web message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.Web.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @static - * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb} message Web message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb} message Web message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -288280,11 +288326,11 @@ }; /** - * Encodes the specified Web message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify|verify} messages. + * Encodes the specified Web message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.Web.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @static - * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb} message Web message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IWeb} message Web message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -288295,18 +288341,1163 @@ /** * Decodes a Web message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web * @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.GroundingAttribution.Web} Web + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.Web} Web * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Web.decode = function decode(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.GroundingAttribution.Web(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Web message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.Web} Web + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Web.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Web message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Web.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + return null; + }; + + /** + * Creates a Web message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.Web} Web + */ + Web.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.GroundingChunk.Web(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a Web message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.Web} message Web + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Web.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + return object; + }; + + /** + * Converts this Web to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @instance + * @returns {Object.} JSON object + */ + Web.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Web + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.Web + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Web.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingChunk.Web"; + }; + + return Web; + })(); + + GroundingChunk.RetrievedContext = (function() { + + /** + * Properties of a RetrievedContext. + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk + * @interface IRetrievedContext + * @property {string|null} [uri] RetrievedContext uri + * @property {string|null} [title] RetrievedContext title + */ + + /** + * Constructs a new RetrievedContext. + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk + * @classdesc Represents a RetrievedContext. + * @implements IRetrievedContext + * @constructor + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext=} [properties] Properties to set + */ + function RetrievedContext(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrievedContext uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @instance + */ + RetrievedContext.prototype.uri = null; + + /** + * RetrievedContext title. + * @member {string|null|undefined} title + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @instance + */ + RetrievedContext.prototype.title = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrievedContext _uri. + * @member {"uri"|undefined} _uri + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @instance + */ + Object.defineProperty(RetrievedContext.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RetrievedContext _title. + * @member {"title"|undefined} _title + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @instance + */ + Object.defineProperty(RetrievedContext.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrievedContext instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext} RetrievedContext instance + */ + RetrievedContext.create = function create(properties) { + return new RetrievedContext(properties); + }; + + /** + * Encodes the specified RetrievedContext message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext} message RetrievedContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievedContext.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.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + return writer; + }; + + /** + * Encodes the specified RetrievedContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.IRetrievedContext} message RetrievedContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievedContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrievedContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @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.GroundingChunk.RetrievedContext} RetrievedContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievedContext.decode = function decode(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.GroundingChunk.RetrievedContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrievedContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext} RetrievedContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievedContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrievedContext message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrievedContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + return null; + }; + + /** + * Creates a RetrievedContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext} RetrievedContext + */ + RetrievedContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a RetrievedContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext} message RetrievedContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrievedContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + return object; + }; + + /** + * Converts this RetrievedContext to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @instance + * @returns {Object.} JSON object + */ + RetrievedContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrievedContext + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrievedContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingChunk.RetrievedContext"; + }; + + return RetrievedContext; + })(); + + return GroundingChunk; + })(); + + v1beta1.GroundingSupport = (function() { + + /** + * Properties of a GroundingSupport. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IGroundingSupport + * @property {google.cloud.aiplatform.v1beta1.ISegment|null} [segment] GroundingSupport segment + * @property {Array.|null} [groundingChunkIndices] GroundingSupport groundingChunkIndices + * @property {Array.|null} [confidenceScores] GroundingSupport confidenceScores + */ + + /** + * Constructs a new GroundingSupport. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a GroundingSupport. + * @implements IGroundingSupport + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IGroundingSupport=} [properties] Properties to set + */ + function GroundingSupport(properties) { + this.groundingChunkIndices = []; + this.confidenceScores = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingSupport segment. + * @member {google.cloud.aiplatform.v1beta1.ISegment|null|undefined} segment + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @instance + */ + GroundingSupport.prototype.segment = null; + + /** + * GroundingSupport groundingChunkIndices. + * @member {Array.} groundingChunkIndices + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @instance + */ + GroundingSupport.prototype.groundingChunkIndices = $util.emptyArray; + + /** + * GroundingSupport confidenceScores. + * @member {Array.} confidenceScores + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @instance + */ + GroundingSupport.prototype.confidenceScores = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroundingSupport _segment. + * @member {"segment"|undefined} _segment + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @instance + */ + Object.defineProperty(GroundingSupport.prototype, "_segment", { + get: $util.oneOfGetter($oneOfFields = ["segment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroundingSupport instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingSupport=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingSupport} GroundingSupport instance + */ + GroundingSupport.create = function create(properties) { + return new GroundingSupport(properties); + }; + + /** + * Encodes the specified GroundingSupport message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingSupport.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingSupport} message GroundingSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSupport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.aiplatform.v1beta1.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groundingChunkIndices != null && message.groundingChunkIndices.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.groundingChunkIndices.length; ++i) + writer.int32(message.groundingChunkIndices[i]); + writer.ldelim(); + } + if (message.confidenceScores != null && message.confidenceScores.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.confidenceScores.length; ++i) + writer.float(message.confidenceScores[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingSupport} message GroundingSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingSupport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @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.GroundingSupport} GroundingSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSupport.decode = function decode(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.GroundingSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.groundingChunkIndices && message.groundingChunkIndices.length)) + message.groundingChunkIndices = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.groundingChunkIndices.push(reader.int32()); + } else + message.groundingChunkIndices.push(reader.int32()); + break; + } + case 3: { + if (!(message.confidenceScores && message.confidenceScores.length)) + message.confidenceScores = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.confidenceScores.push(reader.float()); + } else + message.confidenceScores.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.GroundingSupport} GroundingSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingSupport message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingSupport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.segment != null && message.hasOwnProperty("segment")) { + properties._segment = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Segment.verify(message.segment); + if (error) + return "segment." + error; + } + } + if (message.groundingChunkIndices != null && message.hasOwnProperty("groundingChunkIndices")) { + if (!Array.isArray(message.groundingChunkIndices)) + return "groundingChunkIndices: array expected"; + for (var i = 0; i < message.groundingChunkIndices.length; ++i) + if (!$util.isInteger(message.groundingChunkIndices[i])) + return "groundingChunkIndices: integer[] expected"; + } + if (message.confidenceScores != null && message.hasOwnProperty("confidenceScores")) { + if (!Array.isArray(message.confidenceScores)) + return "confidenceScores: array expected"; + for (var i = 0; i < message.confidenceScores.length; ++i) + if (typeof message.confidenceScores[i] !== "number") + return "confidenceScores: number[] expected"; + } + return null; + }; + + /** + * Creates a GroundingSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.GroundingSupport} GroundingSupport + */ + GroundingSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingSupport) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.GroundingSupport(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingSupport.segment: object expected"); + message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.fromObject(object.segment); + } + if (object.groundingChunkIndices) { + if (!Array.isArray(object.groundingChunkIndices)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingSupport.groundingChunkIndices: array expected"); + message.groundingChunkIndices = []; + for (var i = 0; i < object.groundingChunkIndices.length; ++i) + message.groundingChunkIndices[i] = object.groundingChunkIndices[i] | 0; + } + if (object.confidenceScores) { + if (!Array.isArray(object.confidenceScores)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingSupport.confidenceScores: array expected"); + message.confidenceScores = []; + for (var i = 0; i < object.confidenceScores.length; ++i) + message.confidenceScores[i] = Number(object.confidenceScores[i]); + } + return message; + }; + + /** + * Creates a plain object from a GroundingSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingSupport} message GroundingSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingSupport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.groundingChunkIndices = []; + object.confidenceScores = []; + } + if (message.segment != null && message.hasOwnProperty("segment")) { + object.segment = $root.google.cloud.aiplatform.v1beta1.Segment.toObject(message.segment, options); + if (options.oneofs) + object._segment = "segment"; + } + if (message.groundingChunkIndices && message.groundingChunkIndices.length) { + object.groundingChunkIndices = []; + for (var j = 0; j < message.groundingChunkIndices.length; ++j) + object.groundingChunkIndices[j] = message.groundingChunkIndices[j]; + } + if (message.confidenceScores && message.confidenceScores.length) { + object.confidenceScores = []; + for (var j = 0; j < message.confidenceScores.length; ++j) + object.confidenceScores[j] = options.json && !isFinite(message.confidenceScores[j]) ? String(message.confidenceScores[j]) : message.confidenceScores[j]; + } + return object; + }; + + /** + * Converts this GroundingSupport to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @instance + * @returns {Object.} JSON object + */ + GroundingSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingSupport + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.GroundingSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingSupport"; + }; + + return GroundingSupport; + })(); + + v1beta1.GroundingAttribution = (function() { + + /** + * Properties of a GroundingAttribution. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IGroundingAttribution + * @property {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb|null} [web] GroundingAttribution web + * @property {google.cloud.aiplatform.v1beta1.GroundingAttribution.IRetrievedContext|null} [retrievedContext] GroundingAttribution retrievedContext + * @property {google.cloud.aiplatform.v1beta1.ISegment|null} [segment] GroundingAttribution segment + * @property {number|null} [confidenceScore] GroundingAttribution confidenceScore + */ + + /** + * Constructs a new GroundingAttribution. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a GroundingAttribution. + * @implements IGroundingAttribution + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution=} [properties] Properties to set + */ + function GroundingAttribution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingAttribution web. + * @member {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb|null|undefined} web + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.web = null; + + /** + * GroundingAttribution retrievedContext. + * @member {google.cloud.aiplatform.v1beta1.GroundingAttribution.IRetrievedContext|null|undefined} retrievedContext + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.retrievedContext = null; + + /** + * GroundingAttribution segment. + * @member {google.cloud.aiplatform.v1beta1.ISegment|null|undefined} segment + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.segment = null; + + /** + * GroundingAttribution confidenceScore. + * @member {number|null|undefined} confidenceScore + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.confidenceScore = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroundingAttribution reference. + * @member {"web"|"retrievedContext"|undefined} reference + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + Object.defineProperty(GroundingAttribution.prototype, "reference", { + get: $util.oneOfGetter($oneOfFields = ["web", "retrievedContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GroundingAttribution _confidenceScore. + * @member {"confidenceScore"|undefined} _confidenceScore + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + */ + Object.defineProperty(GroundingAttribution.prototype, "_confidenceScore", { + get: $util.oneOfGetter($oneOfFields = ["confidenceScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroundingAttribution instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution instance + */ + GroundingAttribution.create = function create(properties) { + return new GroundingAttribution(properties); + }; + + /** + * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution} message GroundingAttribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingAttribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.segment != null && Object.hasOwnProperty.call(message, "segment")) + $root.google.cloud.aiplatform.v1beta1.Segment.encode(message.segment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.confidenceScore != null && Object.hasOwnProperty.call(message, "confidenceScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidenceScore); + if (message.web != null && Object.hasOwnProperty.call(message, "web")) + $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.encode(message.web, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.retrievedContext != null && Object.hasOwnProperty.call(message, "retrievedContext")) + $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.encode(message.retrievedContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {google.cloud.aiplatform.v1beta1.IGroundingAttribution} message GroundingAttribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingAttribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingAttribution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @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.GroundingAttribution} GroundingAttribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingAttribution.decode = function decode(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.GroundingAttribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.decode(reader, reader.uint32()); + break; + } + case 4: { + message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.decode(reader, reader.uint32()); + break; + } + case 1: { + message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidenceScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingAttribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingAttribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingAttribution message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingAttribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.web != null && message.hasOwnProperty("web")) { + properties.reference = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify(message.web); + if (error) + return "web." + error; + } + } + if (message.retrievedContext != null && message.hasOwnProperty("retrievedContext")) { + if (properties.reference === 1) + return "reference: multiple values"; + properties.reference = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.verify(message.retrievedContext); + if (error) + return "retrievedContext." + error; + } + } + if (message.segment != null && message.hasOwnProperty("segment")) { + var error = $root.google.cloud.aiplatform.v1beta1.Segment.verify(message.segment); + if (error) + return "segment." + error; + } + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) { + properties._confidenceScore = 1; + if (typeof message.confidenceScore !== "number") + return "confidenceScore: number expected"; + } + return null; + }; + + /** + * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution} GroundingAttribution + */ + GroundingAttribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.GroundingAttribution) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.GroundingAttribution(); + if (object.web != null) { + if (typeof object.web !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.web: object expected"); + message.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.fromObject(object.web); + } + if (object.retrievedContext != null) { + if (typeof object.retrievedContext !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.retrievedContext: object expected"); + message.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.fromObject(object.retrievedContext); + } + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingAttribution.segment: object expected"); + message.segment = $root.google.cloud.aiplatform.v1beta1.Segment.fromObject(object.segment); + } + if (object.confidenceScore != null) + message.confidenceScore = Number(object.confidenceScore); + return message; + }; + + /** + * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution} message GroundingAttribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingAttribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.segment = null; + if (message.segment != null && message.hasOwnProperty("segment")) + object.segment = $root.google.cloud.aiplatform.v1beta1.Segment.toObject(message.segment, options); + if (message.confidenceScore != null && message.hasOwnProperty("confidenceScore")) { + object.confidenceScore = options.json && !isFinite(message.confidenceScore) ? String(message.confidenceScore) : message.confidenceScore; + if (options.oneofs) + object._confidenceScore = "confidenceScore"; + } + if (message.web != null && message.hasOwnProperty("web")) { + object.web = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.toObject(message.web, options); + if (options.oneofs) + object.reference = "web"; + } + if (message.retrievedContext != null && message.hasOwnProperty("retrievedContext")) { + object.retrievedContext = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.RetrievedContext.toObject(message.retrievedContext, options); + if (options.oneofs) + object.reference = "retrievedContext"; + } + return object; + }; + + /** + * Converts this GroundingAttribution to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @instance + * @returns {Object.} JSON object + */ + GroundingAttribution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingAttribution + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingAttribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.GroundingAttribution"; + }; + + GroundingAttribution.Web = (function() { + + /** + * Properties of a Web. + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @interface IWeb + * @property {string|null} [uri] Web uri + * @property {string|null} [title] Web title + */ + + /** + * Constructs a new Web. + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution + * @classdesc Represents a Web. + * @implements IWeb + * @constructor + * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb=} [properties] Properties to set + */ + function Web(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Web uri. + * @member {string} uri + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @instance + */ + Web.prototype.uri = ""; + + /** + * Web title. + * @member {string} title + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @instance + */ + Web.prototype.title = ""; + + /** + * Creates a new Web instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.GroundingAttribution.Web} Web instance + */ + Web.create = function create(properties) { + return new Web(properties); + }; + + /** + * Encodes the specified Web message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb} message Web message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Web.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.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + return writer; + }; + + /** + * Encodes the specified Web message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.GroundingAttribution.Web.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @static + * @param {google.cloud.aiplatform.v1beta1.GroundingAttribution.IWeb} message Web message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Web.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Web message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.GroundingAttribution.Web + * @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.GroundingAttribution.Web} Web + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Web.decode = function decode(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.GroundingAttribution.Web(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -288674,6 +289865,8 @@ * @property {google.cloud.aiplatform.v1beta1.ISearchEntryPoint|null} [searchEntryPoint] GroundingMetadata searchEntryPoint * @property {Array.|null} [retrievalQueries] GroundingMetadata retrievalQueries * @property {Array.|null} [groundingAttributions] GroundingMetadata groundingAttributions + * @property {Array.|null} [groundingChunks] GroundingMetadata groundingChunks + * @property {Array.|null} [groundingSupports] GroundingMetadata groundingSupports */ /** @@ -288688,6 +289881,8 @@ this.webSearchQueries = []; this.retrievalQueries = []; this.groundingAttributions = []; + this.groundingChunks = []; + this.groundingSupports = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -288726,6 +289921,22 @@ */ GroundingMetadata.prototype.groundingAttributions = $util.emptyArray; + /** + * GroundingMetadata groundingChunks. + * @member {Array.} groundingChunks + * @memberof google.cloud.aiplatform.v1beta1.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.groundingChunks = $util.emptyArray; + + /** + * GroundingMetadata groundingSupports. + * @member {Array.} groundingSupports + * @memberof google.cloud.aiplatform.v1beta1.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.groundingSupports = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -288775,6 +289986,12 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.retrievalQueries[i]); if (message.searchEntryPoint != null && Object.hasOwnProperty.call(message, "searchEntryPoint")) $root.google.cloud.aiplatform.v1beta1.SearchEntryPoint.encode(message.searchEntryPoint, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.groundingChunks != null && message.groundingChunks.length) + for (var i = 0; i < message.groundingChunks.length; ++i) + $root.google.cloud.aiplatform.v1beta1.GroundingChunk.encode(message.groundingChunks[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.groundingSupports != null && message.groundingSupports.length) + for (var i = 0; i < message.groundingSupports.length; ++i) + $root.google.cloud.aiplatform.v1beta1.GroundingSupport.encode(message.groundingSupports[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -288831,6 +290048,18 @@ message.groundingAttributions.push($root.google.cloud.aiplatform.v1beta1.GroundingAttribution.decode(reader, reader.uint32())); break; } + case 5: { + if (!(message.groundingChunks && message.groundingChunks.length)) + message.groundingChunks = []; + message.groundingChunks.push($root.google.cloud.aiplatform.v1beta1.GroundingChunk.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.groundingSupports && message.groundingSupports.length)) + message.groundingSupports = []; + message.groundingSupports.push($root.google.cloud.aiplatform.v1beta1.GroundingSupport.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -288898,6 +290127,24 @@ return "groundingAttributions." + error; } } + if (message.groundingChunks != null && message.hasOwnProperty("groundingChunks")) { + if (!Array.isArray(message.groundingChunks)) + return "groundingChunks: array expected"; + for (var i = 0; i < message.groundingChunks.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.verify(message.groundingChunks[i]); + if (error) + return "groundingChunks." + error; + } + } + if (message.groundingSupports != null && message.hasOwnProperty("groundingSupports")) { + if (!Array.isArray(message.groundingSupports)) + return "groundingSupports: array expected"; + for (var i = 0; i < message.groundingSupports.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.GroundingSupport.verify(message.groundingSupports[i]); + if (error) + return "groundingSupports." + error; + } + } return null; }; @@ -288942,6 +290189,26 @@ message.groundingAttributions[i] = $root.google.cloud.aiplatform.v1beta1.GroundingAttribution.fromObject(object.groundingAttributions[i]); } } + if (object.groundingChunks) { + if (!Array.isArray(object.groundingChunks)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingMetadata.groundingChunks: array expected"); + message.groundingChunks = []; + for (var i = 0; i < object.groundingChunks.length; ++i) { + if (typeof object.groundingChunks[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingMetadata.groundingChunks: object expected"); + message.groundingChunks[i] = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.fromObject(object.groundingChunks[i]); + } + } + if (object.groundingSupports) { + if (!Array.isArray(object.groundingSupports)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingMetadata.groundingSupports: array expected"); + message.groundingSupports = []; + for (var i = 0; i < object.groundingSupports.length; ++i) { + if (typeof object.groundingSupports[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GroundingMetadata.groundingSupports: object expected"); + message.groundingSupports[i] = $root.google.cloud.aiplatform.v1beta1.GroundingSupport.fromObject(object.groundingSupports[i]); + } + } return message; }; @@ -288962,6 +290229,8 @@ object.webSearchQueries = []; object.groundingAttributions = []; object.retrievalQueries = []; + object.groundingChunks = []; + object.groundingSupports = []; } if (message.webSearchQueries && message.webSearchQueries.length) { object.webSearchQueries = []; @@ -288983,6 +290252,16 @@ if (options.oneofs) object._searchEntryPoint = "searchEntryPoint"; } + if (message.groundingChunks && message.groundingChunks.length) { + object.groundingChunks = []; + for (var j = 0; j < message.groundingChunks.length; ++j) + object.groundingChunks[j] = $root.google.cloud.aiplatform.v1beta1.GroundingChunk.toObject(message.groundingChunks[j], options); + } + if (message.groundingSupports && message.groundingSupports.length) { + object.groundingSupports = []; + for (var j = 0; j < message.groundingSupports.length; ++j) + object.groundingSupports[j] = $root.google.cloud.aiplatform.v1beta1.GroundingSupport.toObject(message.groundingSupports[j], options); + } return object; }; @@ -517005,6 +518284,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.PredictionService|streamRawPredict}. + * @memberof google.cloud.aiplatform.v1beta1.PredictionService + * @typedef StreamRawPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls StreamRawPredict. + * @function streamRawPredict + * @memberof google.cloud.aiplatform.v1beta1.PredictionService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest} request StreamRawPredictRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredictCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.streamRawPredict = function streamRawPredict(request, callback) { + return this.rpcCall(streamRawPredict, $root.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "StreamRawPredict" }); + + /** + * Calls StreamRawPredict. + * @function streamRawPredict + * @memberof google.cloud.aiplatform.v1beta1.PredictionService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest} request StreamRawPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.PredictionService|directPredict}. * @memberof google.cloud.aiplatform.v1beta1.PredictionService @@ -518259,6 +519571,238 @@ return RawPredictRequest; })(); + v1beta1.StreamRawPredictRequest = (function() { + + /** + * Properties of a StreamRawPredictRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IStreamRawPredictRequest + * @property {string|null} [endpoint] StreamRawPredictRequest endpoint + * @property {google.api.IHttpBody|null} [httpBody] StreamRawPredictRequest httpBody + */ + + /** + * Constructs a new StreamRawPredictRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a StreamRawPredictRequest. + * @implements IStreamRawPredictRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest=} [properties] Properties to set + */ + function StreamRawPredictRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamRawPredictRequest endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @instance + */ + StreamRawPredictRequest.prototype.endpoint = ""; + + /** + * StreamRawPredictRequest httpBody. + * @member {google.api.IHttpBody|null|undefined} httpBody + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @instance + */ + StreamRawPredictRequest.prototype.httpBody = null; + + /** + * Creates a new StreamRawPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.StreamRawPredictRequest} StreamRawPredictRequest instance + */ + StreamRawPredictRequest.create = function create(properties) { + return new StreamRawPredictRequest(properties); + }; + + /** + * Encodes the specified StreamRawPredictRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamRawPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest} message StreamRawPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamRawPredictRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpoint); + if (message.httpBody != null && Object.hasOwnProperty.call(message, "httpBody")) + $root.google.api.HttpBody.encode(message.httpBody, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamRawPredictRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamRawPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest} message StreamRawPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamRawPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamRawPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @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.StreamRawPredictRequest} StreamRawPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamRawPredictRequest.decode = function decode(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.StreamRawPredictRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.httpBody = $root.google.api.HttpBody.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamRawPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.StreamRawPredictRequest} StreamRawPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamRawPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamRawPredictRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamRawPredictRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.httpBody != null && message.hasOwnProperty("httpBody")) { + var error = $root.google.api.HttpBody.verify(message.httpBody); + if (error) + return "httpBody." + error; + } + return null; + }; + + /** + * Creates a StreamRawPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.StreamRawPredictRequest} StreamRawPredictRequest + */ + StreamRawPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.httpBody != null) { + if (typeof object.httpBody !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.StreamRawPredictRequest.httpBody: object expected"); + message.httpBody = $root.google.api.HttpBody.fromObject(object.httpBody); + } + return message; + }; + + /** + * Creates a plain object from a StreamRawPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.StreamRawPredictRequest} message StreamRawPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamRawPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpoint = ""; + object.httpBody = null; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.httpBody != null && message.hasOwnProperty("httpBody")) + object.httpBody = $root.google.api.HttpBody.toObject(message.httpBody, options); + return object; + }; + + /** + * Converts this StreamRawPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @instance + * @returns {Object.} JSON object + */ + StreamRawPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamRawPredictRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.StreamRawPredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamRawPredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.StreamRawPredictRequest"; + }; + + return StreamRawPredictRequest; + })(); + v1beta1.DirectPredictRequest = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index e3b271b3634..05f5bb4af03 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -2622,7 +2622,8 @@ "OTHER": 5, "BLOCKLIST": 6, "PROHIBITED_CONTENT": 7, - "SPII": 8 + "SPII": 8, + "MALFORMED_FUNCTION_CALL": 9 } } } @@ -10927,6 +10928,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 16 } } }, @@ -15914,19 +15919,13 @@ "responseType": "DirectPredictResponse", "options": { "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict", - "(google.api.http).additional_bindings.body": "*" + "(google.api.http).body": "*" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directPredict", - "body": "*", - "additional_bindings": { - "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directPredict", - "body": "*" - } + "body": "*" } } ] @@ -15936,19 +15935,13 @@ "responseType": "DirectRawPredictResponse", "options": { "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict", - "(google.api.http).additional_bindings.body": "*" + "(google.api.http).body": "*" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:directRawPredict", - "body": "*", - "additional_bindings": { - "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:directRawPredict", - "body": "*" - } + "body": "*" } } ] @@ -15957,49 +15950,13 @@ "requestType": "StreamDirectPredictRequest", "requestStream": true, "responseType": "StreamDirectPredictResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectPredict", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectPredict", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectPredict", - "body": "*", - "additional_bindings": { - "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectPredict", - "body": "*" - } - } - } - ] + "responseStream": true }, "StreamDirectRawPredict": { "requestType": "StreamDirectRawPredictRequest", "requestStream": true, "responseType": "StreamDirectRawPredictResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectRawPredict", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectRawPredict", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{endpoint=projects/*/locations/*/endpoints/*}:streamDirectRawPredict", - "body": "*", - "additional_bindings": { - "post": "/v1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamDirectRawPredict", - "body": "*" - } - } - } - ] + "responseStream": true }, "StreamingPredict": { "requestType": "StreamingPredictRequest", @@ -22347,6 +22304,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "preflightValidations": { + "type": "bool", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -31039,7 +31003,8 @@ "OTHER": 5, "BLOCKLIST": 6, "PROHIBITED_CONTENT": 7, - "SPII": 8 + "SPII": 8, + "MALFORMED_FUNCTION_CALL": 9 } } } @@ -31066,6 +31031,123 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "text": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GroundingChunk": { + "oneofs": { + "chunkType": { + "oneof": [ + "web", + "retrievedContext" + ] + } + }, + "fields": { + "web": { + "type": "Web", + "id": 1 + }, + "retrievedContext": { + "type": "RetrievedContext", + "id": 2 + } + }, + "nested": { + "Web": { + "oneofs": { + "_uri": { + "oneof": [ + "uri" + ] + }, + "_title": { + "oneof": [ + "title" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "RetrievedContext": { + "oneofs": { + "_uri": { + "oneof": [ + "uri" + ] + }, + "_title": { + "oneof": [ + "title" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "GroundingSupport": { + "oneofs": { + "_segment": { + "oneof": [ + "segment" + ] + } + }, + "fields": { + "segment": { + "type": "Segment", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "groundingChunkIndices": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "confidenceScores": { + "rule": "repeated", + "type": "float", + "id": 3 } } }, @@ -31193,6 +31275,19 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "groundingChunks": { + "rule": "repeated", + "type": "GroundingChunk", + "id": 5 + }, + "groundingSupports": { + "rule": "repeated", + "type": "GroundingSupport", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -56566,6 +56661,33 @@ } ] }, + "StreamRawPredict": { + "requestType": "StreamRawPredictRequest", + "responseType": "google.api.HttpBody", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "endpoint,http_body" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:streamRawPredict", + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{endpoint=projects/*/locations/*/publishers/*/models/*}:streamRawPredict", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "endpoint,http_body" + } + ] + }, "DirectPredict": { "requestType": "DirectPredictRequest", "responseType": "DirectPredictResponse", @@ -56849,6 +56971,22 @@ } } }, + "StreamRawPredictRequest": { + "fields": { + "endpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "httpBody": { + "type": "google.api.HttpBody", + "id": 2 + } + } + }, "DirectPredictRequest": { "fields": { "endpoint": { diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 12de5757630..1ed31fa1f92 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -566,6 +566,7 @@ * [Prediction_service.stream_direct_predict](#prediction_service.stream_direct_predict) * [Prediction_service.stream_direct_raw_predict](#prediction_service.stream_direct_raw_predict) * [Prediction_service.stream_generate_content](#prediction_service.stream_generate_content) + * [Prediction_service.stream_raw_predict](#prediction_service.stream_raw_predict) * [Prediction_service.streaming_predict](#prediction_service.streaming_predict) * [Prediction_service.streaming_raw_predict](#prediction_service.streaming_raw_predict) * [Reasoning_engine_execution_service.query_reasoning_engine](#reasoning_engine_execution_service.query_reasoning_engine) @@ -10076,6 +10077,23 @@ __Usage:__ +### Prediction_service.stream_raw_predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_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-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js` + + +----- + + + + ### Prediction_service.streaming_predict View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.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 ed7afdf37ca..f2e8560dc0b 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.23.0", + "version": "3.24.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 d66ee33af13..45e82e0c575 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.23.0", + "version": "3.24.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js new file mode 100644 index 00000000000..07c25c42948 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_raw_predict.js @@ -0,0 +1,69 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(endpoint) { + // [START aiplatform_v1beta1_generated_PredictionService_StreamRawPredict_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + */ + // const endpoint = 'abc123' + /** + * The prediction input. Supports HTTP headers and arbitrary data payload. + */ + // const httpBody = {} + + // Imports the Aiplatform library + const {PredictionServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new PredictionServiceClient(); + + async function callStreamRawPredict() { + // Construct request + const request = { + endpoint, + }; + + // Run request + const stream = await aiplatformClient.streamRawPredict(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callStreamRawPredict(); + // [END aiplatform_v1beta1_generated_PredictionService_StreamRawPredict_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 42f533e2bdf..b3022a69191 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.23.0", + "version": "3.24.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 187524e41f8..02bac7c6b74 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.23.0", + "version": "3.24.0", "language": "TYPESCRIPT", "apis": [ { @@ -11843,6 +11843,50 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_PredictionService_StreamRawPredict_async", + "title": "DatasetService streamRawPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a streaming online prediction with an arbitrary HTTP payload.", + "canonical": true, + "file": "prediction_service.stream_raw_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamRawPredict", + "fullName": "google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredict", + "async": true, + "parameters": [ + { + "name": "endpoint", + "type": "TYPE_STRING" + }, + { + "name": "http_body", + "type": ".google.api.HttpBody" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "StreamRawPredict", + "fullName": "google.cloud.aiplatform.v1beta1.PredictionService.StreamRawPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.aiplatform.v1beta1.PredictionService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_PredictionService_DirectPredict_async", "title": "DatasetService directPredict Sample", diff --git a/packages/google-cloud-aiplatform/samples/package.json b/packages/google-cloud-aiplatform/samples/package.json index 6e5ef210dde..14aa631fd39 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.23.0" + "@google-cloud/aiplatform": "^3.24.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts index da13193ac94..49a9e0e77f4 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts @@ -640,6 +640,15 @@ export class DatasetServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -746,6 +755,15 @@ export class DatasetServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -892,6 +910,18 @@ export class DatasetServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1042,6 +1072,18 @@ export class DatasetServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1189,6 +1231,15 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1295,6 +1346,15 @@ export class DatasetServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1412,6 +1472,15 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1514,6 +1583,15 @@ export class DatasetServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1651,6 +1729,15 @@ export class DatasetServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1766,6 +1853,15 @@ export class DatasetServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts index a8d285376ff..7762c4b5e65 100644 --- a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_client.ts @@ -624,6 +624,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -730,6 +739,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -876,6 +894,18 @@ export class DeploymentResourcePoolServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1026,6 +1056,18 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1173,6 +1215,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1279,6 +1330,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1396,6 +1456,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1498,6 +1567,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1635,6 +1713,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1750,6 +1837,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, 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 1610c79a59c..cfef5a524d5 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts @@ -615,6 +615,15 @@ export class EndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -721,6 +730,15 @@ export class EndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -867,6 +885,18 @@ export class EndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1017,6 +1047,18 @@ export class EndpointServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1164,6 +1206,15 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1270,6 +1321,15 @@ export class EndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1387,6 +1447,15 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1489,6 +1558,15 @@ export class EndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1626,6 +1704,15 @@ export class EndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1741,6 +1828,15 @@ export class EndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_client.ts b/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_client.ts index 35ca7c3f220..1b1ecd4d9cb 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_client.ts @@ -630,6 +630,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -736,6 +745,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -882,6 +900,18 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1032,6 +1062,18 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1179,6 +1221,15 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1285,6 +1336,15 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1402,6 +1462,15 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1504,6 +1573,15 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1641,6 +1719,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1756,6 +1843,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/feature_registry_service_client.ts b/packages/google-cloud-aiplatform/src/v1/feature_registry_service_client.ts index 049e9a22f6d..d59ed73bf4e 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_registry_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/feature_registry_service_client.ts @@ -625,6 +625,15 @@ export class FeatureRegistryServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -731,6 +740,15 @@ export class FeatureRegistryServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -877,6 +895,18 @@ export class FeatureRegistryServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1027,6 +1057,18 @@ export class FeatureRegistryServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1174,6 +1216,15 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1280,6 +1331,15 @@ export class FeatureRegistryServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1397,6 +1457,15 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1499,6 +1568,15 @@ export class FeatureRegistryServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1636,6 +1714,15 @@ export class FeatureRegistryServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1751,6 +1838,15 @@ export class FeatureRegistryServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts index adba9df513f..06eabef7e80 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts @@ -633,6 +633,15 @@ export class FeaturestoreServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -739,6 +748,15 @@ export class FeaturestoreServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -885,6 +903,18 @@ export class FeaturestoreServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1035,6 +1065,18 @@ export class FeaturestoreServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1182,6 +1224,15 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1288,6 +1339,15 @@ export class FeaturestoreServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1405,6 +1465,15 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1507,6 +1576,15 @@ export class FeaturestoreServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1644,6 +1722,15 @@ export class FeaturestoreServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1759,6 +1846,15 @@ export class FeaturestoreServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts index 74ddea82930..0edfa6d1efa 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_client.ts @@ -615,6 +615,15 @@ export class IndexEndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -721,6 +730,15 @@ export class IndexEndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -867,6 +885,18 @@ export class IndexEndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1017,6 +1047,18 @@ export class IndexEndpointServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1164,6 +1206,15 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1270,6 +1321,15 @@ export class IndexEndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1387,6 +1447,15 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1489,6 +1558,15 @@ export class IndexEndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1626,6 +1704,15 @@ export class IndexEndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1741,6 +1828,15 @@ export class IndexEndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts index c60d574d7bb..fc8c9351462 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts @@ -615,6 +615,15 @@ export class IndexServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -721,6 +730,15 @@ export class IndexServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -867,6 +885,18 @@ export class IndexServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1017,6 +1047,18 @@ export class IndexServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1164,6 +1206,15 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1270,6 +1321,15 @@ export class IndexServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1387,6 +1447,15 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1489,6 +1558,15 @@ export class IndexServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1626,6 +1704,15 @@ export class IndexServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1741,6 +1828,15 @@ export class IndexServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts index c75d44b3892..922baa923c4 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts @@ -651,6 +651,15 @@ export class JobServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -757,6 +766,15 @@ export class JobServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -903,6 +921,18 @@ export class JobServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1053,6 +1083,18 @@ export class JobServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1200,6 +1242,15 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1306,6 +1357,15 @@ export class JobServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1423,6 +1483,15 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1525,6 +1594,15 @@ export class JobServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1662,6 +1740,15 @@ export class JobServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1777,6 +1864,15 @@ export class JobServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts index 38c627f1bc5..bbb7e484bc0 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts @@ -638,6 +638,15 @@ export class MetadataServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -744,6 +753,15 @@ export class MetadataServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -890,6 +908,18 @@ export class MetadataServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1040,6 +1070,18 @@ export class MetadataServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1187,6 +1229,15 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1293,6 +1344,15 @@ export class MetadataServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1410,6 +1470,15 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1512,6 +1581,15 @@ export class MetadataServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1649,6 +1727,15 @@ export class MetadataServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1764,6 +1851,15 @@ export class MetadataServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts index b4ac6c35e41..ba56c7f5771 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts @@ -616,6 +616,15 @@ export class MigrationServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -722,6 +731,15 @@ export class MigrationServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -868,6 +886,18 @@ export class MigrationServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1018,6 +1048,18 @@ export class MigrationServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1165,6 +1207,15 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1271,6 +1322,15 @@ export class MigrationServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1388,6 +1448,15 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1490,6 +1559,15 @@ export class MigrationServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1627,6 +1705,15 @@ export class MigrationServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1742,6 +1829,15 @@ export class MigrationServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts index 9e60afce8c2..cf047a9bc3f 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts @@ -630,6 +630,15 @@ export class ModelServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -736,6 +745,15 @@ export class ModelServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -882,6 +900,18 @@ export class ModelServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1032,6 +1062,18 @@ export class ModelServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1179,6 +1221,15 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1285,6 +1336,15 @@ export class ModelServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1402,6 +1462,15 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1504,6 +1573,15 @@ export class ModelServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1641,6 +1719,15 @@ export class ModelServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1756,6 +1843,15 @@ export class ModelServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts b/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts index 3e0a0e4210b..0e2ed190b1a 100644 --- a/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts @@ -620,6 +620,15 @@ export class NotebookServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -726,6 +735,15 @@ export class NotebookServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -872,6 +890,18 @@ export class NotebookServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1022,6 +1052,18 @@ export class NotebookServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1169,6 +1211,15 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1275,6 +1326,15 @@ export class NotebookServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1392,6 +1452,15 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1494,6 +1563,15 @@ export class NotebookServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1631,6 +1709,15 @@ export class NotebookServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1746,6 +1833,15 @@ export class NotebookServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_client.ts b/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_client.ts index 6f62fc745e8..90cfcdf8217 100644 --- a/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_client.ts @@ -616,6 +616,15 @@ export class PersistentResourceServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -722,6 +731,15 @@ export class PersistentResourceServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -868,6 +886,18 @@ export class PersistentResourceServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1018,6 +1048,18 @@ export class PersistentResourceServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1165,6 +1207,15 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1271,6 +1322,15 @@ export class PersistentResourceServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1388,6 +1448,15 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1490,6 +1559,15 @@ export class PersistentResourceServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1627,6 +1705,15 @@ export class PersistentResourceServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1742,6 +1829,15 @@ export class PersistentResourceServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts index 2e7e9faed35..7168176a1b2 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts @@ -625,6 +625,15 @@ export class PipelineServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -731,6 +740,15 @@ export class PipelineServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -877,6 +895,18 @@ export class PipelineServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1027,6 +1057,18 @@ export class PipelineServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1174,6 +1216,15 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1280,6 +1331,15 @@ export class PipelineServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1397,6 +1457,15 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1499,6 +1568,15 @@ export class PipelineServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1636,6 +1714,15 @@ export class PipelineServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1751,6 +1838,15 @@ export class PipelineServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts index d418efad0b6..3adf65835a0 100644 --- a/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts @@ -616,6 +616,15 @@ export class ScheduleServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -722,6 +731,15 @@ export class ScheduleServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -868,6 +886,18 @@ export class ScheduleServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1018,6 +1048,18 @@ export class ScheduleServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1165,6 +1207,15 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1271,6 +1322,15 @@ export class ScheduleServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1388,6 +1448,15 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1490,6 +1559,15 @@ export class ScheduleServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1627,6 +1705,15 @@ export class ScheduleServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1742,6 +1829,15 @@ export class ScheduleServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts index f14945d32f0..4c3852f4152 100644 --- a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_client.ts @@ -621,6 +621,15 @@ export class SpecialistPoolServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -727,6 +736,15 @@ export class SpecialistPoolServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -873,6 +891,18 @@ export class SpecialistPoolServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1023,6 +1053,18 @@ export class SpecialistPoolServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1170,6 +1212,15 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1276,6 +1327,15 @@ export class SpecialistPoolServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1393,6 +1453,15 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1495,6 +1564,15 @@ export class SpecialistPoolServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1632,6 +1710,15 @@ export class SpecialistPoolServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1747,6 +1834,15 @@ export class SpecialistPoolServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts index 6ac2ec71b15..79a8e6a1b04 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts @@ -648,6 +648,15 @@ export class TensorboardServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -754,6 +763,15 @@ export class TensorboardServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -900,6 +918,18 @@ export class TensorboardServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1050,6 +1080,18 @@ export class TensorboardServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1197,6 +1239,15 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1303,6 +1354,15 @@ export class TensorboardServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1420,6 +1480,15 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1522,6 +1591,15 @@ export class TensorboardServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1659,6 +1737,15 @@ export class TensorboardServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1774,6 +1861,15 @@ export class TensorboardServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, 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 7543c5d663d..d2b408f6248 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts @@ -624,6 +624,15 @@ export class VizierServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -730,6 +739,15 @@ export class VizierServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, @@ -876,6 +894,18 @@ export class VizierServiceClient { delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', @@ -1026,6 +1056,18 @@ export class VizierServiceClient { delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1173,6 +1215,15 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, { get: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}', }, @@ -1279,6 +1330,15 @@ export class VizierServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1396,6 +1456,15 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/ui/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1498,6 +1567,15 @@ export class VizierServiceClient { { get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1635,6 +1713,15 @@ export class VizierServiceClient { { post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -1750,6 +1837,15 @@ export class VizierServiceClient { { post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/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 84391f49872..697aa0a3c45 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -3107,6 +3107,11 @@ "generateContent" ] }, + "StreamRawPredict": { + "methods": [ + "streamRawPredict" + ] + }, "StreamDirectPredict": { "methods": [ "streamDirectPredict" diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts index 6bbdece5022..d2a37f02eec 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts @@ -386,6 +386,11 @@ export class PredictionServiceClient { // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this.descriptors.stream = { + streamRawPredict: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries + ), streamDirectPredict: new this._gaxModule.StreamDescriptor( this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, @@ -476,6 +481,7 @@ export class PredictionServiceClient { const predictionServiceStubMethods = [ 'predict', 'rawPredict', + 'streamRawPredict', 'directPredict', 'directRawPredict', 'streamDirectPredict', @@ -1409,6 +1415,42 @@ export class PredictionServiceClient { return this.innerApiCalls.generateContent(request, options, callback); } + /** + * Perform a streaming online prediction with an arbitrary HTTP payload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.endpoint + * Required. The name of the Endpoint requested to serve the prediction. + * Format: + * `projects/{project}/locations/{location}/endpoints/{endpoint}` + * @param {google.api.HttpBody} request.httpBody + * The prediction input. Supports HTTP headers and arbitrary data payload. + * @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 {@link protos.google.api.HttpBody|HttpBody} on 'data' event. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/prediction_service.stream_raw_predict.js + * region_tag:aiplatform_v1beta1_generated_PredictionService_StreamRawPredict_async + */ + streamRawPredict( + request?: protos.google.cloud.aiplatform.v1beta1.IStreamRawPredictRequest, + options?: CallOptions + ): gax.CancellableStream { + 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({ + endpoint: request.endpoint ?? '', + }); + this.initialize(); + return this.innerApiCalls.streamRawPredict(request, options); + } + /** * Perform a streaming online prediction request to a gRPC model server for * Vertex first-party products and frameworks. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client_config.json index c62b152f87c..06551942cc9 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client_config.json @@ -29,6 +29,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "StreamRawPredict": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DirectPredict": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts index 1f1084217a9..3878bd8a01b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts @@ -1244,6 +1244,170 @@ describe('v1beta1.PredictionServiceClient', () => { }); }); + describe('streamRawPredict', () => { + it('invokes streamRawPredict 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.aiplatform.v1beta1.StreamRawPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamRawPredict = + stubServerStreamingCall(expectedResponse); + const stream = client.streamRawPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.api.HttpBody) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamRawPredict without error and gaxServerStreamingRetries enabled', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamRawPredict = + stubServerStreamingCall(expectedResponse); + const stream = client.streamRawPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.api.HttpBody) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamRawPredict 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.aiplatform.v1beta1.StreamRawPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.streamRawPredict = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.streamRawPredict(request); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.api.HttpBody) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamRawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamRawPredict 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.aiplatform.v1beta1.StreamRawPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamRawPredictRequest', + ['endpoint'] + ); + request.endpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamRawPredict(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on('data', (response: protos.google.api.HttpBody) => { + resolve(response); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); + it('should create a client with gaxServerStreamingRetries enabled', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + describe('serverStreamingPredict', () => { it('invokes serverStreamingPredict without error', async () => { const client = diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto index 4756903fbd4..42b798458b1 100644 --- a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; option csharp_namespace = "Google.Cloud.BackupDR.V1"; option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; @@ -248,6 +249,13 @@ message ManagementServer { // Output only. The hostname or ip address of the exposed AGM endpoints, used // by BAs to connect to BA proxy. repeated string ba_proxy_uri = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for listing management servers. diff --git a/packages/google-cloud-backupdr/protos/protos.d.ts b/packages/google-cloud-backupdr/protos/protos.d.ts index bd367ef8bc9..5506c3035be 100644 --- a/packages/google-cloud-backupdr/protos/protos.d.ts +++ b/packages/google-cloud-backupdr/protos/protos.d.ts @@ -599,6 +599,12 @@ export namespace google { /** ManagementServer baProxyUri */ baProxyUri?: (string[]|null); + + /** ManagementServer satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi */ + satisfiesPzi?: (boolean|null); } /** Represents a ManagementServer. */ @@ -652,6 +658,12 @@ export namespace google { /** ManagementServer baProxyUri. */ public baProxyUri: string[]; + /** ManagementServer satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi. */ + public satisfiesPzi: boolean; + /** * Creates a new ManagementServer instance using the specified properties. * @param [properties] Properties to set @@ -8067,6 +8079,879 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|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. */ diff --git a/packages/google-cloud-backupdr/protos/protos.js b/packages/google-cloud-backupdr/protos/protos.js index 0d63d9ab8db..cd28ca533aa 100644 --- a/packages/google-cloud-backupdr/protos/protos.js +++ b/packages/google-cloud-backupdr/protos/protos.js @@ -1194,6 +1194,8 @@ * @property {string|null} [oauth2ClientId] ManagementServer oauth2ClientId * @property {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null} [workforceIdentityBasedOauth2ClientId] ManagementServer workforceIdentityBasedOauth2ClientId * @property {Array.|null} [baProxyUri] ManagementServer baProxyUri + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] ManagementServer satisfiesPzs + * @property {boolean|null} [satisfiesPzi] ManagementServer satisfiesPzi */ /** @@ -1326,6 +1328,22 @@ */ ManagementServer.prototype.baProxyUri = $util.emptyArray; + /** + * ManagementServer satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.satisfiesPzs = null; + + /** + * ManagementServer satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.satisfiesPzi = false; + /** * Creates a new ManagementServer instance using the specified properties. * @function create @@ -1381,6 +1399,10 @@ if (message.baProxyUri != null && message.baProxyUri.length) for (var i = 0; i < message.baProxyUri.length; ++i) writer.uint32(/* id 18, wireType 2 =*/146).string(message.baProxyUri[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.satisfiesPzi); return writer; }; @@ -1494,6 +1516,14 @@ message.baProxyUri.push(reader.string()); break; } + case 19: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 20: { + message.satisfiesPzi = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1612,6 +1642,14 @@ if (!$util.isString(message.baProxyUri[i])) return "baProxyUri: string[] expected"; } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; return null; }; @@ -1740,6 +1778,13 @@ for (var i = 0; i < object.baProxyUri.length; ++i) message.baProxyUri[i] = String(object.baProxyUri[i]); } + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; @@ -1774,6 +1819,8 @@ object.oauth2ClientId = ""; object.workforceIdentityBasedManagementUri = null; object.workforceIdentityBasedOauth2ClientId = null; + object.satisfiesPzs = null; + object.satisfiesPzi = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1813,6 +1860,10 @@ for (var j = 0; j < message.baProxyUri.length; ++j) object.baProxyUri[j] = message.baProxyUri[j]; } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; return object; }; @@ -22165,6 +22216,1870 @@ return Timestamp; })(); + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + 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; })(); diff --git a/packages/google-cloud-backupdr/protos/protos.json b/packages/google-cloud-backupdr/protos/protos.json index 6348b027fe2..c0760fa65b1 100644 --- a/packages/google-cloud-backupdr/protos/protos.json +++ b/packages/google-cloud-backupdr/protos/protos.json @@ -303,6 +303,20 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -2332,6 +2346,78 @@ "id": 2 } } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } } } }, diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts index 2e4d7b8e62f..f793a7c9a33 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts @@ -268,12 +268,6 @@ export class BackupDRClient { selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', post: '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions', body: '*', - additional_bindings: [ - { - post: '/v1/{resource=projects/*/locations/*/backupVaults/*}:testIamPermissions', - body: '*', - }, - ], }, { selector: 'google.longrunning.Operations.CancelOperation', diff --git a/packages/google-cloud-batch/CHANGELOG.md b/packages/google-cloud-batch/CHANGELOG.md index c9a9c4b7d5a..90e561b0d58 100644 --- a/packages/google-cloud-batch/CHANGELOG.md +++ b/packages/google-cloud-batch/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.12.0](https://github.com/googleapis/google-cloud-node/compare/batch-v1.11.0...batch-v1.12.0) (2024-06-26) + + +### Features + +* [batch] add a install_ops_agent field to InstancePolicyOrTemplate for Ops Agent support ([#5500](https://github.com/googleapis/google-cloud-node/issues/5500)) ([f42b77d](https://github.com/googleapis/google-cloud-node/commit/f42b77d76efc700ade152faf7e42b3abf3fb8f44)) + ## [1.11.0](https://github.com/googleapis/google-cloud-node/compare/batch-v1.10.0...batch-v1.11.0) (2024-06-05) diff --git a/packages/google-cloud-batch/package.json b/packages/google-cloud-batch/package.json index 13064312bab..8c591293cfd 100644 --- a/packages/google-cloud-batch/package.json +++ b/packages/google-cloud-batch/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/batch", - "version": "1.11.0", + "version": "1.12.0", "description": "Batch client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto index b7d0729895a..194fb056059 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto @@ -233,11 +233,19 @@ message JobNotification { TASK_STATE_CHANGED = 2; } - // The Pub/Sub topic where notifications like the job state changes - // will be published. The topic must exist in the same project as - // the job and billings will be charged to this project. - // If not specified, no Pub/Sub messages will be sent. - // Topic format: `projects/{project}/topics/{topic}`. + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. string pubsub_topic = 1; // The attribute requirements of messages to be sent to this Pub/Sub topic. @@ -299,7 +307,9 @@ message AllocationPolicy { // Disk type as shown in `gcloud compute disk-types list`. // For example, local SSD uses type "local-ssd". // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. string type = 1; // Disk size in GB. @@ -430,6 +440,10 @@ message AllocationPolicy { // non Container-Optimized Image cases, following // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. bool install_gpu_drivers = 3; + + // Optional. Set this field true if you want Batch to install Ops Agent on + // your behalf. Default is false. + bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; } // A network interface. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/volume.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/volume.proto index 2c7aef1b64c..9bf8126f634 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/volume.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/volume.proto @@ -47,15 +47,19 @@ message Volume { // The mount path for the volume, e.g. /mnt/disks/share. string mount_path = 4; - // For Google Cloud Storage (GCS), mount options are the options supported by - // the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - // For existing persistent disks, mount options provided by the - // mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - // writing are supported. This is due to restrictions of multi-writer mode - // (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // For other attached disks and Network File System (NFS), mount options are - // these supported by the mount command - // (https://man7.org/linux/man-pages/man8/mount.8.html). + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. repeated string mount_options = 5; } diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto index 253adfdc0b2..7d9ea039650 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto @@ -292,11 +292,19 @@ message JobNotification { TASK_STATE_CHANGED = 2; } - // The Pub/Sub topic where notifications like the job state changes - // will be published. The topic must exist in the same project as - // the job and billings will be charged to this project. - // If not specified, no Pub/Sub messages will be sent. - // Topic format: `projects/{project}/topics/{topic}`. + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. string pubsub_topic = 1; // The attribute requirements of messages to be sent to this Pub/Sub topic. @@ -363,7 +371,9 @@ message AllocationPolicy { // Disk type as shown in `gcloud compute disk-types list`. // For example, local SSD uses type "local-ssd". // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. string type = 1; // Disk size in GB. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/volume.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/volume.proto index e6632d3add4..9256ef6faa4 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/volume.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/volume.proto @@ -50,15 +50,19 @@ message Volume { // The mount path for the volume, e.g. /mnt/disks/share. string mount_path = 4; - // For Google Cloud Storage (GCS), mount options are the options supported by - // the gcsfuse tool (https://github.com/GoogleCloudPlatform/gcsfuse). - // For existing persistent disks, mount options provided by the - // mount command (https://man7.org/linux/man-pages/man8/mount.8.html) except - // writing are supported. This is due to restrictions of multi-writer mode - // (https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // For other attached disks and Network File System (NFS), mount options are - // these supported by the mount command - // (https://man7.org/linux/man-pages/man8/mount.8.html). + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. repeated string mount_options = 5; } diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index a9d5d5aeb78..e8d7db6c1c2 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -2850,6 +2850,9 @@ export namespace google { /** InstancePolicyOrTemplate installGpuDrivers */ installGpuDrivers?: (boolean|null); + + /** InstancePolicyOrTemplate installOpsAgent */ + installOpsAgent?: (boolean|null); } /** Represents an InstancePolicyOrTemplate. */ @@ -2870,6 +2873,9 @@ export namespace google { /** InstancePolicyOrTemplate installGpuDrivers. */ public installGpuDrivers: boolean; + /** InstancePolicyOrTemplate installOpsAgent. */ + public installOpsAgent: boolean; + /** InstancePolicyOrTemplate policyTemplate. */ public policyTemplate?: ("policy"|"instanceTemplate"); diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index 79898634b7e..628d69e83ac 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -7400,6 +7400,7 @@ * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers + * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent */ /** @@ -7441,6 +7442,14 @@ */ InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + /** + * InstancePolicyOrTemplate installOpsAgent. + * @member {boolean} installOpsAgent + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installOpsAgent = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -7485,6 +7494,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); return writer; }; @@ -7531,6 +7542,10 @@ message.installGpuDrivers = reader.bool(); break; } + case 4: { + message.installOpsAgent = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -7585,6 +7600,9 @@ if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) if (typeof message.installGpuDrivers !== "boolean") return "installGpuDrivers: boolean expected"; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + if (typeof message.installOpsAgent !== "boolean") + return "installOpsAgent: boolean expected"; return null; }; @@ -7609,6 +7627,8 @@ message.instanceTemplate = String(object.instanceTemplate); if (object.installGpuDrivers != null) message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.installOpsAgent != null) + message.installOpsAgent = Boolean(object.installOpsAgent); return message; }; @@ -7625,8 +7645,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.installGpuDrivers = false; + object.installOpsAgent = false; + } if (message.policy != null && message.hasOwnProperty("policy")) { object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); if (options.oneofs) @@ -7639,6 +7661,8 @@ } if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) object.installGpuDrivers = message.installGpuDrivers; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + object.installOpsAgent = message.installOpsAgent; return object; }; diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index 2618cf84c23..ae2e4a45e59 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -765,6 +765,13 @@ "installGpuDrivers": { "type": "bool", "id": 3 + }, + "installOpsAgent": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json index 59b1c212697..1213e586bc6 100644 --- a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json +++ b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "1.11.0", + "version": "1.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json index 72bb10aaa54..302e9d929d7 100644 --- a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json +++ b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "1.11.0", + "version": "1.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json index 71c3cf14e79..26530127319 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json +++ b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "1.11.0", + "version": "1.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json index e18c1edc1a0..ae34facd071 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "1.11.0", + "version": "1.12.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/package.json b/packages/google-cloud-batch/samples/package.json index 305bd2be413..a9dec072a87 100644 --- a/packages/google-cloud-batch/samples/package.json +++ b/packages/google-cloud-batch/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/batch": "^1.11.0" + "@google-cloud/batch": "^1.12.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_catalog.proto b/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_catalog.proto index 6eafe9da439..5ddcec636fc 100644 --- a/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_catalog.proto +++ b/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_catalog.proto @@ -65,11 +65,11 @@ message Service { }; // The resource name for the service. - // Example: "services/DA34-426B-A397" + // Example: "services/6F81-5844-456A" string name = 1; // The identifier for the service. - // Example: "DA34-426B-A397" + // Example: "6F81-5844-456A" string service_id = 2; // A human readable display name for this service. @@ -80,7 +80,7 @@ message Service { string business_entity_name = 4; } -// Encapsulates a single SKU in Google Cloud Platform +// Encapsulates a single SKU in Google Cloud message Sku { option (google.api.resource) = { type: "cloudbilling.googleapis.com/Sku" @@ -88,11 +88,11 @@ message Sku { }; // The resource name for the SKU. - // Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE" + // Example: "services/6F81-5844-456A/skus/D041-B8A1-6E0B" string name = 1; // The identifier for the SKU. - // Example: "AA95-CD31-42FE" + // Example: "D041-B8A1-6E0B" string sku_id = 2; // A human readable description of the SKU, has a maximum length of 256 @@ -313,7 +313,7 @@ message ListServicesResponse { // Request message for `ListSkus`. message ListSkusRequest { // Required. The name of the service. - // Example: "services/DA34-426B-A397" + // Example: "services/6F81-5844-456A" string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js b/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js index a1b6e6ec252..a11a1743972 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. The name of the service. - * Example: "services/DA34-426B-A397" + * Example: "services/6F81-5844-456A" */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts b/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts index f86d0c3cf09..ebc56a2b4db 100644 --- a/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts +++ b/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts @@ -577,7 +577,7 @@ export class CloudCatalogClient { * The request object that will be sent. * @param {string} request.parent * Required. The name of the service. - * Example: "services/DA34-426B-A397" + * Example: "services/6F81-5844-456A" * @param {google.protobuf.Timestamp} request.startTime * Optional inclusive start time of the time range for which the pricing * versions will be returned. Timestamps in the future are not allowed. @@ -687,7 +687,7 @@ export class CloudCatalogClient { * The request object that will be sent. * @param {string} request.parent * Required. The name of the service. - * Example: "services/DA34-426B-A397" + * Example: "services/6F81-5844-456A" * @param {google.protobuf.Timestamp} request.startTime * Optional inclusive start time of the time range for which the pricing * versions will be returned. Timestamps in the future are not allowed. @@ -753,7 +753,7 @@ export class CloudCatalogClient { * The request object that will be sent. * @param {string} request.parent * Required. The name of the service. - * Example: "services/DA34-426B-A397" + * Example: "services/6F81-5844-456A" * @param {google.protobuf.Timestamp} request.startTime * Optional inclusive start time of the time range for which the pricing * versions will be returned. Timestamps in the future are not allowed. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/core.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/core.proto index 65f76cf558b..a4685e5d854 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/core.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/core.proto @@ -95,9 +95,11 @@ service CloudControlsPartnerCore { option (google.api.method_signature) = "name"; } - // Lists access requests associated with a workload + // Deprecated: Only returns access approval requests directly associated with + // an assured workload folder. rpc ListAccessApprovalRequests(ListAccessApprovalRequestsRequest) returns (ListAccessApprovalRequestsResponse) { + option deprecated = true; option (google.api.http) = { get: "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" }; diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto index 881bbac4d32..d9720f356fd 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto @@ -38,7 +38,7 @@ message AccessApprovalRequest { }; // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}. + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // The time at which approval was requested. @@ -56,7 +56,7 @@ message AccessApprovalRequest { message ListAccessApprovalRequestsRequest { // Required. Parent resource // Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/core.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/core.proto index 348654e4c57..d3fd49f43a8 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/core.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/core.proto @@ -95,9 +95,11 @@ service CloudControlsPartnerCore { option (google.api.method_signature) = "name"; } - // Lists access requests associated with a workload + // Deprecated: Only returns access approval requests directly associated with + // an assured workload folder. rpc ListAccessApprovalRequests(ListAccessApprovalRequestsRequest) returns (ListAccessApprovalRequestsResponse) { + option deprecated = true; option (google.api.http) = { get: "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" }; diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto index f0c6aefd2ae..cf2717b1492 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto @@ -66,7 +66,7 @@ message Workload { } // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. Folder id this workload is associated with @@ -99,7 +99,7 @@ message Workload { message ListWorkloadsRequest { // Required. Parent resource // Format: - // organizations/{organization}/locations/{location}/customers/{customer} + // `organizations/{organization}/locations/{location}/customers/{customer}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -138,7 +138,7 @@ message ListWorkloadsResponse { // Message for getting a customer workload. message GetWorkloadRequest { // Required. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customers.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customers.proto index 21badcd4961..005f8116cf0 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customers.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/customers.proto @@ -39,7 +39,7 @@ message Customer { }; // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer} + // `organizations/{organization}/locations/{location}/customers/{customer}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // The customer organization's display name. E.g. "google.com". @@ -55,7 +55,7 @@ message Customer { // Request to list customers message ListCustomersRequest { // Required. Parent resource - // Format: organizations/{organization}/locations/{location} + // Format: `organizations/{organization}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -94,7 +94,7 @@ message ListCustomersResponse { // Message for getting a customer message GetCustomerRequest { // Required. Format: - // organizations/{organization}/locations/{location}/customers/{customer} + // `organizations/{organization}/locations/{location}/customers/{customer}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto index 93d0f097ee5..d458c6c6e01 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto @@ -35,7 +35,7 @@ message EkmConnections { }; // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // The EKM connections associated with the workload @@ -45,7 +45,7 @@ message EkmConnections { // Request for getting the EKM connections associated with a workload message GetEkmConnectionsRequest { // Required. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto index a31e6d7a036..cf8200b16ad 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto @@ -52,7 +52,7 @@ message PartnerPermissions { } // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // The partner permissions granted for the workload @@ -62,7 +62,7 @@ message PartnerPermissions { // Request for getting the partner permissions granted for a workload message GetPartnerPermissionsRequest { // Required. Name of the resource to get in the format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partners.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partners.proto index 58ddddd0c9f..822370ad58b 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partners.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/partners.proto @@ -37,7 +37,7 @@ message Partner { }; // Identifier. The resource name of the partner. - // Format: organizations/{organization}/locations/{location}/partner + // Format: `organizations/{organization}/locations/{location}/partner` // Example: "organizations/123456/locations/us-central1/partner" string name = 1 [(google.api.field_behavior) = IDENTIFIER]; @@ -67,7 +67,8 @@ message Partner { // Message for getting a Partner message GetPartnerRequest { - // Required. Format: organizations/{organization}/locations/{location}/partner + // Required. Format: + // `organizations/{organization}/locations/{location}/partner` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/violations.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/violations.proto index a4cba5baea4..e159a29c50e 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/violations.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/violations.proto @@ -130,7 +130,7 @@ message Violation { } // Identifier. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. Description for the Violation. @@ -159,9 +159,9 @@ message Violation { // Output only. Immutable. Name of the OrgPolicy which was modified with // non-compliant change and resulted this violation. Format: - // projects/{project_number}/policies/{constraint_name} - // folders/{folder_id}/policies/{constraint_name} - // organizations/{organization_id}/policies/{constraint_name} + // `projects/{project_number}/policies/{constraint_name}` + // `folders/{folder_id}/policies/{constraint_name}` + // `organizations/{organization_id}/policies/{constraint_name}` string non_compliant_org_policy = 8 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.field_behavior) = IMMUTABLE @@ -178,7 +178,7 @@ message Violation { message ListViolationsRequest { // Required. Parent resource // Format - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -223,7 +223,7 @@ message ListViolationsResponse { // Message for getting a Violation message GetViolationRequest { // Required. Format: - // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-cloudcontrolspartner/protos/protos.json b/packages/google-cloud-cloudcontrolspartner/protos/protos.json index d5887bfff31..505f569e9bb 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/protos.json +++ b/packages/google-cloud-cloudcontrolspartner/protos/protos.json @@ -258,10 +258,14 @@ "requestType": "ListAccessApprovalRequestsRequest", "responseType": "ListAccessApprovalRequestsResponse", "options": { + "deprecated": true, "(google.api.http).get": "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests", "(google.api.method_signature)": "parent" }, "parsedOptions": [ + { + "deprecated": true + }, { "(google.api.http)": { "get": "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" @@ -1417,10 +1421,14 @@ "requestType": "ListAccessApprovalRequestsRequest", "responseType": "ListAccessApprovalRequestsResponse", "options": { + "deprecated": true, "(google.api.http).get": "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests", "(google.api.method_signature)": "parent" }, "parsedOptions": [ + { + "deprecated": true + }, { "(google.api.http)": { "get": "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/snippet_metadata_google.cloud.cloudcontrolspartner.v1.json b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/snippet_metadata_google.cloud.cloudcontrolspartner.v1.json index 90092be21c8..aa4f33ec116 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/snippet_metadata_google.cloud.cloudcontrolspartner.v1.json +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/snippet_metadata_google.cloud.cloudcontrolspartner.v1.json @@ -287,7 +287,7 @@ "regionTag": "cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async", "title": "CloudControlsPartnerCore listAccessApprovalRequests Sample", "origin": "API_DEFINITION", - "description": " Lists access requests associated with a workload", + "description": " Deprecated: Only returns access approval requests directly associated with an assured workload folder.", "canonical": true, "file": "cloud_controls_partner_core.list_access_approval_requests.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js index 68641c0e413..f9bdb86507b 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js index 856024c4611..38c19139fb0 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js index ec31384284c..db6983af21b 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Format: organizations/{organization}/locations/{location}/partner + * Required. Format: + * `organizations/{organization}/locations/{location}/partner` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner_permissions.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner_permissions.js index bfb0b61f562..99498275fb4 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner_permissions.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner_permissions.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Name of the resource to get in the format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_workload.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_workload.js index b93efe1ce3e..ee6e94072de 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_workload.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_workload.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js index 2b57447ff8d..5fd09a2450f 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js index 9573103be2b..401bc02447e 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. Parent resource - * Format: organizations/{organization}/locations/{location} + * Format: `organizations/{organization}/locations/{location}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js index fdb037efc3a..deec1a3523d 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js index 7055585dee2..684c13b8435 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` */ // const name = 'abc123' diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js index c99dc8cc12b..9b9e2b50644 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. Parent resource * Format - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/snippet_metadata_google.cloud.cloudcontrolspartner.v1beta.json b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/snippet_metadata_google.cloud.cloudcontrolspartner.v1beta.json index 573e530778c..754579715f3 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/snippet_metadata_google.cloud.cloudcontrolspartner.v1beta.json +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/snippet_metadata_google.cloud.cloudcontrolspartner.v1beta.json @@ -287,7 +287,7 @@ "regionTag": "cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async", "title": "CloudControlsPartnerCore listAccessApprovalRequests Sample", "origin": "API_DEFINITION", - "description": " Lists access requests associated with a workload", + "description": " Deprecated: Only returns access approval requests directly associated with an assured workload folder.", "canonical": true, "file": "cloud_controls_partner_core.list_access_approval_requests.js", "language": "JAVASCRIPT", @@ -350,7 +350,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 54, "type": "FULL" } ], diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_core_client.ts b/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_core_client.ts index 2eaf4c07944..1dd7d86b57f 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_core_client.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_core_client.ts @@ -1321,7 +1321,8 @@ export class CloudControlsPartnerCoreClient { ) as AsyncIterable; } /** - * Lists access requests associated with a workload + * Deprecated: Only returns access approval requests directly associated with + * an assured workload folder. * * @param {Object} request * The request object that will be sent. @@ -1352,6 +1353,7 @@ export class CloudControlsPartnerCoreClient { * 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. + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequests( request?: protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsRequest, @@ -1425,6 +1427,11 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.innerApiCalls.listAccessApprovalRequests( request, options, @@ -1462,6 +1469,7 @@ export class CloudControlsPartnerCoreClient { * 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. + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequestsStream( request?: protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsRequest, @@ -1478,6 +1486,11 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listAccessApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.listAccessApprovalRequests.createStream( this.innerApiCalls.listAccessApprovalRequests as GaxCall, request, @@ -1518,6 +1531,7 @@ export class CloudControlsPartnerCoreClient { * for more details and examples. * @example include:samples/generated/v1/cloud_controls_partner_core.list_access_approval_requests.js * region_tag:cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequestsAsync( request?: protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsRequest, @@ -1534,6 +1548,11 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listAccessApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.listAccessApprovalRequests.asyncIterate( this.innerApiCalls['listAccessApprovalRequests'] as GaxCall, request as {}, diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client.ts b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client.ts index 1286aa234dd..9070afecaec 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client.ts @@ -424,7 +424,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.name * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -521,7 +521,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.name * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -618,7 +618,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.name * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -715,7 +715,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the resource to get in the format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -811,7 +811,8 @@ export class CloudControlsPartnerCoreClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Format: organizations/{organization}/locations/{location}/partner + * Required. Format: + * `organizations/{organization}/locations/{location}/partner` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -910,7 +911,7 @@ export class CloudControlsPartnerCoreClient { * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` * @param {number} request.pageSize * The maximum number of workloads to return. The service may return fewer * than this value. If unspecified, at most 500 workloads will be returned. @@ -1015,7 +1016,7 @@ export class CloudControlsPartnerCoreClient { * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` * @param {number} request.pageSize * The maximum number of workloads to return. The service may return fewer * than this value. If unspecified, at most 500 workloads will be returned. @@ -1068,7 +1069,7 @@ export class CloudControlsPartnerCoreClient { * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer} + * `organizations/{organization}/locations/{location}/customers/{customer}` * @param {number} request.pageSize * The maximum number of workloads to return. The service may return fewer * than this value. If unspecified, at most 500 workloads will be returned. @@ -1119,7 +1120,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.parent * Required. Parent resource - * Format: organizations/{organization}/locations/{location} + * Format: `organizations/{organization}/locations/{location}` * @param {number} request.pageSize * The maximum number of Customers to return. The service may return fewer * than this value. If unspecified, at most 500 Customers will be returned. @@ -1223,7 +1224,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.parent * Required. Parent resource - * Format: organizations/{organization}/locations/{location} + * Format: `organizations/{organization}/locations/{location}` * @param {number} request.pageSize * The maximum number of Customers to return. The service may return fewer * than this value. If unspecified, at most 500 Customers will be returned. @@ -1275,7 +1276,7 @@ export class CloudControlsPartnerCoreClient { * The request object that will be sent. * @param {string} request.parent * Required. Parent resource - * Format: organizations/{organization}/locations/{location} + * Format: `organizations/{organization}/locations/{location}` * @param {number} request.pageSize * The maximum number of Customers to return. The service may return fewer * than this value. If unspecified, at most 500 Customers will be returned. @@ -1320,14 +1321,15 @@ export class CloudControlsPartnerCoreClient { ) as AsyncIterable; } /** - * Lists access requests associated with a workload + * Deprecated: Only returns access approval requests directly associated with + * an assured workload folder. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of access requests to return. The service may * return fewer than this value. If unspecified, at most 500 access requests @@ -1351,6 +1353,7 @@ export class CloudControlsPartnerCoreClient { * 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. + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequests( request?: protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsRequest, @@ -1424,6 +1427,11 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.innerApiCalls.listAccessApprovalRequests( request, options, @@ -1438,7 +1446,7 @@ export class CloudControlsPartnerCoreClient { * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of access requests to return. The service may * return fewer than this value. If unspecified, at most 500 access requests @@ -1461,6 +1469,7 @@ export class CloudControlsPartnerCoreClient { * 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. + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequestsStream( request?: protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsRequest, @@ -1477,6 +1486,11 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listAccessApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.listAccessApprovalRequests.createStream( this.innerApiCalls.listAccessApprovalRequests as GaxCall, request, @@ -1493,7 +1507,7 @@ export class CloudControlsPartnerCoreClient { * @param {string} request.parent * Required. Parent resource * Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of access requests to return. The service may * return fewer than this value. If unspecified, at most 500 access requests @@ -1517,6 +1531,7 @@ export class CloudControlsPartnerCoreClient { * for more details and examples. * @example include:samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js * region_tag:cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async + * @deprecated ListAccessApprovalRequests is deprecated and may be removed in a future version. */ listAccessApprovalRequestsAsync( request?: protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsRequest, @@ -1533,6 +1548,11 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listAccessApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this.warn( + 'DEP$CloudControlsPartnerCore-$ListAccessApprovalRequests', + 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.listAccessApprovalRequests.asyncIterate( this.innerApiCalls['listAccessApprovalRequests'] as GaxCall, request as {}, diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_monitoring_client.ts b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_monitoring_client.ts index 446ea97f028..7b4c423220e 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_monitoring_client.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_monitoring_client.ts @@ -408,7 +408,7 @@ export class CloudControlsPartnerMonitoringClient { * The request object that will be sent. * @param {string} request.name * Required. Format: - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -513,7 +513,7 @@ export class CloudControlsPartnerMonitoringClient { * @param {string} request.parent * Required. Parent resource * Format - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of customers row to return. The service may * return fewer than this value. If unspecified, at most 10 customers will be @@ -622,7 +622,7 @@ export class CloudControlsPartnerMonitoringClient { * @param {string} request.parent * Required. Parent resource * Format - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of customers row to return. The service may * return fewer than this value. If unspecified, at most 10 customers will be @@ -679,7 +679,7 @@ export class CloudControlsPartnerMonitoringClient { * @param {string} request.parent * Required. Parent resource * Format - * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` * @param {number} [request.pageSize] * Optional. The maximum number of customers row to return. The service may * return fewer than this value. If unspecified, at most 10 customers will be diff --git a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1.ts b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1.ts index 61d8c6f0df4..3a44c9e2b1b 100644 --- a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1.ts +++ b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1.ts @@ -1684,6 +1684,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1708,6 +1709,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { client.innerApiCalls.listAccessApprovalRequests = stubSimpleCall(expectedResponse); const [response] = await client.listAccessApprovalRequests(request); + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub @@ -1725,6 +1727,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1766,6 +1769,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ); }); const response = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub @@ -1783,6 +1787,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1802,6 +1807,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { client.listAccessApprovalRequests(request), expectedError ); + assert(stub.calledOnce); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub ).getCall(0).args[0]; @@ -1818,6 +1824,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1861,6 +1868,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { }); }); const responses = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert( ( @@ -1888,6 +1896,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1921,6 +1930,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { }); }); await assert.rejects(promise, expectedError); + assert(stub.calledOnce); assert( ( client.descriptors.page.listAccessApprovalRequests @@ -1947,6 +1957,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -1976,6 +1987,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { for await (const resource of iterable) { responses.push(resource!); } + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( @@ -2002,6 +2014,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest() @@ -2023,6 +2036,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { responses.push(resource!); } }); + assert(stub.calledOnce); assert.deepStrictEqual( ( client.descriptors.page.listAccessApprovalRequests diff --git a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1beta.ts b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1beta.ts index 1db56ff06a1..22d6076dfb5 100644 --- a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1beta.ts +++ b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_core_v1beta.ts @@ -1774,6 +1774,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -1798,6 +1799,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { client.innerApiCalls.listAccessApprovalRequests = stubSimpleCall(expectedResponse); const [response] = await client.listAccessApprovalRequests(request); + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub @@ -1817,6 +1819,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -1858,6 +1861,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ); }); const response = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub @@ -1877,6 +1881,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -1896,6 +1901,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { client.listAccessApprovalRequests(request), expectedError ); + assert(stub.calledOnce); const actualRequest = ( client.innerApiCalls.listAccessApprovalRequests as SinonStub ).getCall(0).args[0]; @@ -1914,6 +1920,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -1957,6 +1964,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { }); }); const responses = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert( ( @@ -1986,6 +1994,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -2019,6 +2028,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { }); }); await assert.rejects(promise, expectedError); + assert(stub.calledOnce); assert( ( client.descriptors.page.listAccessApprovalRequests @@ -2047,6 +2057,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -2076,6 +2087,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { for await (const resource of iterable) { responses.push(resource!); } + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( @@ -2104,6 +2116,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { projectId: 'bogus', } ); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest() @@ -2125,6 +2138,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { responses.push(resource!); } }); + assert(stub.calledOnce); assert.deepStrictEqual( ( client.descriptors.page.listAccessApprovalRequests diff --git a/packages/google-cloud-commerce-consumer-procurement/package.json b/packages/google-cloud-commerce-consumer-procurement/package.json index 81f30190508..8dc807ee2ea 100644 --- a/packages/google-cloud-commerce-consumer-procurement/package.json +++ b/packages/google-cloud-commerce-consumer-procurement/package.json @@ -53,7 +53,7 @@ "@types/sinon": "^17.0.0", "c8": "^9.0.0", "gts": "^5.0.0", - "gapic-tools": "0.4.2", + "gapic-tools": "0.4.3", "jsdoc": "^4.0.0", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto index a5571cc1879..793a560086d 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -212,7 +212,11 @@ service DocumentProcessorService { // Creates a processor from the // [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - // processor will be at `ENABLED` state by default after its creation. + // processor will be at `ENABLED` state by default after its creation. Note + // that this method requires the `documentai.processors.create` permission on + // the project, which is highly privileged. A user or service account with + // this permission can create new processors that can interact with any gcs + // bucket in your project. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/processors" diff --git a/packages/google-cloud-dataplex/CHANGELOG.md b/packages/google-cloud-dataplex/CHANGELOG.md index b829792022e..60eb893ed61 100644 --- a/packages/google-cloud-dataplex/CHANGELOG.md +++ b/packages/google-cloud-dataplex/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.10.0](https://github.com/googleapis/google-cloud-node/compare/dataplex-v3.9.0...dataplex-v3.10.0) (2024-06-21) + + +### Features + +* [dataplex] exposing EntrySource.location field that contains location of a resource in the source system ([#5483](https://github.com/googleapis/google-cloud-node/issues/5483)) ([00ad685](https://github.com/googleapis/google-cloud-node/commit/00ad68517838b0e231cac523dc0cc4adbf20621e)) + ## [3.9.0](https://github.com/googleapis/google-cloud-node/compare/dataplex-v3.8.0...dataplex-v3.9.0) (2024-05-21) diff --git a/packages/google-cloud-dataplex/package.json b/packages/google-cloud-dataplex/package.json index 8b7611077ea..d5fd8db901a 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.9.0", + "version": "3.10.0", "description": "dataplex client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/catalog.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/catalog.proto index 0128dcac6b4..423f67d44b6 100644 --- a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/catalog.proto +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/catalog.proto @@ -713,6 +713,12 @@ message EntrySource { // The update time of the resource in the source system. google.protobuf.Timestamp update_time = 11; + + // Output only. Location of the resource in the source system. Entry will be + // searchable by this location. By default, this should match the location of + // the EntryGroup containing this entry. A different value allows capturing + // source location for data external to GCP. + string location = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Create EntryGroup Request @@ -1248,18 +1254,19 @@ message SearchEntriesResult { // Snippets for the entry, contains HTML-style highlighting for // matched tokens, will be used in UI. message Snippets { + option deprecated = true; + // Entry - Entry dataplex_entry = 1; + Entry dataplex_entry = 1 [deprecated = true]; } // Linked resource name. - string linked_resource = 8; + string linked_resource = 8 [deprecated = true]; - // Entry format of the result. Entry dataplex_entry = 9; // Snippets. - Snippets snippets = 12; + Snippets snippets = 12 [deprecated = true]; } message SearchEntriesResponse { diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/data_quality.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/data_quality.proto index 3987f4d09ba..7b81ef21627 100644 --- a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/data_quality.proto +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/data_quality.proto @@ -223,10 +223,10 @@ message DataQualityRuleResult { // This field is only valid for row-level type rules. string failing_rows_query = 10; - // Output only. The number of rows returned by the sql statement in the - // SqlAssertion rule. + // Output only. The number of rows returned by the SQL statement in a SQL + // assertion rule. // - // This field is only valid for SqlAssertion rules. + // This field is only valid for SQL assertion rules. int64 assertion_row_count = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -370,17 +370,19 @@ message DataQualityRule { string sql_expression = 1 [(google.api.field_behavior) = OPTIONAL]; } - // Queries for rows returned by the provided SQL statement. If any rows are - // are returned, this rule fails. + // A SQL statement that is evaluated to return rows that match an invalid + // state. If any rows are are returned, this rule fails. // - // The SQL statement needs to use BigQuery standard SQL syntax, and must not + // The SQL statement must use BigQuery standard SQL syntax, and must not // contain any semicolons. // - // ${data()} can be used to reference the rows being evaluated, i.e. the table - // after all additional filters (row filters, incremental data filters, - // sampling) are applied. + // You can use the data reference parameter `${data()}` to reference the + // source table with all of its precondition filters applied. Examples of + // precondition filters include row filters, incremental data filters, and + // sampling. For more information, see [Data reference + // parameter](https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter). // - // Example: SELECT * FROM ${data()} WHERE price < 0 + // Example: `SELECT * FROM ${data()} WHERE price < 0` message SqlAssertion { // Optional. The SQL statement. string sql_statement = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -419,7 +421,7 @@ message DataQualityRule { TableConditionExpectation table_condition_expectation = 201; // Aggregate rule which evaluates the number of rows returned for the - // provided statement. + // provided statement. If any rows are returned, this rule fails. SqlAssertion sql_assertion = 202; } diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/datascans.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/datascans.proto index 5232b9511be..b3b6fc90940 100644 --- a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/datascans.proto +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/datascans.proto @@ -126,7 +126,10 @@ service DataScanService { option (google.api.method_signature) = "parent"; } - // Generates recommended DataQualityRule from a data profiling DataScan. + // Generates recommended data quality rules based on the results of a data + // profiling scan. + // + // Use the recommendations to build rules for a data quality scan. rpc GenerateDataQualityRules(GenerateDataQualityRulesRequest) returns (GenerateDataQualityRulesResponse) { option (google.api.http) = { @@ -381,18 +384,21 @@ message ListDataScanJobsResponse { string next_page_token = 2; } -// Generate recommended DataQualityRules request. +// Request details for generating data quality rule recommendations. message GenerateDataQualityRulesRequest { - // Required. The name should be either - // * the name of a datascan with at least one successful completed data - // profiling job, or - // * the name of a successful completed data profiling datascan job. + // Required. The name must be one of the following: + // + // * The name of a data scan with at least one successful, completed data + // profiling job + // * The name of a successful, completed data profiling job (a data scan job + // where the job type is data profiling) string name = 1 [(google.api.field_behavior) = REQUIRED]; } -// Generate recommended DataQualityRules response. +// Response details for data quality rule recommendations. message GenerateDataQualityRulesResponse { - // Generated recommended {@link DataQualityRule}s. + // The data quality rules that Dataplex generates based on the results + // of a data profiling scan. repeated DataQualityRule rule = 1; } diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto index 63919d8cb9c..4c6dc08fb1d 100644 --- a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto @@ -634,40 +634,40 @@ message DataQualityScanRuleResult { // An unspecified rule type. RULE_TYPE_UNSPECIFIED = 0; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#nonnullexpectation. + // See + // [DataQualityRule.NonNullExpectation][google.cloud.dataplex.v1.DataQualityRule.NonNullExpectation]. NON_NULL_EXPECTATION = 1; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#rangeexpectation. + // See + // [DataQualityRule.RangeExpectation][google.cloud.dataplex.v1.DataQualityRule.RangeExpectation]. RANGE_EXPECTATION = 2; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#regexexpectation. + // See + // [DataQualityRule.RegexExpectation][google.cloud.dataplex.v1.DataQualityRule.RegexExpectation]. REGEX_EXPECTATION = 3; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#rowconditionexpectation. + // See + // [DataQualityRule.RowConditionExpectation][google.cloud.dataplex.v1.DataQualityRule.RowConditionExpectation]. ROW_CONDITION_EXPECTATION = 4; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#setexpectation. + // See + // [DataQualityRule.SetExpectation][google.cloud.dataplex.v1.DataQualityRule.SetExpectation]. SET_EXPECTATION = 5; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#statisticrangeexpectation. + // See + // [DataQualityRule.StatisticRangeExpectation][google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation]. STATISTIC_RANGE_EXPECTATION = 6; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#tableconditionexpectation. + // See + // [DataQualityRule.TableConditionExpectation][google.cloud.dataplex.v1.DataQualityRule.TableConditionExpectation]. TABLE_CONDITION_EXPECTATION = 7; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#uniquenessexpectation. + // See + // [DataQualityRule.UniquenessExpectation][google.cloud.dataplex.v1.DataQualityRule.UniquenessExpectation]. UNIQUENESS_EXPECTATION = 8; - // Please see - // https://cloud.google.com/dataplex/docs/reference/rest/v1/DataQualityRule#sqlAssertion. + // See + // [DataQualityRule.SqlAssertion][google.cloud.dataplex.v1.DataQualityRule.SqlAssertion]. SQL_ASSERTION = 9; } @@ -733,7 +733,7 @@ message DataQualityScanRuleResult { // The number of rows with null values in the specified column. int64 null_row_count = 12; - // The number of rows returned by the sql statement in the SqlAssertion rule. - // This field is only valid for SqlAssertion rules. + // The number of rows returned by the SQL statement in a SQL assertion rule. + // This field is only valid for SQL assertion rules. int64 assertion_row_count = 13; } diff --git a/packages/google-cloud-dataplex/protos/protos.d.ts b/packages/google-cloud-dataplex/protos/protos.d.ts index 9b82e4c81a5..1e9cd83c5e8 100644 --- a/packages/google-cloud-dataplex/protos/protos.d.ts +++ b/packages/google-cloud-dataplex/protos/protos.d.ts @@ -6759,6 +6759,9 @@ export namespace google { /** EntrySource updateTime */ updateTime?: (google.protobuf.ITimestamp|null); + + /** EntrySource location */ + location?: (string|null); } /** Represents an EntrySource. */ @@ -6797,6 +6800,9 @@ export namespace google { /** EntrySource updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); + /** EntrySource location. */ + public location: string; + /** * Creates a new EntrySource instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-dataplex/protos/protos.js b/packages/google-cloud-dataplex/protos/protos.js index 6f2c921c635..408ff24a45b 100644 --- a/packages/google-cloud-dataplex/protos/protos.js +++ b/packages/google-cloud-dataplex/protos/protos.js @@ -17360,6 +17360,7 @@ * @property {Array.|null} [ancestors] EntrySource ancestors * @property {google.protobuf.ITimestamp|null} [createTime] EntrySource createTime * @property {google.protobuf.ITimestamp|null} [updateTime] EntrySource updateTime + * @property {string|null} [location] EntrySource location */ /** @@ -17451,6 +17452,14 @@ */ EntrySource.prototype.updateTime = null; + /** + * EntrySource location. + * @member {string} location + * @memberof google.cloud.dataplex.v1.EntrySource + * @instance + */ + EntrySource.prototype.location = ""; + /** * Creates a new EntrySource instance using the specified properties. * @function create @@ -17495,6 +17504,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); 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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); return writer; }; @@ -17586,6 +17597,10 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 12: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -17663,6 +17678,9 @@ if (error) return "updateTime." + error; } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; @@ -17715,6 +17733,8 @@ throw TypeError(".google.cloud.dataplex.v1.EntrySource.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.location != null) + message.location = String(object.location); return message; }; @@ -17743,6 +17763,7 @@ object.description = ""; object.createTime = null; object.updateTime = null; + object.location = ""; } if (message.resource != null && message.hasOwnProperty("resource")) object.resource = message.resource; @@ -17769,6 +17790,8 @@ 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.location != null && message.hasOwnProperty("location")) + object.location = message.location; return object; }; diff --git a/packages/google-cloud-dataplex/protos/protos.json b/packages/google-cloud-dataplex/protos/protos.json index 5ddafd7b3a2..c1f8de200c0 100644 --- a/packages/google-cloud-dataplex/protos/protos.json +++ b/packages/google-cloud-dataplex/protos/protos.json @@ -2500,6 +2500,13 @@ "updateTime": { "type": "google.protobuf.Timestamp", "id": 11 + }, + "location": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -3215,7 +3222,10 @@ "fields": { "linkedResource": { "type": "string", - "id": 8 + "id": 8, + "options": { + "deprecated": true + } }, "dataplexEntry": { "type": "Entry", @@ -3223,15 +3233,24 @@ }, "snippets": { "type": "Snippets", - "id": 12 + "id": 12, + "options": { + "deprecated": true + } } }, "nested": { "Snippets": { + "options": { + "deprecated": true + }, "fields": { "dataplexEntry": { "type": "Entry", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } } } } diff --git a/packages/google-cloud-dataplex/samples/generated/v1/data_scan_service.generate_data_quality_rules.js b/packages/google-cloud-dataplex/samples/generated/v1/data_scan_service.generate_data_quality_rules.js index 120466fa5e6..34f43533abb 100644 --- a/packages/google-cloud-dataplex/samples/generated/v1/data_scan_service.generate_data_quality_rules.js +++ b/packages/google-cloud-dataplex/samples/generated/v1/data_scan_service.generate_data_quality_rules.js @@ -29,10 +29,11 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name should be either - * * the name of a datascan with at least one successful completed data - * profiling job, or - * * the name of a successful completed data profiling datascan job. + * Required. The name must be one of the following: + * * The name of a data scan with at least one successful, completed data + * profiling job + * * The name of a successful, completed data profiling job (a data scan job + * where the job type is data profiling) */ // const name = 'abc123' 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 5141839e0ad..262e77b3666 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.9.0", + "version": "3.10.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 8acbe58d6dd..f80a08db1df 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.9.0", + "version": "3.10.0", "language": "TYPESCRIPT", "apis": [ { @@ -3395,14 +3395,14 @@ "regionTag": "dataplex_v1_generated_DataScanService_GenerateDataQualityRules_async", "title": "CatalogService generateDataQualityRules Sample", "origin": "API_DEFINITION", - "description": " Generates recommended DataQualityRule from a data profiling DataScan.", + "description": " Generates recommended data quality rules based on the results of a data profiling scan. Use the recommendations to build rules for a data quality scan.", "canonical": true, "file": "data_scan_service.generate_data_quality_rules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 56, + "end": 57, "type": "FULL" } ], diff --git a/packages/google-cloud-dataplex/samples/package.json b/packages/google-cloud-dataplex/samples/package.json index 169f2f85cd7..d1b7c318496 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.9.0" + "@google-cloud/dataplex": "^3.10.0" }, "devDependencies": { "c8": "^9.0.0", 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 fb114c7339b..7a29a80d9e4 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 @@ -974,15 +974,20 @@ export class DataScanServiceClient { return this.innerApiCalls.getDataScanJob(request, options, callback); } /** - * Generates recommended DataQualityRule from a data profiling DataScan. + * Generates recommended data quality rules based on the results of a data + * profiling scan. + * + * Use the recommendations to build rules for a data quality scan. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name should be either - * * the name of a datascan with at least one successful completed data - * profiling job, or - * * the name of a successful completed data profiling datascan job. + * Required. The name must be one of the following: + * + * * The name of a data scan with at least one successful, completed data + * profiling job + * * The name of a successful, completed data profiling job (a data scan job + * where the job type is data profiling) * @param {object} [options] * Call options. See {@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-dataproc/CHANGELOG.md b/packages/google-cloud-dataproc/CHANGELOG.md index b60391893de..1fbe7d13e56 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.7.0](https://github.com/googleapis/google-cloud-node/compare/dataproc-v5.6.0...dataproc-v5.7.0) (2024-06-26) + + +### Features + +* [dataproc] add the cohort and auto tuning configuration to the batch's RuntimeConfig ([#5494](https://github.com/googleapis/google-cloud-node/issues/5494)) ([910da3c](https://github.com/googleapis/google-cloud-node/commit/910da3caf3602e360423db51ed171a42bba4f68a)) + ## [5.6.0](https://github.com/googleapis/google-cloud-node/compare/dataproc-v5.5.0...dataproc-v5.6.0) (2024-05-21) diff --git a/packages/google-cloud-dataproc/package.json b/packages/google-cloud-dataproc/package.json index 579d8834fb1..2e4cbf32120 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.6.0", + "version": "5.7.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto index 06596ab1c44..01b9d6482bf 100644 --- a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto +++ b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto @@ -50,6 +50,14 @@ message RuntimeConfig { // Optional. Dependency repository configuration. RepositoryConfig repository_config = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Autotuning configuration of the workload. + AutotuningConfig autotuning_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cohort identifier. Identifies families of the workloads having + // the same shape, e.g. daily ETL jobs. + string cohort = 7 [(google.api.field_behavior) = OPTIONAL]; } // Environment configuration for a workload. @@ -464,6 +472,28 @@ message GkeNodePoolConfig { [(google.api.field_behavior) = OPTIONAL]; } +// Autotuning configuration of the workload. +message AutotuningConfig { + // Scenario represents a specific goal that autotuning will attempt to achieve + // by modifying workloads. + enum Scenario { + // Default value. + SCENARIO_UNSPECIFIED = 0; + + // Scaling recommendations such as initialExecutors. + SCALING = 2; + + // Adding hints for potential relation broadcasts. + BROADCAST_HASH_JOIN = 3; + + // Memory management for workloads. + MEMORY = 4; + } + + // Optional. Scenarios for which tunings are applied. + repeated Scenario scenarios = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // Configuration for dependency repositories message RepositoryConfig { // Optional. Configuration for PyPi repository. diff --git a/packages/google-cloud-dataproc/protos/protos.d.ts b/packages/google-cloud-dataproc/protos/protos.d.ts index 2d24b9fd8a1..b9ccc2ee3f0 100644 --- a/packages/google-cloud-dataproc/protos/protos.d.ts +++ b/packages/google-cloud-dataproc/protos/protos.d.ts @@ -2682,6 +2682,12 @@ export namespace google { /** RuntimeConfig repositoryConfig */ repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); + + /** RuntimeConfig autotuningConfig */ + autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); + + /** RuntimeConfig cohort */ + cohort?: (string|null); } /** Represents a RuntimeConfig. */ @@ -2705,6 +2711,12 @@ export namespace google { /** RuntimeConfig repositoryConfig. */ public repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); + /** RuntimeConfig autotuningConfig. */ + public autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); + + /** RuntimeConfig cohort. */ + public cohort: string; + /** * Creates a new RuntimeConfig instance using the specified properties. * @param [properties] Properties to set @@ -4493,6 +4505,114 @@ export namespace google { } } + /** Properties of an AutotuningConfig. */ + interface IAutotuningConfig { + + /** AutotuningConfig scenarios */ + scenarios?: (google.cloud.dataproc.v1.AutotuningConfig.Scenario[]|null); + } + + /** Represents an AutotuningConfig. */ + class AutotuningConfig implements IAutotuningConfig { + + /** + * Constructs a new AutotuningConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAutotuningConfig); + + /** AutotuningConfig scenarios. */ + public scenarios: google.cloud.dataproc.v1.AutotuningConfig.Scenario[]; + + /** + * Creates a new AutotuningConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutotuningConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAutotuningConfig): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @param message AutotuningConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @param message AutotuningConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Verifies an AutotuningConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutotuningConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. + * @param message AutotuningConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AutotuningConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutotuningConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutotuningConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutotuningConfig { + + /** Scenario enum. */ + enum Scenario { + SCENARIO_UNSPECIFIED = 0, + SCALING = 2, + BROADCAST_HASH_JOIN = 3, + MEMORY = 4 + } + } + /** Properties of a RepositoryConfig. */ interface IRepositoryConfig { diff --git a/packages/google-cloud-dataproc/protos/protos.js b/packages/google-cloud-dataproc/protos/protos.js index 483217fcdd9..486f0cd3007 100644 --- a/packages/google-cloud-dataproc/protos/protos.js +++ b/packages/google-cloud-dataproc/protos/protos.js @@ -6727,6 +6727,8 @@ * @property {string|null} [containerImage] RuntimeConfig containerImage * @property {Object.|null} [properties] RuntimeConfig properties * @property {google.cloud.dataproc.v1.IRepositoryConfig|null} [repositoryConfig] RuntimeConfig repositoryConfig + * @property {google.cloud.dataproc.v1.IAutotuningConfig|null} [autotuningConfig] RuntimeConfig autotuningConfig + * @property {string|null} [cohort] RuntimeConfig cohort */ /** @@ -6777,6 +6779,22 @@ */ RuntimeConfig.prototype.repositoryConfig = null; + /** + * RuntimeConfig autotuningConfig. + * @member {google.cloud.dataproc.v1.IAutotuningConfig|null|undefined} autotuningConfig + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.autotuningConfig = null; + + /** + * RuntimeConfig cohort. + * @member {string} cohort + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.cohort = ""; + /** * Creates a new RuntimeConfig instance using the specified properties. * @function create @@ -6810,6 +6828,10 @@ 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.properties[keys[i]]).ldelim(); if (message.repositoryConfig != null && Object.hasOwnProperty.call(message, "repositoryConfig")) $root.google.cloud.dataproc.v1.RepositoryConfig.encode(message.repositoryConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.autotuningConfig != null && Object.hasOwnProperty.call(message, "autotuningConfig")) + $root.google.cloud.dataproc.v1.AutotuningConfig.encode(message.autotuningConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cohort != null && Object.hasOwnProperty.call(message, "cohort")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cohort); return writer; }; @@ -6879,6 +6901,14 @@ message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.decode(reader, reader.uint32()); break; } + case 6: { + message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cohort = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6933,6 +6963,14 @@ if (error) return "repositoryConfig." + error; } + if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) { + var error = $root.google.cloud.dataproc.v1.AutotuningConfig.verify(message.autotuningConfig); + if (error) + return "autotuningConfig." + error; + } + if (message.cohort != null && message.hasOwnProperty("cohort")) + if (!$util.isString(message.cohort)) + return "cohort: string expected"; return null; }; @@ -6964,6 +7002,13 @@ throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.repositoryConfig: object expected"); message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.fromObject(object.repositoryConfig); } + if (object.autotuningConfig != null) { + if (typeof object.autotuningConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.autotuningConfig: object expected"); + message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.fromObject(object.autotuningConfig); + } + if (object.cohort != null) + message.cohort = String(object.cohort); return message; }; @@ -6986,6 +7031,8 @@ object.version = ""; object.containerImage = ""; object.repositoryConfig = null; + object.autotuningConfig = null; + object.cohort = ""; } if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; @@ -6999,6 +7046,10 @@ } if (message.repositoryConfig != null && message.hasOwnProperty("repositoryConfig")) object.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.toObject(message.repositoryConfig, options); + if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) + object.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.toObject(message.autotuningConfig, options); + if (message.cohort != null && message.hasOwnProperty("cohort")) + object.cohort = message.cohort; return object; }; @@ -11484,6 +11535,280 @@ return GkeNodePoolConfig; })(); + v1.AutotuningConfig = (function() { + + /** + * Properties of an AutotuningConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAutotuningConfig + * @property {Array.|null} [scenarios] AutotuningConfig scenarios + */ + + /** + * Constructs a new AutotuningConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AutotuningConfig. + * @implements IAutotuningConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set + */ + function AutotuningConfig(properties) { + this.scenarios = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutotuningConfig scenarios. + * @member {Array.} scenarios + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @instance + */ + AutotuningConfig.prototype.scenarios = $util.emptyArray; + + /** + * Creates a new AutotuningConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig instance + */ + AutotuningConfig.create = function create(properties) { + return new AutotuningConfig(properties); + }; + + /** + * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutotuningConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scenarios != null && message.scenarios.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.scenarios.length; ++i) + writer.int32(message.scenarios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutotuningConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutotuningConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.scenarios && message.scenarios.length)) + message.scenarios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.scenarios.push(reader.int32()); + } else + message.scenarios.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutotuningConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutotuningConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutotuningConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scenarios != null && message.hasOwnProperty("scenarios")) { + if (!Array.isArray(message.scenarios)) + return "scenarios: array expected"; + for (var i = 0; i < message.scenarios.length; ++i) + switch (message.scenarios[i]) { + default: + return "scenarios: enum value[] expected"; + case 0: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + */ + AutotuningConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AutotuningConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); + if (object.scenarios) { + if (!Array.isArray(object.scenarios)) + throw TypeError(".google.cloud.dataproc.v1.AutotuningConfig.scenarios: array expected"); + message.scenarios = []; + for (var i = 0; i < object.scenarios.length; ++i) + switch (object.scenarios[i]) { + default: + if (typeof object.scenarios[i] === "number") { + message.scenarios[i] = object.scenarios[i]; + break; + } + case "SCENARIO_UNSPECIFIED": + case 0: + message.scenarios[i] = 0; + break; + case "SCALING": + case 2: + message.scenarios[i] = 2; + break; + case "BROADCAST_HASH_JOIN": + case 3: + message.scenarios[i] = 3; + break; + case "MEMORY": + case 4: + message.scenarios[i] = 4; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.AutotuningConfig} message AutotuningConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutotuningConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scenarios = []; + if (message.scenarios && message.scenarios.length) { + object.scenarios = []; + for (var j = 0; j < message.scenarios.length; ++j) + object.scenarios[j] = options.enums === String ? $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] === undefined ? message.scenarios[j] : $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] : message.scenarios[j]; + } + return object; + }; + + /** + * Converts this AutotuningConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @instance + * @returns {Object.} JSON object + */ + AutotuningConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutotuningConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutotuningConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AutotuningConfig"; + }; + + /** + * Scenario enum. + * @name google.cloud.dataproc.v1.AutotuningConfig.Scenario + * @enum {number} + * @property {number} SCENARIO_UNSPECIFIED=0 SCENARIO_UNSPECIFIED value + * @property {number} SCALING=2 SCALING value + * @property {number} BROADCAST_HASH_JOIN=3 BROADCAST_HASH_JOIN value + * @property {number} MEMORY=4 MEMORY value + */ + AutotuningConfig.Scenario = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCENARIO_UNSPECIFIED"] = 0; + values[valuesById[2] = "SCALING"] = 2; + values[valuesById[3] = "BROADCAST_HASH_JOIN"] = 3; + values[valuesById[4] = "MEMORY"] = 4; + return values; + })(); + + return AutotuningConfig; + })(); + v1.RepositoryConfig = (function() { /** diff --git a/packages/google-cloud-dataproc/protos/protos.json b/packages/google-cloud-dataproc/protos/protos.json index ab4aa75d719..f1a650d90c8 100644 --- a/packages/google-cloud-dataproc/protos/protos.json +++ b/packages/google-cloud-dataproc/protos/protos.json @@ -963,6 +963,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "autotuningConfig": { + "type": "AutotuningConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cohort": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1421,6 +1435,28 @@ } } }, + "AutotuningConfig": { + "fields": { + "scenarios": { + "rule": "repeated", + "type": "Scenario", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Scenario": { + "values": { + "SCENARIO_UNSPECIFIED": 0, + "SCALING": 2, + "BROADCAST_HASH_JOIN": 3, + "MEMORY": 4 + } + } + } + }, "RepositoryConfig": { "fields": { "pypiRepositoryConfig": { 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 db81f7b7e9a..11dd1dc18d1 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.6.0", + "version": "5.7.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 d3a7a529792..e51c5a0603a 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.6.0", + "version": "5.7.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataproc/samples/package.json b/packages/google-cloud-dataproc/samples/package.json index 579c93d0c1e..ea95ce3df45 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.6.0", + "@google-cloud/dataproc": "^5.7.0", "@google-cloud/storage": "^7.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto index d38b16075c6..18806c4109e 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto @@ -77,6 +77,12 @@ message AdvancedSettings { // The digit that terminates a DTMF digit sequence. string finish_digit = 3; + + // Interdigit timeout setting for matching dtmf input to regex. + google.protobuf.Duration interdigit_timeout_duration = 6; + + // Endpoint timeout setting for matching dtmf input to regex. + google.protobuf.Duration endpointing_timeout_duration = 7; } // Define behaviors on logging. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto index a8e7a1dc1d2..55f8c350a28 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto @@ -314,30 +314,29 @@ message Agent { // Speech recognition related settings. SpeechToTextSettings speech_to_text_settings = 13; - // Immutable. Name of the start flow in this agent. A start flow will be - // automatically created when the agent is created, and can only be deleted by - // deleting the agent. Format: `projects//locations//agents//flows/`. - string start_flow = 16 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } - ]; - - // Optional. Name of the start playbook in this agent. A start playbook will - // be automatically created when the agent is created, and can only be deleted - // by deleting the agent. - // Format: `projects//locations//agents//playbooks/`. Currently only the - // default playbook with id - // "00000000-0000-0000-0000-000000000000" is allowed. - // - // Only one of `start_flow` or `start_playbook` should be set, but not both. - string start_playbook = 39 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { + // The resource to start the conversations with for the agent. + oneof session_entry_resource { + // Name of the start flow in this agent. A start flow will be automatically + // created when the agent is created, and can only be deleted by deleting + // the agent. + // Format: `projects//locations//agents//flows/`. Currently only the default start + // flow with id "00000000-0000-0000-0000-000000000000" is allowed. + string start_flow = 16 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Flow" + }]; + + // Name of the start playbook in this agent. A start playbook will be + // automatically created when the agent is created, and can only be deleted + // by deleting the agent. + // Format: `projects//locations//agents//playbooks/`. Currently only the + // default playbook with id + // "00000000-0000-0000-0000-000000000000" is allowed. + string start_playbook = 39 [(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Playbook" - } - ]; + }]; + } // Name of the // [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto index aa37939ac20..b36539e4417 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/example.proto @@ -243,8 +243,8 @@ message PlaybookInput { string preceding_conversation_summary = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of input parameters for the invocation. - repeated ActionParameter parameters = 2 + // Optional. A list of input parameters for the action. + google.protobuf.Struct action_parameters = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -253,8 +253,8 @@ message PlaybookOutput { // Optional. Summary string of the execution result of the child playbook. string execution_summary = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A list of output parameters for the invocation. - repeated ActionParameter parameters = 3 + // Optional. A Struct object of output parameters for the action. + google.protobuf.Struct action_parameters = 4 [(google.api.field_behavior) = OPTIONAL]; } @@ -307,20 +307,13 @@ message ToolUse { // Optional. Name of the action to be called during the tool use. string action = 2 [(google.api.field_behavior) = OPTIONAL]; - // A list of input parameters for the action. - repeated ActionParameter input_parameters = 3; - - // A list of output parameters generated by the action. - repeated ActionParameter output_parameters = 4; -} - -// Parameter associated with action. -message ActionParameter { - // Required. Name of the parameter. - string name = 1 [(google.api.field_behavior) = REQUIRED]; + // Optional. A list of input parameters for the action. + google.protobuf.Struct input_action_parameters = 5 + [(google.api.field_behavior) = OPTIONAL]; - // Required. Value of the parameter. - google.protobuf.Value value = 2 [(google.api.field_behavior) = REQUIRED]; + // Optional. A list of output parameters generated by the action. + google.protobuf.Struct output_action_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; } // Stores metadata of the invocation of a child playbook. @@ -357,11 +350,13 @@ message FlowInvocation { (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" } ]; - // A list of input parameters for the flow invocation. - repeated ActionParameter input_parameters = 2; + // Optional. A list of input parameters for the flow. + google.protobuf.Struct input_action_parameters = 5 + [(google.api.field_behavior) = OPTIONAL]; - // A list of output parameters generated by the flow invocation. - repeated ActionParameter output_parameters = 3; + // Optional. A list of output parameters generated by the flow invocation. + google.protobuf.Struct output_action_parameters = 6 + [(google.api.field_behavior) = OPTIONAL]; // Required. Flow invocation's output state. OutputState flow_state = 4 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto index 22951cb9e54..8fa20b53474 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/playbook.proto @@ -235,6 +235,13 @@ message Playbook { repeated Step steps = 2; } + // Message of the Instruction of the playbook. + message Instruction { + // Ordered list of step by step execution instructions to accomplish + // target goal. + repeated Step steps = 2; + } + // The unique identifier of the playbook. // Format: `projects//locations//agents//playbooks/`. @@ -255,9 +262,8 @@ message Playbook { repeated google.cloud.dialogflow.cx.v3beta1.ParameterDefinition output_parameter_definitions = 6 [(google.api.field_behavior) = OPTIONAL]; - // Ordered list of step by step execution instructions to accomplish - // target goal. - repeated Step steps = 4; + // Instruction to accomplish target goal. + Instruction instruction = 17; // Output only. Estimated number of tokes current playbook takes when sent to // the LLM. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto index 32d75c348a8..5410b972d30 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.dialogflow.cx.v3beta1; import "google/api/field_behavior.proto"; +import "google/cloud/dialogflow/cx/v3beta1/tool_call.proto"; import "google/protobuf/struct.proto"; option cc_enable_arenas = true; @@ -235,6 +236,10 @@ message ResponseMessage { // Represents info card for knowledge answers, to be better rendered in // Dialogflow Messenger. KnowledgeInfoCard knowledge_info_card = 20; + + // Returns the definition of a tool call that should be executed by the + // client. + google.cloud.dialogflow.cx.v3beta1.ToolCall tool_call = 22; } // The channel which the response is associated with. Clients can specify the diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto index 4d7de79b88c..2a2b4f3921c 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto @@ -276,6 +276,10 @@ message SecuritySettings { // File format for exported audio file. Currently only in telephony // recordings. AudioFormat audio_format = 4; + + // Whether to store TTS audio. By default, TTS audio from the virtual agent + // is not exported. + bool store_tts_audio = 6; } // Settings for exporting conversations to diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto index 828e4cf65c7..ec2f13709f0 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -1141,6 +1141,10 @@ message Match { // The query directly triggered an event. EVENT = 6; + + // The query was handled by a + // [`Playbook`][google.cloud.dialogflow.cx.v3beta1.Playbook]. + PLAYBOOK = 9; } // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto index b6b86f031c8..0f16ab48377 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool.proto @@ -455,12 +455,6 @@ message Tool { // Required. High level description of the Tool and its usage. string description = 3 [(google.api.field_behavior) = REQUIRED]; - // The list of derived action names for the tool. - repeated string actions = 6 [deprecated = true]; - - // The list of derived type schemas for the tool. - repeated string schemas = 7 [deprecated = true]; - // Specification of the Tool. oneof specification { // OpenAPI specification of the Tool. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto index 6779f2bdf30..7d88c269ce2 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/tool_call.proto @@ -31,6 +31,22 @@ option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; option objc_class_prefix = "DF"; option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; +// Represents a call of a specific tool's action with the specified inputs. +message ToolCall { + // The [tool][Tool] associated with this call. + // Format: `projects//locations//agents//tools/`. + string tool = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" } + ]; + // The name of the tool's action associated with this call. + string action = 2 [(google.api.field_behavior) = REQUIRED]; + // The action's input parameters. + google.protobuf.Struct input_parameters = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + // The result of calling a tool's action that has been executed by the client. message ToolCallResult { // The [tool][Tool] associated with this call. diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts index e951cde9e9e..c0bb489ec30 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow-cx/protos/protos.d.ts @@ -36840,6 +36840,12 @@ export namespace google { /** DtmfSettings finishDigit */ finishDigit?: (string|null); + + /** DtmfSettings interdigitTimeoutDuration */ + interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration */ + endpointingTimeoutDuration?: (google.protobuf.IDuration|null); } /** Represents a DtmfSettings. */ @@ -36860,6 +36866,12 @@ export namespace google { /** DtmfSettings finishDigit. */ public finishDigit: string; + /** DtmfSettings interdigitTimeoutDuration. */ + public interdigitTimeoutDuration?: (google.protobuf.IDuration|null); + + /** DtmfSettings endpointingTimeoutDuration. */ + public endpointingTimeoutDuration?: (google.protobuf.IDuration|null); + /** * Creates a new DtmfSettings instance using the specified properties. * @param [properties] Properties to set @@ -37592,10 +37604,10 @@ export namespace google { public speechToTextSettings?: (google.cloud.dialogflow.cx.v3beta1.ISpeechToTextSettings|null); /** Agent startFlow. */ - public startFlow: string; + public startFlow?: (string|null); /** Agent startPlaybook. */ - public startPlaybook: string; + public startPlaybook?: (string|null); /** Agent securitySettings. */ public securitySettings: string; @@ -37630,6 +37642,9 @@ export namespace google { /** Agent personalizationSettings. */ public personalizationSettings?: (google.cloud.dialogflow.cx.v3beta1.Agent.IPersonalizationSettings|null); + /** Agent sessionEntryResource. */ + public sessionEntryResource?: ("startFlow"|"startPlaybook"); + /** Agent _genAppBuilderSettings. */ public _genAppBuilderSettings?: "genAppBuilderSettings"; @@ -46265,6 +46280,9 @@ export namespace google { /** ResponseMessage knowledgeInfoCard */ knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null); + /** ResponseMessage toolCall */ + toolCall?: (google.cloud.dialogflow.cx.v3beta1.IToolCall|null); + /** ResponseMessage channel */ channel?: (string|null); } @@ -46308,11 +46326,14 @@ export namespace google { /** ResponseMessage knowledgeInfoCard. */ public knowledgeInfoCard?: (google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null); + /** ResponseMessage toolCall. */ + public toolCall?: (google.cloud.dialogflow.cx.v3beta1.IToolCall|null); + /** ResponseMessage channel. */ public channel: string; /** ResponseMessage message. */ - public message?: ("text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"); + public message?: ("text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"); /** * Creates a new ResponseMessage instance using the specified properties. @@ -47401,6 +47422,333 @@ export namespace google { } } + /** Properties of a ToolCall. */ + interface IToolCall { + + /** ToolCall tool */ + tool?: (string|null); + + /** ToolCall action */ + action?: (string|null); + + /** ToolCall inputParameters */ + inputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCall. */ + class ToolCall implements IToolCall { + + /** + * Constructs a new ToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCall); + + /** ToolCall tool. */ + public tool: string; + + /** ToolCall action. */ + public action: string; + + /** ToolCall inputParameters. */ + public inputParameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new ToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCall instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCall): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @param message ToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Verifies a ToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCall; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @param message ToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolCallResult. */ + interface IToolCallResult { + + /** ToolCallResult tool */ + tool?: (string|null); + + /** ToolCallResult action */ + action?: (string|null); + + /** ToolCallResult error */ + error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters */ + outputParameters?: (google.protobuf.IStruct|null); + } + + /** Represents a ToolCallResult. */ + class ToolCallResult implements IToolCallResult { + + /** + * Constructs a new ToolCallResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult); + + /** ToolCallResult tool. */ + public tool: string; + + /** ToolCallResult action. */ + public action: string; + + /** ToolCallResult error. */ + public error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); + + /** ToolCallResult outputParameters. */ + public outputParameters?: (google.protobuf.IStruct|null); + + /** ToolCallResult result. */ + public result?: ("error"|"outputParameters"); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolCallResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @param message ToolCallResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Verifies a ToolCallResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolCallResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @param message ToolCallResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolCallResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolCallResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolCallResult { + + /** Properties of an Error. */ + interface IError { + + /** Error message */ + message?: (string|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError); + + /** Error message. */ + public message: string; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Verifies an Error message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Error + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a ValidationMessage. */ interface IValidationMessage { @@ -62684,7 +63032,8 @@ export namespace google { PARAMETER_FILLING = 3, NO_MATCH = 4, NO_INPUT = 5, - EVENT = 6 + EVENT = 6, + PLAYBOOK = 9 } } @@ -64170,8 +64519,8 @@ export namespace google { /** PlaybookInput precedingConversationSummary */ precedingConversationSummary?: (string|null); - /** PlaybookInput parameters */ - parameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** PlaybookInput actionParameters */ + actionParameters?: (google.protobuf.IStruct|null); } /** Represents a PlaybookInput. */ @@ -64186,8 +64535,8 @@ export namespace google { /** PlaybookInput precedingConversationSummary. */ public precedingConversationSummary: string; - /** PlaybookInput parameters. */ - public parameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** PlaybookInput actionParameters. */ + public actionParameters?: (google.protobuf.IStruct|null); /** * Creates a new PlaybookInput instance using the specified properties. @@ -64273,8 +64622,8 @@ export namespace google { /** PlaybookOutput executionSummary */ executionSummary?: (string|null); - /** PlaybookOutput parameters */ - parameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** PlaybookOutput actionParameters */ + actionParameters?: (google.protobuf.IStruct|null); } /** Represents a PlaybookOutput. */ @@ -64289,8 +64638,8 @@ export namespace google { /** PlaybookOutput executionSummary. */ public executionSummary: string; - /** PlaybookOutput parameters. */ - public parameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** PlaybookOutput actionParameters. */ + public actionParameters?: (google.protobuf.IStruct|null); /** * Creates a new PlaybookOutput instance using the specified properties. @@ -64697,11 +65046,11 @@ export namespace google { /** ToolUse action */ action?: (string|null); - /** ToolUse inputParameters */ - inputParameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** ToolUse inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); - /** ToolUse outputParameters */ - outputParameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** ToolUse outputActionParameters */ + outputActionParameters?: (google.protobuf.IStruct|null); } /** Represents a ToolUse. */ @@ -64719,11 +65068,11 @@ export namespace google { /** ToolUse action. */ public action: string; - /** ToolUse inputParameters. */ - public inputParameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** ToolUse inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); - /** ToolUse outputParameters. */ - public outputParameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** ToolUse outputActionParameters. */ + public outputActionParameters?: (google.protobuf.IStruct|null); /** * Creates a new ToolUse instance using the specified properties. @@ -64803,109 +65152,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ActionParameter. */ - interface IActionParameter { - - /** ActionParameter name */ - name?: (string|null); - - /** ActionParameter value */ - value?: (google.protobuf.IValue|null); - } - - /** Represents an ActionParameter. */ - class ActionParameter implements IActionParameter { - - /** - * Constructs a new ActionParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IActionParameter); - - /** ActionParameter name. */ - public name: string; - - /** ActionParameter value. */ - public value?: (google.protobuf.IValue|null); - - /** - * Creates a new ActionParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionParameter instance - */ - public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IActionParameter): google.cloud.dialogflow.cx.v3beta1.ActionParameter; - - /** - * Encodes the specified ActionParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify|verify} messages. - * @param message ActionParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.cx.v3beta1.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify|verify} messages. - * @param message ActionParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ActionParameter; - - /** - * Decodes an ActionParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ActionParameter; - - /** - * Verifies an ActionParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionParameter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ActionParameter; - - /** - * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. - * @param message ActionParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ActionParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a PlaybookInvocation. */ interface IPlaybookInvocation { @@ -65027,11 +65273,11 @@ export namespace google { /** FlowInvocation flow */ flow?: (string|null); - /** FlowInvocation inputParameters */ - inputParameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** FlowInvocation inputActionParameters */ + inputActionParameters?: (google.protobuf.IStruct|null); - /** FlowInvocation outputParameters */ - outputParameters?: (google.cloud.dialogflow.cx.v3beta1.IActionParameter[]|null); + /** FlowInvocation outputActionParameters */ + outputActionParameters?: (google.protobuf.IStruct|null); /** FlowInvocation flowState */ flowState?: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState|null); @@ -65049,11 +65295,11 @@ export namespace google { /** FlowInvocation flow. */ public flow: string; - /** FlowInvocation inputParameters. */ - public inputParameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** FlowInvocation inputActionParameters. */ + public inputActionParameters?: (google.protobuf.IStruct|null); - /** FlowInvocation outputParameters. */ - public outputParameters: google.cloud.dialogflow.cx.v3beta1.IActionParameter[]; + /** FlowInvocation outputActionParameters. */ + public outputActionParameters?: (google.protobuf.IStruct|null); /** FlowInvocation flowState. */ public flowState: (google.cloud.dialogflow.cx.v3beta1.OutputState|keyof typeof google.cloud.dialogflow.cx.v3beta1.OutputState); @@ -67949,224 +68195,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ToolCallResult. */ - interface IToolCallResult { - - /** ToolCallResult tool */ - tool?: (string|null); - - /** ToolCallResult action */ - action?: (string|null); - - /** ToolCallResult error */ - error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); - - /** ToolCallResult outputParameters */ - outputParameters?: (google.protobuf.IStruct|null); - } - - /** Represents a ToolCallResult. */ - class ToolCallResult implements IToolCallResult { - - /** - * Constructs a new ToolCallResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult); - - /** ToolCallResult tool. */ - public tool: string; - - /** ToolCallResult action. */ - public action: string; - - /** ToolCallResult error. */ - public error?: (google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null); - - /** ToolCallResult outputParameters. */ - public outputParameters?: (google.protobuf.IStruct|null); - - /** ToolCallResult result. */ - public result?: ("error"|"outputParameters"); - - /** - * Creates a new ToolCallResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ToolCallResult instance - */ - public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IToolCallResult): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; - - /** - * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. - * @param message ToolCallResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. - * @param message ToolCallResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IToolCallResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ToolCallResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ToolCallResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; - - /** - * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ToolCallResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; - - /** - * Verifies a ToolCallResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ToolCallResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ToolCallResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult; - - /** - * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. - * @param message ToolCallResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ToolCallResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ToolCallResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ToolCallResult { - - /** Properties of an Error. */ - interface IError { - - /** Error message */ - message?: (string|null); - } - - /** Represents an Error. */ - class Error implements IError { - - /** - * Constructs a new Error. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError); - - /** Error message. */ - public message: string; - - /** - * Creates a new Error instance using the specified properties. - * @param [properties] Properties to set - * @returns Error instance - */ - public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; - - /** - * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. - * @param message Error message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. - * @param message Error message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Error message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; - - /** - * Decodes an Error message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; - - /** - * Verifies an Error message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Error message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Error - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error; - - /** - * Creates a plain object from an Error message. Also converts values to other types if specified. - * @param message Error - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Error to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Error - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - /** Represents a TransitionRouteGroups */ class TransitionRouteGroups extends $protobuf.rpc.Service { @@ -76812,8 +76840,8 @@ export namespace google { /** Playbook outputParameterDefinitions */ outputParameterDefinitions?: (google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]|null); - /** Playbook steps */ - steps?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]|null); + /** Playbook instruction */ + instruction?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null); /** Playbook tokenCount */ tokenCount?: (number|Long|string|null); @@ -76861,8 +76889,8 @@ export namespace google { /** Playbook outputParameterDefinitions. */ public outputParameterDefinitions: google.cloud.dialogflow.cx.v3beta1.IParameterDefinition[]; - /** Playbook steps. */ - public steps: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]; + /** Playbook instruction. */ + public instruction?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null); /** Playbook tokenCount. */ public tokenCount: (number|Long|string); @@ -77070,6 +77098,103 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an Instruction. */ + interface IInstruction { + + /** Instruction steps */ + steps?: (google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]|null); + } + + /** Represents an Instruction. */ + class Instruction implements IInstruction { + + /** + * Constructs a new Instruction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction); + + /** Instruction steps. */ + public steps: google.cloud.dialogflow.cx.v3beta1.Playbook.IStep[]; + + /** + * Creates a new Instruction instance using the specified properties. + * @param [properties] Properties to set + * @returns Instruction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @param message Instruction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Verifies an Instruction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instruction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @param message Instruction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instruction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instruction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a CreatePlaybookVersionRequest. */ @@ -78643,6 +78768,9 @@ export namespace google { /** AudioExportSettings audioFormat */ audioFormat?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null); + + /** AudioExportSettings storeTtsAudio */ + storeTtsAudio?: (boolean|null); } /** Represents an AudioExportSettings. */ @@ -78666,6 +78794,9 @@ export namespace google { /** AudioExportSettings audioFormat. */ public audioFormat: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat); + /** AudioExportSettings storeTtsAudio. */ + public storeTtsAudio: boolean; + /** * Creates a new AudioExportSettings instance using the specified properties. * @param [properties] Properties to set @@ -79873,12 +80004,6 @@ export namespace google { /** Tool description */ description?: (string|null); - /** Tool actions */ - actions?: (string[]|null); - - /** Tool schemas */ - schemas?: (string[]|null); - /** Tool openApiSpec */ openApiSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null); @@ -79913,12 +80038,6 @@ export namespace google { /** Tool description. */ public description: string; - /** Tool actions. */ - public actions: string[]; - - /** Tool schemas. */ - public schemas: string[]; - /** Tool openApiSpec. */ public openApiSpec?: (google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null); diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.js b/packages/google-cloud-dialogflow-cx/protos/protos.js index 8d3b9e1c775..9fc39ae2fa9 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.js +++ b/packages/google-cloud-dialogflow-cx/protos/protos.js @@ -88071,6 +88071,8 @@ * @property {boolean|null} [enabled] DtmfSettings enabled * @property {number|null} [maxDigits] DtmfSettings maxDigits * @property {string|null} [finishDigit] DtmfSettings finishDigit + * @property {google.protobuf.IDuration|null} [interdigitTimeoutDuration] DtmfSettings interdigitTimeoutDuration + * @property {google.protobuf.IDuration|null} [endpointingTimeoutDuration] DtmfSettings endpointingTimeoutDuration */ /** @@ -88112,6 +88114,22 @@ */ DtmfSettings.prototype.finishDigit = ""; + /** + * DtmfSettings interdigitTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} interdigitTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.interdigitTimeoutDuration = null; + + /** + * DtmfSettings endpointingTimeoutDuration. + * @member {google.protobuf.IDuration|null|undefined} endpointingTimeoutDuration + * @memberof google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings + * @instance + */ + DtmfSettings.prototype.endpointingTimeoutDuration = null; + /** * Creates a new DtmfSettings instance using the specified properties. * @function create @@ -88142,6 +88160,10 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDigits); if (message.finishDigit != null && Object.hasOwnProperty.call(message, "finishDigit")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.finishDigit); + if (message.interdigitTimeoutDuration != null && Object.hasOwnProperty.call(message, "interdigitTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.interdigitTimeoutDuration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endpointingTimeoutDuration != null && Object.hasOwnProperty.call(message, "endpointingTimeoutDuration")) + $root.google.protobuf.Duration.encode(message.endpointingTimeoutDuration, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -88188,6 +88210,14 @@ message.finishDigit = reader.string(); break; } + case 6: { + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -88232,6 +88262,16 @@ if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) if (!$util.isString(message.finishDigit)) return "finishDigit: string expected"; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.interdigitTimeoutDuration); + if (error) + return "interdigitTimeoutDuration." + error; + } + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) { + var error = $root.google.protobuf.Duration.verify(message.endpointingTimeoutDuration); + if (error) + return "endpointingTimeoutDuration." + error; + } return null; }; @@ -88253,6 +88293,16 @@ message.maxDigits = object.maxDigits | 0; if (object.finishDigit != null) message.finishDigit = String(object.finishDigit); + if (object.interdigitTimeoutDuration != null) { + if (typeof object.interdigitTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.interdigitTimeoutDuration: object expected"); + message.interdigitTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.interdigitTimeoutDuration); + } + if (object.endpointingTimeoutDuration != null) { + if (typeof object.endpointingTimeoutDuration !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.AdvancedSettings.DtmfSettings.endpointingTimeoutDuration: object expected"); + message.endpointingTimeoutDuration = $root.google.protobuf.Duration.fromObject(object.endpointingTimeoutDuration); + } return message; }; @@ -88273,6 +88323,8 @@ object.enabled = false; object.maxDigits = 0; object.finishDigit = ""; + object.interdigitTimeoutDuration = null; + object.endpointingTimeoutDuration = null; } if (message.enabled != null && message.hasOwnProperty("enabled")) object.enabled = message.enabled; @@ -88280,6 +88332,10 @@ object.maxDigits = message.maxDigits; if (message.finishDigit != null && message.hasOwnProperty("finishDigit")) object.finishDigit = message.finishDigit; + if (message.interdigitTimeoutDuration != null && message.hasOwnProperty("interdigitTimeoutDuration")) + object.interdigitTimeoutDuration = $root.google.protobuf.Duration.toObject(message.interdigitTimeoutDuration, options); + if (message.endpointingTimeoutDuration != null && message.hasOwnProperty("endpointingTimeoutDuration")) + object.endpointingTimeoutDuration = $root.google.protobuf.Duration.toObject(message.endpointingTimeoutDuration, options); return object; }; @@ -89457,19 +89513,19 @@ /** * Agent startFlow. - * @member {string} startFlow + * @member {string|null|undefined} startFlow * @memberof google.cloud.dialogflow.cx.v3beta1.Agent * @instance */ - Agent.prototype.startFlow = ""; + Agent.prototype.startFlow = null; /** * Agent startPlaybook. - * @member {string} startPlaybook + * @member {string|null|undefined} startPlaybook * @memberof google.cloud.dialogflow.cx.v3beta1.Agent * @instance */ - Agent.prototype.startPlaybook = ""; + Agent.prototype.startPlaybook = null; /** * Agent securitySettings. @@ -89562,6 +89618,17 @@ // OneOf field names bound to virtual getters and setters var $oneOfFields; + /** + * Agent sessionEntryResource. + * @member {"startFlow"|"startPlaybook"|undefined} sessionEntryResource + * @memberof google.cloud.dialogflow.cx.v3beta1.Agent + * @instance + */ + Object.defineProperty(Agent.prototype, "sessionEntryResource", { + get: $util.oneOfGetter($oneOfFields = ["startFlow", "startPlaybook"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Agent _genAppBuilderSettings. * @member {"genAppBuilderSettings"|undefined} _genAppBuilderSettings @@ -89826,12 +89893,18 @@ if (error) return "speechToTextSettings." + error; } - if (message.startFlow != null && message.hasOwnProperty("startFlow")) + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { + properties.sessionEntryResource = 1; if (!$util.isString(message.startFlow)) return "startFlow: string expected"; - if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) + } + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { + if (properties.sessionEntryResource === 1) + return "sessionEntryResource: multiple values"; + properties.sessionEntryResource = 1; if (!$util.isString(message.startPlaybook)) return "startPlaybook: string expected"; + } if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) if (!$util.isString(message.securitySettings)) return "securitySettings: string expected"; @@ -89989,7 +90062,6 @@ object.description = ""; object.avatarUri = ""; object.speechToTextSettings = null; - object.startFlow = ""; object.securitySettings = ""; object.enableStackdriverLogging = false; object.enableSpellCorrection = false; @@ -89998,7 +90070,6 @@ object.gitIntegrationSettings = null; object.textToSpeechSettings = null; object.answerFeedbackSettings = null; - object.startPlaybook = ""; object.enableMultiLanguageTraining = false; object.personalizationSettings = null; } @@ -90021,8 +90092,11 @@ object.avatarUri = message.avatarUri; if (message.speechToTextSettings != null && message.hasOwnProperty("speechToTextSettings")) object.speechToTextSettings = $root.google.cloud.dialogflow.cx.v3beta1.SpeechToTextSettings.toObject(message.speechToTextSettings, options); - if (message.startFlow != null && message.hasOwnProperty("startFlow")) + if (message.startFlow != null && message.hasOwnProperty("startFlow")) { object.startFlow = message.startFlow; + if (options.oneofs) + object.sessionEntryResource = "startFlow"; + } if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) object.securitySettings = message.securitySettings; if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) @@ -90044,8 +90118,11 @@ } if (message.answerFeedbackSettings != null && message.hasOwnProperty("answerFeedbackSettings")) object.answerFeedbackSettings = $root.google.cloud.dialogflow.cx.v3beta1.Agent.AnswerFeedbackSettings.toObject(message.answerFeedbackSettings, options); - if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) + if (message.startPlaybook != null && message.hasOwnProperty("startPlaybook")) { object.startPlaybook = message.startPlaybook; + if (options.oneofs) + object.sessionEntryResource = "startPlaybook"; + } if (message.enableMultiLanguageTraining != null && message.hasOwnProperty("enableMultiLanguageTraining")) object.enableMultiLanguageTraining = message.enableMultiLanguageTraining; if (message.personalizationSettings != null && message.hasOwnProperty("personalizationSettings")) @@ -110724,6 +110801,7 @@ * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IMixedAudio|null} [mixedAudio] ResponseMessage mixedAudio * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.ITelephonyTransferCall|null} [telephonyTransferCall] ResponseMessage telephonyTransferCall * @property {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IKnowledgeInfoCard|null} [knowledgeInfoCard] ResponseMessage knowledgeInfoCard + * @property {google.cloud.dialogflow.cx.v3beta1.IToolCall|null} [toolCall] ResponseMessage toolCall * @property {string|null} [channel] ResponseMessage channel */ @@ -110822,6 +110900,14 @@ */ ResponseMessage.prototype.knowledgeInfoCard = null; + /** + * ResponseMessage toolCall. + * @member {google.cloud.dialogflow.cx.v3beta1.IToolCall|null|undefined} toolCall + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.toolCall = null; + /** * ResponseMessage channel. * @member {string} channel @@ -110835,12 +110921,12 @@ /** * ResponseMessage message. - * @member {"text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|undefined} message + * @member {"text"|"payload"|"conversationSuccess"|"outputAudioText"|"liveAgentHandoff"|"endInteraction"|"playAudio"|"mixedAudio"|"telephonyTransferCall"|"knowledgeInfoCard"|"toolCall"|undefined} message * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage * @instance */ Object.defineProperty(ResponseMessage.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["text", "payload", "conversationSuccess", "outputAudioText", "liveAgentHandoff", "endInteraction", "playAudio", "mixedAudio", "telephonyTransferCall", "knowledgeInfoCard"]), + get: $util.oneOfGetter($oneOfFields = ["text", "payload", "conversationSuccess", "outputAudioText", "liveAgentHandoff", "endInteraction", "playAudio", "mixedAudio", "telephonyTransferCall", "knowledgeInfoCard", "toolCall"]), set: $util.oneOfSetter($oneOfFields) }); @@ -110890,6 +110976,8 @@ writer.uint32(/* id 19, wireType 2 =*/154).string(message.channel); if (message.knowledgeInfoCard != null && Object.hasOwnProperty.call(message, "knowledgeInfoCard")) $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.encode(message.knowledgeInfoCard, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.encode(message.toolCall, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; @@ -110964,6 +111052,10 @@ message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.decode(reader, reader.uint32()); break; } + case 22: { + message.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.decode(reader, reader.uint32()); + break; + } case 19: { message.channel = reader.string(); break; @@ -111102,6 +111194,16 @@ return "knowledgeInfoCard." + error; } } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } if (message.channel != null && message.hasOwnProperty("channel")) if (!$util.isString(message.channel)) return "channel: string expected"; @@ -111170,6 +111272,11 @@ throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.knowledgeInfoCard: object expected"); message.knowledgeInfoCard = $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.KnowledgeInfoCard.fromObject(object.knowledgeInfoCard); } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ResponseMessage.toolCall: object expected"); + message.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.fromObject(object.toolCall); + } if (object.channel != null) message.channel = String(object.channel); return message; @@ -111242,6 +111349,11 @@ if (options.oneofs) object.message = "knowledgeInfoCard"; } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.cloud.dialogflow.cx.v3beta1.ToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.message = "toolCall"; + } return object; }; @@ -113506,6 +113618,774 @@ return ResponseMessage; })(); + v3beta1.ToolCall = (function() { + + /** + * Properties of a ToolCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolCall + * @property {string|null} [tool] ToolCall tool + * @property {string|null} [action] ToolCall action + * @property {google.protobuf.IStruct|null} [inputParameters] ToolCall inputParameters + */ + + /** + * Constructs a new ToolCall. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolCall. + * @implements IToolCall + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall=} [properties] Properties to set + */ + function ToolCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCall tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.tool = ""; + + /** + * ToolCall action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.action = ""; + + /** + * ToolCall inputParameters. + * @member {google.protobuf.IStruct|null|undefined} inputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + */ + ToolCall.prototype.inputParameters = null; + + /** + * Creates a new ToolCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall instance + */ + ToolCall.create = function create(properties) { + return new ToolCall(properties); + }; + + /** + * Encodes the specified ToolCall message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.inputParameters != null && Object.hasOwnProperty.call(message, "inputParameters")) + $root.google.protobuf.Struct.encode(message.inputParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCall} message ToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.inputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCall message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputParameters); + if (error) + return "inputParameters." + error; + } + return null; + }; + + /** + * Creates a ToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCall} ToolCall + */ + ToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCall) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCall(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.inputParameters != null) { + if (typeof object.inputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCall.inputParameters: object expected"); + message.inputParameters = $root.google.protobuf.Struct.fromObject(object.inputParameters); + } + return message; + }; + + /** + * Creates a plain object from a ToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCall} message ToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + object.inputParameters = null; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) + object.inputParameters = $root.google.protobuf.Struct.toObject(message.inputParameters, options); + return object; + }; + + /** + * Converts this ToolCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @instance + * @returns {Object.} JSON object + */ + ToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCall + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCall"; + }; + + return ToolCall; + })(); + + v3beta1.ToolCallResult = (function() { + + /** + * Properties of a ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IToolCallResult + * @property {string|null} [tool] ToolCallResult tool + * @property {string|null} [action] ToolCallResult action + * @property {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null} [error] ToolCallResult error + * @property {google.protobuf.IStruct|null} [outputParameters] ToolCallResult outputParameters + */ + + /** + * Constructs a new ToolCallResult. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ToolCallResult. + * @implements IToolCallResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set + */ + function ToolCallResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolCallResult tool. + * @member {string} tool + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.tool = ""; + + /** + * ToolCallResult action. + * @member {string} action + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.action = ""; + + /** + * ToolCallResult error. + * @member {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null|undefined} error + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.error = null; + + /** + * ToolCallResult outputParameters. + * @member {google.protobuf.IStruct|null|undefined} outputParameters + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + ToolCallResult.prototype.outputParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ToolCallResult result. + * @member {"error"|"outputParameters"|undefined} result + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + */ + Object.defineProperty(ToolCallResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "outputParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ToolCallResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult instance + */ + ToolCallResult.create = function create(properties) { + return new ToolCallResult(properties); + }; + + /** + * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) + $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolCallResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tool = reader.string(); + break; + } + case 2: { + message.action = reader.string(); + break; + } + case 3: { + message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolCallResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolCallResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolCallResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tool != null && message.hasOwnProperty("tool")) + if (!$util.isString(message.tool)) + return "tool: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Struct.verify(message.outputParameters); + if (error) + return "outputParameters." + error; + } + } + return null; + }; + + /** + * Creates a ToolCallResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + */ + ToolCallResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); + if (object.tool != null) + message.tool = String(object.tool); + if (object.action != null) + message.action = String(object.action); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.error: object expected"); + message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.fromObject(object.error); + } + if (object.outputParameters != null) { + if (typeof object.outputParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.outputParameters: object expected"); + message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters); + } + return message; + }; + + /** + * Creates a plain object from a ToolCallResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} message ToolCallResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolCallResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tool = ""; + object.action = ""; + } + if (message.tool != null && message.hasOwnProperty("tool")) + object.tool = message.tool; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { + object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); + if (options.oneofs) + object.result = "outputParameters"; + } + return object; + }; + + /** + * Converts this ToolCallResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @instance + * @returns {Object.} JSON object + */ + ToolCallResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolCallResult + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolCallResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult"; + }; + + ToolCallResult.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @interface IError + * @property {string|null} [message] Error message + */ + + /** + * Constructs a new Error. + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set + */ + function Error(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error message. + * @member {string} message + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @instance + */ + Error.prototype.message = ""; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error + */ + Error.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.message = ""; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Error + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Error.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error"; + }; + + return Error; + })(); + + return ToolCallResult; + })(); + v3beta1.ValidationMessage = (function() { /** @@ -150659,6 +151539,7 @@ case 4: case 5: case 6: + case 9: break; } if (message.confidence != null && message.hasOwnProperty("confidence")) @@ -150728,6 +151609,10 @@ case 6: message.matchType = 6; break; + case "PLAYBOOK": + case 9: + message.matchType = 9; + break; } if (object.confidence != null) message.confidence = Number(object.confidence); @@ -150807,6 +151692,7 @@ * @property {number} NO_MATCH=4 NO_MATCH value * @property {number} NO_INPUT=5 NO_INPUT value * @property {number} EVENT=6 EVENT value + * @property {number} PLAYBOOK=9 PLAYBOOK value */ Match.MatchType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -150817,6 +151703,7 @@ values[valuesById[4] = "NO_MATCH"] = 4; values[valuesById[5] = "NO_INPUT"] = 5; values[valuesById[6] = "EVENT"] = 6; + values[valuesById[9] = "PLAYBOOK"] = 9; return values; })(); @@ -154404,7 +155291,7 @@ * @memberof google.cloud.dialogflow.cx.v3beta1 * @interface IPlaybookInput * @property {string|null} [precedingConversationSummary] PlaybookInput precedingConversationSummary - * @property {Array.|null} [parameters] PlaybookInput parameters + * @property {google.protobuf.IStruct|null} [actionParameters] PlaybookInput actionParameters */ /** @@ -154416,7 +155303,6 @@ * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookInput=} [properties] Properties to set */ function PlaybookInput(properties) { - this.parameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -154432,12 +155318,12 @@ PlaybookInput.prototype.precedingConversationSummary = ""; /** - * PlaybookInput parameters. - * @member {Array.} parameters + * PlaybookInput actionParameters. + * @member {google.protobuf.IStruct|null|undefined} actionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookInput * @instance */ - PlaybookInput.prototype.parameters = $util.emptyArray; + PlaybookInput.prototype.actionParameters = null; /** * Creates a new PlaybookInput instance using the specified properties. @@ -154465,9 +155351,8 @@ writer = $Writer.create(); if (message.precedingConversationSummary != null && Object.hasOwnProperty.call(message, "precedingConversationSummary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.precedingConversationSummary); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actionParameters != null && Object.hasOwnProperty.call(message, "actionParameters")) + $root.google.protobuf.Struct.encode(message.actionParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -154506,10 +155391,8 @@ message.precedingConversationSummary = reader.string(); break; } - case 2: { - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 3: { + message.actionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } default: @@ -154550,14 +155433,10 @@ if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) if (!$util.isString(message.precedingConversationSummary)) return "precedingConversationSummary: 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.dialogflow.cx.v3beta1.ActionParameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.actionParameters); + if (error) + return "actionParameters." + error; } return null; }; @@ -154576,15 +155455,10 @@ var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookInput(); if (object.precedingConversationSummary != null) message.precedingConversationSummary = String(object.precedingConversationSummary); - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInput.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInput.parameters: object expected"); - message.parameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.parameters[i]); - } + if (object.actionParameters != null) { + if (typeof object.actionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookInput.actionParameters: object expected"); + message.actionParameters = $root.google.protobuf.Struct.fromObject(object.actionParameters); } return message; }; @@ -154602,17 +155476,14 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.parameters = []; - if (options.defaults) + if (options.defaults) { object.precedingConversationSummary = ""; + object.actionParameters = null; + } if (message.precedingConversationSummary != null && message.hasOwnProperty("precedingConversationSummary")) object.precedingConversationSummary = message.precedingConversationSummary; - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.toObject(message.parameters[j], options); - } + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) + object.actionParameters = $root.google.protobuf.Struct.toObject(message.actionParameters, options); return object; }; @@ -154652,7 +155523,7 @@ * @memberof google.cloud.dialogflow.cx.v3beta1 * @interface IPlaybookOutput * @property {string|null} [executionSummary] PlaybookOutput executionSummary - * @property {Array.|null} [parameters] PlaybookOutput parameters + * @property {google.protobuf.IStruct|null} [actionParameters] PlaybookOutput actionParameters */ /** @@ -154664,7 +155535,6 @@ * @param {google.cloud.dialogflow.cx.v3beta1.IPlaybookOutput=} [properties] Properties to set */ function PlaybookOutput(properties) { - this.parameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -154680,12 +155550,12 @@ PlaybookOutput.prototype.executionSummary = ""; /** - * PlaybookOutput parameters. - * @member {Array.} parameters + * PlaybookOutput actionParameters. + * @member {google.protobuf.IStruct|null|undefined} actionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.PlaybookOutput * @instance */ - PlaybookOutput.prototype.parameters = $util.emptyArray; + PlaybookOutput.prototype.actionParameters = null; /** * Creates a new PlaybookOutput instance using the specified properties. @@ -154713,9 +155583,8 @@ writer = $Writer.create(); if (message.executionSummary != null && Object.hasOwnProperty.call(message, "executionSummary")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionSummary); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.actionParameters != null && Object.hasOwnProperty.call(message, "actionParameters")) + $root.google.protobuf.Struct.encode(message.actionParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -154754,10 +155623,8 @@ message.executionSummary = reader.string(); break; } - case 3: { - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 4: { + message.actionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } default: @@ -154798,14 +155665,10 @@ if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) if (!$util.isString(message.executionSummary)) return "executionSummary: 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.dialogflow.cx.v3beta1.ActionParameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.actionParameters); + if (error) + return "actionParameters." + error; } return null; }; @@ -154824,15 +155687,10 @@ var message = new $root.google.cloud.dialogflow.cx.v3beta1.PlaybookOutput(); if (object.executionSummary != null) message.executionSummary = String(object.executionSummary); - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.parameters: object expected"); - message.parameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.parameters[i]); - } + if (object.actionParameters != null) { + if (typeof object.actionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.PlaybookOutput.actionParameters: object expected"); + message.actionParameters = $root.google.protobuf.Struct.fromObject(object.actionParameters); } return message; }; @@ -154850,17 +155708,14 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.parameters = []; - if (options.defaults) + if (options.defaults) { object.executionSummary = ""; + object.actionParameters = null; + } if (message.executionSummary != null && message.hasOwnProperty("executionSummary")) object.executionSummary = message.executionSummary; - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.toObject(message.parameters[j], options); - } + if (message.actionParameters != null && message.hasOwnProperty("actionParameters")) + object.actionParameters = $root.google.protobuf.Struct.toObject(message.actionParameters, options); return object; }; @@ -155674,8 +156529,8 @@ * @interface IToolUse * @property {string|null} [tool] ToolUse tool * @property {string|null} [action] ToolUse action - * @property {Array.|null} [inputParameters] ToolUse inputParameters - * @property {Array.|null} [outputParameters] ToolUse outputParameters + * @property {google.protobuf.IStruct|null} [inputActionParameters] ToolUse inputActionParameters + * @property {google.protobuf.IStruct|null} [outputActionParameters] ToolUse outputActionParameters */ /** @@ -155687,8 +156542,6 @@ * @param {google.cloud.dialogflow.cx.v3beta1.IToolUse=} [properties] Properties to set */ function ToolUse(properties) { - this.inputParameters = []; - this.outputParameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -155712,20 +156565,20 @@ ToolUse.prototype.action = ""; /** - * ToolUse inputParameters. - * @member {Array.} inputParameters + * ToolUse inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse * @instance */ - ToolUse.prototype.inputParameters = $util.emptyArray; + ToolUse.prototype.inputActionParameters = null; /** - * ToolUse outputParameters. - * @member {Array.} outputParameters + * ToolUse outputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} outputActionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.ToolUse * @instance */ - ToolUse.prototype.outputParameters = $util.emptyArray; + ToolUse.prototype.outputActionParameters = null; /** * Creates a new ToolUse instance using the specified properties. @@ -155755,12 +156608,10 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); - if (message.inputParameters != null && message.inputParameters.length) - for (var i = 0; i < message.inputParameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.inputParameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputParameters != null && message.outputParameters.length) - for (var i = 0; i < message.outputParameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.outputParameters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputActionParameters != null && Object.hasOwnProperty.call(message, "outputActionParameters")) + $root.google.protobuf.Struct.encode(message.outputActionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -155803,16 +156654,12 @@ message.action = reader.string(); break; } - case 3: { - if (!(message.inputParameters && message.inputParameters.length)) - message.inputParameters = []; - message.inputParameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 5: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } - case 4: { - if (!(message.outputParameters && message.outputParameters.length)) - message.outputParameters = []; - message.outputParameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 6: { + message.outputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } default: @@ -155856,23 +156703,15 @@ 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.dialogflow.cx.v3beta1.ActionParameter.verify(message.inputParameters[i]); - if (error) - return "inputParameters." + error; - } + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters); + if (error) + return "inputActionParameters." + error; } - if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { - if (!Array.isArray(message.outputParameters)) - return "outputParameters: array expected"; - for (var i = 0; i < message.outputParameters.length; ++i) { - var error = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify(message.outputParameters[i]); - if (error) - return "outputParameters." + error; - } + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputActionParameters); + if (error) + return "outputActionParameters." + error; } return null; }; @@ -155893,25 +156732,15 @@ message.tool = String(object.tool); if (object.action != null) message.action = String(object.action); - if (object.inputParameters) { - if (!Array.isArray(object.inputParameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.inputParameters: array expected"); - message.inputParameters = []; - for (var i = 0; i < object.inputParameters.length; ++i) { - if (typeof object.inputParameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.inputParameters: object expected"); - message.inputParameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.inputParameters[i]); - } + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters); } - if (object.outputParameters) { - if (!Array.isArray(object.outputParameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.outputParameters: array expected"); - message.outputParameters = []; - for (var i = 0; i < object.outputParameters.length; ++i) { - if (typeof object.outputParameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.outputParameters: object expected"); - message.outputParameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.outputParameters[i]); - } + if (object.outputActionParameters != null) { + if (typeof object.outputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolUse.outputActionParameters: object expected"); + message.outputActionParameters = $root.google.protobuf.Struct.fromObject(object.outputActionParameters); } return message; }; @@ -155929,28 +156758,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.inputParameters = []; - object.outputParameters = []; - } if (options.defaults) { object.tool = ""; object.action = ""; + object.inputActionParameters = null; + object.outputActionParameters = null; } if (message.tool != null && message.hasOwnProperty("tool")) object.tool = message.tool; 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.dialogflow.cx.v3beta1.ActionParameter.toObject(message.inputParameters[j], options); - } - if (message.outputParameters && message.outputParameters.length) { - object.outputParameters = []; - for (var j = 0; j < message.outputParameters.length; ++j) - object.outputParameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.toObject(message.outputParameters[j], options); - } + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) + object.outputActionParameters = $root.google.protobuf.Struct.toObject(message.outputActionParameters, options); return object; }; @@ -155983,238 +156804,6 @@ return ToolUse; })(); - v3beta1.ActionParameter = (function() { - - /** - * Properties of an ActionParameter. - * @memberof google.cloud.dialogflow.cx.v3beta1 - * @interface IActionParameter - * @property {string|null} [name] ActionParameter name - * @property {google.protobuf.IValue|null} [value] ActionParameter value - */ - - /** - * Constructs a new ActionParameter. - * @memberof google.cloud.dialogflow.cx.v3beta1 - * @classdesc Represents an ActionParameter. - * @implements IActionParameter - * @constructor - * @param {google.cloud.dialogflow.cx.v3beta1.IActionParameter=} [properties] Properties to set - */ - function ActionParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActionParameter name. - * @member {string} name - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @instance - */ - ActionParameter.prototype.name = ""; - - /** - * ActionParameter value. - * @member {google.protobuf.IValue|null|undefined} value - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @instance - */ - ActionParameter.prototype.value = null; - - /** - * Creates a new ActionParameter instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IActionParameter=} [properties] Properties to set - * @returns {google.cloud.dialogflow.cx.v3beta1.ActionParameter} ActionParameter instance - */ - ActionParameter.create = function create(properties) { - return new ActionParameter(properties); - }; - - /** - * Encodes the specified ActionParameter message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IActionParameter} message ActionParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionParameter.encode = function encode(message, writer) { - 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.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IActionParameter} message ActionParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionParameter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.cx.v3beta1.ActionParameter} ActionParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionParameter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.cx.v3beta1.ActionParameter} ActionParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionParameter message. - * @function verify - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionParameter.verify = function verify(message) { - if (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.Value.verify(message.value); - if (error) - return "value." + error; - } - return null; - }; - - /** - * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.cx.v3beta1.ActionParameter} ActionParameter - */ - ActionParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter) - return object; - var message = new $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ActionParameter.value: object expected"); - message.value = $root.google.protobuf.Value.fromObject(object.value); - } - return message; - }; - - /** - * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ActionParameter} message ActionParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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.Value.toObject(message.value, options); - return object; - }; - - /** - * Converts this ActionParameter to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @instance - * @returns {Object.} JSON object - */ - ActionParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionParameter - * @function getTypeUrl - * @memberof google.cloud.dialogflow.cx.v3beta1.ActionParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ActionParameter"; - }; - - return ActionParameter; - })(); - v3beta1.PlaybookInvocation = (function() { /** @@ -156544,8 +157133,8 @@ * @memberof google.cloud.dialogflow.cx.v3beta1 * @interface IFlowInvocation * @property {string|null} [flow] FlowInvocation flow - * @property {Array.|null} [inputParameters] FlowInvocation inputParameters - * @property {Array.|null} [outputParameters] FlowInvocation outputParameters + * @property {google.protobuf.IStruct|null} [inputActionParameters] FlowInvocation inputActionParameters + * @property {google.protobuf.IStruct|null} [outputActionParameters] FlowInvocation outputActionParameters * @property {google.cloud.dialogflow.cx.v3beta1.OutputState|null} [flowState] FlowInvocation flowState */ @@ -156558,8 +157147,6 @@ * @param {google.cloud.dialogflow.cx.v3beta1.IFlowInvocation=} [properties] Properties to set */ function FlowInvocation(properties) { - this.inputParameters = []; - this.outputParameters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -156575,20 +157162,20 @@ FlowInvocation.prototype.flow = ""; /** - * FlowInvocation inputParameters. - * @member {Array.} inputParameters + * FlowInvocation inputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} inputActionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation * @instance */ - FlowInvocation.prototype.inputParameters = $util.emptyArray; + FlowInvocation.prototype.inputActionParameters = null; /** - * FlowInvocation outputParameters. - * @member {Array.} outputParameters + * FlowInvocation outputActionParameters. + * @member {google.protobuf.IStruct|null|undefined} outputActionParameters * @memberof google.cloud.dialogflow.cx.v3beta1.FlowInvocation * @instance */ - FlowInvocation.prototype.outputParameters = $util.emptyArray; + FlowInvocation.prototype.outputActionParameters = null; /** * FlowInvocation flowState. @@ -156624,14 +157211,12 @@ writer = $Writer.create(); if (message.flow != null && Object.hasOwnProperty.call(message, "flow")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.flow); - if (message.inputParameters != null && message.inputParameters.length) - for (var i = 0; i < message.inputParameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.inputParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputParameters != null && message.outputParameters.length) - for (var i = 0; i < message.outputParameters.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.encode(message.outputParameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.flowState != null && Object.hasOwnProperty.call(message, "flowState")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.flowState); + if (message.inputActionParameters != null && Object.hasOwnProperty.call(message, "inputActionParameters")) + $root.google.protobuf.Struct.encode(message.inputActionParameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputActionParameters != null && Object.hasOwnProperty.call(message, "outputActionParameters")) + $root.google.protobuf.Struct.encode(message.outputActionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -156670,16 +157255,12 @@ message.flow = reader.string(); break; } - case 2: { - if (!(message.inputParameters && message.inputParameters.length)) - message.inputParameters = []; - message.inputParameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 5: { + message.inputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } - case 3: { - if (!(message.outputParameters && message.outputParameters.length)) - message.outputParameters = []; - message.outputParameters.push($root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.decode(reader, reader.uint32())); + case 6: { + message.outputActionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } case 4: { @@ -156724,23 +157305,15 @@ if (message.flow != null && message.hasOwnProperty("flow")) if (!$util.isString(message.flow)) return "flow: 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.dialogflow.cx.v3beta1.ActionParameter.verify(message.inputParameters[i]); - if (error) - return "inputParameters." + error; - } + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.inputActionParameters); + if (error) + return "inputActionParameters." + error; } - if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { - if (!Array.isArray(message.outputParameters)) - return "outputParameters: array expected"; - for (var i = 0; i < message.outputParameters.length; ++i) { - var error = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.verify(message.outputParameters[i]); - if (error) - return "outputParameters." + error; - } + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.outputActionParameters); + if (error) + return "outputActionParameters." + error; } if (message.flowState != null && message.hasOwnProperty("flowState")) switch (message.flowState) { @@ -156771,25 +157344,15 @@ var message = new $root.google.cloud.dialogflow.cx.v3beta1.FlowInvocation(); if (object.flow != null) message.flow = String(object.flow); - if (object.inputParameters) { - if (!Array.isArray(object.inputParameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.inputParameters: array expected"); - message.inputParameters = []; - for (var i = 0; i < object.inputParameters.length; ++i) { - if (typeof object.inputParameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.inputParameters: object expected"); - message.inputParameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.inputParameters[i]); - } - } - if (object.outputParameters) { - if (!Array.isArray(object.outputParameters)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.outputParameters: array expected"); - message.outputParameters = []; - for (var i = 0; i < object.outputParameters.length; ++i) { - if (typeof object.outputParameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.outputParameters: object expected"); - message.outputParameters[i] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.fromObject(object.outputParameters[i]); - } + if (object.inputActionParameters != null) { + if (typeof object.inputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.inputActionParameters: object expected"); + message.inputActionParameters = $root.google.protobuf.Struct.fromObject(object.inputActionParameters); + } + if (object.outputActionParameters != null) { + if (typeof object.outputActionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.FlowInvocation.outputActionParameters: object expected"); + message.outputActionParameters = $root.google.protobuf.Struct.fromObject(object.outputActionParameters); } switch (object.flowState) { default: @@ -156839,28 +157402,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.inputParameters = []; - object.outputParameters = []; - } if (options.defaults) { object.flow = ""; object.flowState = options.enums === String ? "OUTPUT_STATE_UNSPECIFIED" : 0; + object.inputActionParameters = null; + object.outputActionParameters = null; } if (message.flow != null && message.hasOwnProperty("flow")) object.flow = message.flow; - if (message.inputParameters && message.inputParameters.length) { - object.inputParameters = []; - for (var j = 0; j < message.inputParameters.length; ++j) - object.inputParameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.toObject(message.inputParameters[j], options); - } - if (message.outputParameters && message.outputParameters.length) { - object.outputParameters = []; - for (var j = 0; j < message.outputParameters.length; ++j) - object.outputParameters[j] = $root.google.cloud.dialogflow.cx.v3beta1.ActionParameter.toObject(message.outputParameters[j], options); - } if (message.flowState != null && message.hasOwnProperty("flowState")) object.flowState = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.flowState] === undefined ? message.flowState : $root.google.cloud.dialogflow.cx.v3beta1.OutputState[message.flowState] : message.flowState; + if (message.inputActionParameters != null && message.hasOwnProperty("inputActionParameters")) + object.inputActionParameters = $root.google.protobuf.Struct.toObject(message.inputActionParameters, options); + if (message.outputActionParameters != null && message.hasOwnProperty("outputActionParameters")) + object.outputActionParameters = $root.google.protobuf.Struct.toObject(message.outputActionParameters, options); return object; }; @@ -163306,604 +163861,91 @@ * @function verify * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteEntityTypeRequest.verify = function verify(message) { - if (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 DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest - */ - DeleteEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) - return object; - var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(); - 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 DeleteEntityTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} message DeleteEntityTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteEntityTypeRequest.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 DeleteEntityTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteEntityTypeRequest - * @function getTypeUrl - * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest"; - }; - - return DeleteEntityTypeRequest; - })(); - - v3beta1.ToolCallResult = (function() { - - /** - * Properties of a ToolCallResult. - * @memberof google.cloud.dialogflow.cx.v3beta1 - * @interface IToolCallResult - * @property {string|null} [tool] ToolCallResult tool - * @property {string|null} [action] ToolCallResult action - * @property {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null} [error] ToolCallResult error - * @property {google.protobuf.IStruct|null} [outputParameters] ToolCallResult outputParameters - */ - - /** - * Constructs a new ToolCallResult. - * @memberof google.cloud.dialogflow.cx.v3beta1 - * @classdesc Represents a ToolCallResult. - * @implements IToolCallResult - * @constructor - * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set - */ - function ToolCallResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ToolCallResult tool. - * @member {string} tool - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @instance - */ - ToolCallResult.prototype.tool = ""; - - /** - * ToolCallResult action. - * @member {string} action - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @instance - */ - ToolCallResult.prototype.action = ""; - - /** - * ToolCallResult error. - * @member {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError|null|undefined} error - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @instance - */ - ToolCallResult.prototype.error = null; - - /** - * ToolCallResult outputParameters. - * @member {google.protobuf.IStruct|null|undefined} outputParameters - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @instance - */ - ToolCallResult.prototype.outputParameters = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ToolCallResult result. - * @member {"error"|"outputParameters"|undefined} result - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @instance - */ - Object.defineProperty(ToolCallResult.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "outputParameters"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ToolCallResult instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult instance - */ - ToolCallResult.create = function create(properties) { - return new ToolCallResult(properties); - }; - - /** - * Encodes the specified ToolCallResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tool); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.action); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputParameters != null && Object.hasOwnProperty.call(message, "outputParameters")) - $root.google.protobuf.Struct.encode(message.outputParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ToolCallResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.IToolCallResult} message ToolCallResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ToolCallResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ToolCallResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.tool = reader.string(); - break; - } - case 2: { - message.action = reader.string(); - break; - } - case 3: { - message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ToolCallResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ToolCallResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ToolCallResult message. - * @function verify - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ToolCallResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tool != null && message.hasOwnProperty("tool")) - if (!$util.isString(message.tool)) - return "tool: string expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Struct.verify(message.outputParameters); - if (error) - return "outputParameters." + error; - } - } + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEntityTypeRequest.verify = function verify(message) { + if (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 ToolCallResult message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} ToolCallResult + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest */ - ToolCallResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult) + DeleteEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult(); - if (object.tool != null) - message.tool = String(object.tool); - if (object.action != null) - message.action = String(object.action); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.error: object expected"); - message.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.fromObject(object.error); - } - if (object.outputParameters != null) { - if (typeof object.outputParameters !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ToolCallResult.outputParameters: object expected"); - message.outputParameters = $root.google.protobuf.Struct.fromObject(object.outputParameters); - } + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest(); + 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 ToolCallResult message. Also converts values to other types if specified. + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult} message ToolCallResult + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest} message DeleteEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ToolCallResult.toObject = function toObject(message, options) { + DeleteEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.tool = ""; - object.action = ""; - } - if (message.tool != null && message.hasOwnProperty("tool")) - object.tool = message.tool; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.outputParameters != null && message.hasOwnProperty("outputParameters")) { - object.outputParameters = $root.google.protobuf.Struct.toObject(message.outputParameters, options); - if (options.oneofs) - object.result = "outputParameters"; + 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 ToolCallResult to JSON. + * Converts this DeleteEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest * @instance * @returns {Object.} JSON object */ - ToolCallResult.prototype.toJSON = function toJSON() { + DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ToolCallResult + * Gets the default type url for DeleteEntityTypeRequest * @function getTypeUrl - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ToolCallResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteEntityTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult"; + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest"; }; - ToolCallResult.Error = (function() { - - /** - * Properties of an Error. - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @interface IError - * @property {string|null} [message] Error message - */ - - /** - * Constructs a new Error. - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult - * @classdesc Represents an Error. - * @implements IError - * @constructor - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set - */ - function Error(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Error message. - * @member {string} message - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @instance - */ - Error.prototype.message = ""; - - /** - * Creates a new Error instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError=} [properties] Properties to set - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error instance - */ - Error.create = function create(properties) { - return new Error(properties); - }; - - /** - * Encodes the specified Error message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Error.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); - return writer; - }; - - /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.IError} message Error message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Error.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Error message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Error.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.message = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Error message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Error.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Error message. - * @function verify - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Error.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates an Error message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} Error - */ - Error.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error) - return object; - var message = new $root.google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error(); - if (object.message != null) - message.message = String(object.message); - return message; - }; - - /** - * Creates a plain object from an Error message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error} message Error - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Error.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.message = ""; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; - - /** - * Converts this Error to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @instance - * @returns {Object.} JSON object - */ - Error.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Error - * @function getTypeUrl - * @memberof google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Error.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.ToolCallResult.Error"; - }; - - return Error; - })(); - - return ToolCallResult; + return DeleteEntityTypeRequest; })(); v3beta1.TransitionRouteGroups = (function() { @@ -184237,7 +184279,7 @@ * @property {string|null} [goal] Playbook goal * @property {Array.|null} [inputParameterDefinitions] Playbook inputParameterDefinitions * @property {Array.|null} [outputParameterDefinitions] Playbook outputParameterDefinitions - * @property {Array.|null} [steps] Playbook steps + * @property {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null} [instruction] Playbook instruction * @property {number|Long|null} [tokenCount] Playbook tokenCount * @property {google.protobuf.ITimestamp|null} [createTime] Playbook createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Playbook updateTime @@ -184258,7 +184300,6 @@ function Playbook(properties) { this.inputParameterDefinitions = []; this.outputParameterDefinitions = []; - this.steps = []; this.referencedPlaybooks = []; this.referencedFlows = []; this.referencedTools = []; @@ -184309,12 +184350,12 @@ Playbook.prototype.outputParameterDefinitions = $util.emptyArray; /** - * Playbook steps. - * @member {Array.} steps + * Playbook instruction. + * @member {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction|null|undefined} instruction * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook * @instance */ - Playbook.prototype.steps = $util.emptyArray; + Playbook.prototype.instruction = null; /** * Playbook tokenCount. @@ -184402,9 +184443,6 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.goal != null && Object.hasOwnProperty.call(message, "goal")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.goal); - if (message.steps != null && message.steps.length) - for (var i = 0; i < message.steps.length; ++i) - $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.inputParameterDefinitions != null && message.inputParameterDefinitions.length) for (var i = 0; i < message.inputParameterDefinitions.length; ++i) $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.encode(message.inputParameterDefinitions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); @@ -184428,6 +184466,8 @@ writer.uint32(/* id 13, wireType 2 =*/106).string(message.referencedTools[i]); if (message.llmModelSettings != null && Object.hasOwnProperty.call(message, "llmModelSettings")) $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.encode(message.llmModelSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.encode(message.instruction, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -184486,10 +184526,8 @@ message.outputParameterDefinitions.push($root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.decode(reader, reader.uint32())); break; } - case 4: { - if (!(message.steps && message.steps.length)) - message.steps = []; - message.steps.push($root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.decode(reader, reader.uint32())); + case 17: { + message.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.decode(reader, reader.uint32()); break; } case 8: { @@ -184588,14 +184626,10 @@ return "outputParameterDefinitions." + error; } } - if (message.steps != null && message.hasOwnProperty("steps")) { - if (!Array.isArray(message.steps)) - return "steps: array expected"; - for (var i = 0; i < message.steps.length; ++i) { - var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify(message.steps[i]); - if (error) - return "steps." + error; - } + if (message.instruction != null && message.hasOwnProperty("instruction")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify(message.instruction); + if (error) + return "instruction." + error; } if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) if (!$util.isInteger(message.tokenCount) && !(message.tokenCount && $util.isInteger(message.tokenCount.low) && $util.isInteger(message.tokenCount.high))) @@ -184677,15 +184711,10 @@ message.outputParameterDefinitions[i] = $root.google.cloud.dialogflow.cx.v3beta1.ParameterDefinition.fromObject(object.outputParameterDefinitions[i]); } } - if (object.steps) { - if (!Array.isArray(object.steps)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.steps: array expected"); - message.steps = []; - for (var i = 0; i < object.steps.length; ++i) { - if (typeof object.steps[i] !== "object") - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.steps: object expected"); - message.steps[i] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.fromObject(object.steps[i]); - } + if (object.instruction != null) { + if (typeof object.instruction !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.instruction: object expected"); + message.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.fromObject(object.instruction); } if (object.tokenCount != null) if ($util.Long) @@ -184749,7 +184778,6 @@ options = {}; var object = {}; if (options.arrays || options.defaults) { - object.steps = []; object.inputParameterDefinitions = []; object.outputParameterDefinitions = []; object.referencedPlaybooks = []; @@ -184768,6 +184796,7 @@ object.createTime = null; object.updateTime = null; object.llmModelSettings = null; + object.instruction = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -184775,11 +184804,6 @@ object.displayName = message.displayName; if (message.goal != null && message.hasOwnProperty("goal")) object.goal = message.goal; - if (message.steps && message.steps.length) { - object.steps = []; - for (var j = 0; j < message.steps.length; ++j) - object.steps[j] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.toObject(message.steps[j], options); - } if (message.inputParameterDefinitions && message.inputParameterDefinitions.length) { object.inputParameterDefinitions = []; for (var j = 0; j < message.inputParameterDefinitions.length; ++j) @@ -184816,6 +184840,8 @@ } if (message.llmModelSettings != null && message.hasOwnProperty("llmModelSettings")) object.llmModelSettings = $root.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings.toObject(message.llmModelSettings, options); + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.toObject(message.instruction, options); return object; }; @@ -185111,6 +185137,230 @@ return Step; })(); + Playbook.Instruction = (function() { + + /** + * Properties of an Instruction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @interface IInstruction + * @property {Array.|null} [steps] Instruction steps + */ + + /** + * Constructs a new Instruction. + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook + * @classdesc Represents an Instruction. + * @implements IInstruction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction=} [properties] Properties to set + */ + function Instruction(properties) { + this.steps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instruction steps. + * @member {Array.} steps + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @instance + */ + Instruction.prototype.steps = $util.emptyArray; + + /** + * Creates a new Instruction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction instance + */ + Instruction.create = function create(properties) { + return new Instruction(properties); + }; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.encode(message.steps[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instruction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + return null; + }; + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} Instruction + */ + Instruction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction(); + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction.steps: object expected"); + message.steps[i] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.fromObject(object.steps[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction} message Instruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.steps = []; + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.cloud.dialogflow.cx.v3beta1.Playbook.Step.toObject(message.steps[j], options); + } + return object; + }; + + /** + * Converts this Instruction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @instance + * @returns {Object.} JSON object + */ + Instruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instruction + * @function getTypeUrl + * @memberof google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dialogflow.cx.v3beta1.Playbook.Instruction"; + }; + + return Instruction; + })(); + return Playbook; })(); @@ -188784,6 +189034,7 @@ * @property {string|null} [audioExportPattern] AudioExportSettings audioExportPattern * @property {boolean|null} [enableAudioRedaction] AudioExportSettings enableAudioRedaction * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat|null} [audioFormat] AudioExportSettings audioFormat + * @property {boolean|null} [storeTtsAudio] AudioExportSettings storeTtsAudio */ /** @@ -188833,6 +189084,14 @@ */ AudioExportSettings.prototype.audioFormat = 0; + /** + * AudioExportSettings storeTtsAudio. + * @member {boolean} storeTtsAudio + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings + * @instance + */ + AudioExportSettings.prototype.storeTtsAudio = false; + /** * Creates a new AudioExportSettings instance using the specified properties. * @function create @@ -188865,6 +189124,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableAudioRedaction); if (message.audioFormat != null && Object.hasOwnProperty.call(message, "audioFormat")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.audioFormat); + if (message.storeTtsAudio != null && Object.hasOwnProperty.call(message, "storeTtsAudio")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.storeTtsAudio); return writer; }; @@ -188915,6 +189176,10 @@ message.audioFormat = reader.int32(); break; } + case 6: { + message.storeTtsAudio = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -188969,6 +189234,9 @@ case 3: break; } + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + if (typeof message.storeTtsAudio !== "boolean") + return "storeTtsAudio: boolean expected"; return null; }; @@ -189014,6 +189282,8 @@ message.audioFormat = 3; break; } + if (object.storeTtsAudio != null) + message.storeTtsAudio = Boolean(object.storeTtsAudio); return message; }; @@ -189035,6 +189305,7 @@ object.audioExportPattern = ""; object.enableAudioRedaction = false; object.audioFormat = options.enums === String ? "AUDIO_FORMAT_UNSPECIFIED" : 0; + object.storeTtsAudio = false; } if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) object.gcsBucket = message.gcsBucket; @@ -189044,6 +189315,8 @@ object.enableAudioRedaction = message.enableAudioRedaction; if (message.audioFormat != null && message.hasOwnProperty("audioFormat")) object.audioFormat = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] === undefined ? message.audioFormat : $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.AudioExportSettings.AudioFormat[message.audioFormat] : message.audioFormat; + if (message.storeTtsAudio != null && message.hasOwnProperty("storeTtsAudio")) + object.storeTtsAudio = message.storeTtsAudio; return object; }; @@ -191573,8 +191846,6 @@ * @property {string|null} [name] Tool name * @property {string|null} [displayName] Tool displayName * @property {string|null} [description] Tool description - * @property {Array.|null} [actions] Tool actions - * @property {Array.|null} [schemas] Tool schemas * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null} [openApiSpec] Tool openApiSpec * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IDataStoreTool|null} [dataStoreSpec] Tool dataStoreSpec * @property {google.cloud.dialogflow.cx.v3beta1.Tool.IExtensionTool|null} [extensionSpec] Tool extensionSpec @@ -191591,8 +191862,6 @@ * @param {google.cloud.dialogflow.cx.v3beta1.ITool=} [properties] Properties to set */ function Tool(properties) { - this.actions = []; - this.schemas = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -191623,22 +191892,6 @@ */ Tool.prototype.description = ""; - /** - * Tool actions. - * @member {Array.} actions - * @memberof google.cloud.dialogflow.cx.v3beta1.Tool - * @instance - */ - Tool.prototype.actions = $util.emptyArray; - - /** - * Tool schemas. - * @member {Array.} schemas - * @memberof google.cloud.dialogflow.cx.v3beta1.Tool - * @instance - */ - Tool.prototype.schemas = $util.emptyArray; - /** * Tool openApiSpec. * @member {google.cloud.dialogflow.cx.v3beta1.Tool.IOpenApiTool|null|undefined} openApiSpec @@ -191725,12 +191978,6 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); if (message.openApiSpec != null && Object.hasOwnProperty.call(message, "openApiSpec")) $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.encode(message.openApiSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.actions != null && message.actions.length) - for (var i = 0; i < message.actions.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.actions[i]); - if (message.schemas != null && message.schemas.length) - for (var i = 0; i < message.schemas.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.schemas[i]); if (message.dataStoreSpec != null && Object.hasOwnProperty.call(message, "dataStoreSpec")) $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.encode(message.dataStoreSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.extensionSpec != null && Object.hasOwnProperty.call(message, "extensionSpec")) @@ -191785,18 +192032,6 @@ message.description = reader.string(); break; } - case 6: { - if (!(message.actions && message.actions.length)) - message.actions = []; - message.actions.push(reader.string()); - break; - } - case 7: { - if (!(message.schemas && message.schemas.length)) - message.schemas = []; - message.schemas.push(reader.string()); - break; - } case 4: { message.openApiSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.OpenApiTool.decode(reader, reader.uint32()); break; @@ -191862,20 +192097,6 @@ if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: 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.schemas != null && message.hasOwnProperty("schemas")) { - if (!Array.isArray(message.schemas)) - return "schemas: array expected"; - for (var i = 0; i < message.schemas.length; ++i) - if (!$util.isString(message.schemas[i])) - return "schemas: string[] expected"; - } if (message.openApiSpec != null && message.hasOwnProperty("openApiSpec")) { properties.specification = 1; { @@ -191944,20 +192165,6 @@ message.displayName = String(object.displayName); if (object.description != null) message.description = String(object.description); - if (object.actions) { - if (!Array.isArray(object.actions)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.actions: array expected"); - message.actions = []; - for (var i = 0; i < object.actions.length; ++i) - message.actions[i] = String(object.actions[i]); - } - if (object.schemas) { - if (!Array.isArray(object.schemas)) - throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.schemas: array expected"); - message.schemas = []; - for (var i = 0; i < object.schemas.length; ++i) - message.schemas[i] = String(object.schemas[i]); - } if (object.openApiSpec != null) { if (typeof object.openApiSpec !== "object") throw TypeError(".google.cloud.dialogflow.cx.v3beta1.Tool.openApiSpec: object expected"); @@ -192014,10 +192221,6 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.actions = []; - object.schemas = []; - } if (options.defaults) { object.name = ""; object.displayName = ""; @@ -192035,16 +192238,6 @@ if (options.oneofs) object.specification = "openApiSpec"; } - 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.schemas && message.schemas.length) { - object.schemas = []; - for (var j = 0; j < message.schemas.length; ++j) - object.schemas[j] = message.schemas[j]; - } if (message.dataStoreSpec != null && message.hasOwnProperty("dataStoreSpec")) { object.dataStoreSpec = $root.google.cloud.dialogflow.cx.v3beta1.Tool.DataStoreTool.toObject(message.dataStoreSpec, options); if (options.oneofs) diff --git a/packages/google-cloud-dialogflow-cx/protos/protos.json b/packages/google-cloud-dialogflow-cx/protos/protos.json index 7faa1c4bef6..9f367fc40b9 100644 --- a/packages/google-cloud-dialogflow-cx/protos/protos.json +++ b/packages/google-cloud-dialogflow-cx/protos/protos.json @@ -9370,6 +9370,14 @@ "finishDigit": { "type": "string", "id": 3 + }, + "interdigitTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "endpointingTimeoutDuration": { + "type": "google.protobuf.Duration", + "id": 7 } } }, @@ -9634,6 +9642,12 @@ "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}" }, "oneofs": { + "sessionEntryResource": { + "oneof": [ + "startFlow", + "startPlaybook" + ] + }, "_genAppBuilderSettings": { "oneof": [ "genAppBuilderSettings" @@ -9687,7 +9701,6 @@ "type": "string", "id": 16, "options": { - "(google.api.field_behavior)": "IMMUTABLE", "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" } }, @@ -9695,7 +9708,6 @@ "type": "string", "id": 39, "options": { - "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "dialogflow.googleapis.com/Playbook" } }, @@ -11799,7 +11811,8 @@ "playAudio", "mixedAudio", "telephonyTransferCall", - "knowledgeInfoCard" + "knowledgeInfoCard", + "toolCall" ] } }, @@ -11850,6 +11863,10 @@ "type": "KnowledgeInfoCard", "id": 20 }, + "toolCall": { + "type": "google.cloud.dialogflow.cx.v3beta1.ToolCall", + "id": 22 + }, "channel": { "type": "string", "id": 19 @@ -11997,6 +12014,80 @@ } } }, + "ToolCall": { + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inputParameters": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ToolCallResult": { + "oneofs": { + "result": { + "oneof": [ + "error", + "outputParameters" + ] + } + }, + "fields": { + "tool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" + } + }, + "action": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "error": { + "type": "Error", + "id": 3 + }, + "outputParameters": { + "type": "google.protobuf.Struct", + "id": 4 + } + }, + "nested": { + "Error": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, "ValidationMessage": { "fields": { "resourceType": { @@ -15794,7 +15885,8 @@ "PARAMETER_FILLING": 3, "NO_MATCH": 4, "NO_INPUT": 5, - "EVENT": 6 + "EVENT": 6, + "PLAYBOOK": 9 } } } @@ -16219,10 +16311,9 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "parameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 2, + "actionParameters": { + "type": "google.protobuf.Struct", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } @@ -16238,10 +16329,9 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "parameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 3, + "actionParameters": { + "type": "google.protobuf.Struct", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } @@ -16337,32 +16427,18 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "inputParameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 3 - }, - "outputParameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 4 - } - } - }, - "ActionParameter": { - "fields": { - "name": { - "type": "string", - "id": 1, + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 5, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "value": { - "type": "google.protobuf.Value", - "id": 2, + "outputActionParameters": { + "type": "google.protobuf.Struct", + "id": 6, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -16410,15 +16486,19 @@ "(google.api.resource_reference).type": "dialogflow.googleapis.com/Flow" } }, - "inputParameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 2 + "inputActionParameters": { + "type": "google.protobuf.Struct", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "outputParameters": { - "rule": "repeated", - "type": "ActionParameter", - "id": 3 + "outputActionParameters": { + "type": "google.protobuf.Struct", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "flowState": { "type": "OutputState", @@ -17228,54 +17308,6 @@ } } }, - "ToolCallResult": { - "oneofs": { - "result": { - "oneof": [ - "error", - "outputParameters" - ] - } - }, - "fields": { - "tool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Tool" - } - }, - "action": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "error": { - "type": "Error", - "id": 3 - }, - "outputParameters": { - "type": "google.protobuf.Struct", - "id": 4 - } - }, - "nested": { - "Error": { - "fields": { - "message": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, "TransitionRouteGroups": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", @@ -19578,10 +19610,9 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "steps": { - "rule": "repeated", - "type": "Step", - "id": 4 + "instruction": { + "type": "Instruction", + "id": 17 }, "tokenCount": { "type": "int64", @@ -19659,6 +19690,15 @@ "id": 2 } } + }, + "Instruction": { + "fields": { + "steps": { + "rule": "repeated", + "type": "Step", + "id": 2 + } + } } } }, @@ -20094,6 +20134,10 @@ "audioFormat": { "type": "AudioFormat", "id": 4 + }, + "storeTtsAudio": { + "type": "bool", + "id": 6 } }, "nested": { @@ -20451,22 +20495,6 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "actions": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "schemas": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "deprecated": true - } - }, "openApiSpec": { "type": "OpenApiTool", "id": 4 diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json b/packages/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json index 91e654b30aa..d50fe0ab6ce 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/examples_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -21,23 +24,28 @@ }, "methods": { "CreateExample": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "DeleteExample": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ListExamples": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "GetExample": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "UpdateExample": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" } } diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json b/packages/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json index 4727c84572b..d73da58dde9 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/playbooks_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -21,39 +24,48 @@ }, "methods": { "CreatePlaybook": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "DeletePlaybook": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ListPlaybooks": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "GetPlaybook": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "UpdatePlaybook": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "CreatePlaybookVersion": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "GetPlaybookVersion": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ListPlaybookVersions": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "DeletePlaybookVersion": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" } } diff --git a/packages/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json b/packages/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json index 8d897d82ef7..a2d6ea26b1b 100644 --- a/packages/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json +++ b/packages/google-cloud-dialogflow-cx/src/v3beta1/tools_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -21,27 +24,33 @@ }, "methods": { "CreateTool": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ListTools": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "ExportTools": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "GetTool": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "UpdateTool": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" }, "DeleteTool": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 60000, + "retry_codes_name": "unavailable", "retry_params_name": "default" } } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto index a5571cc1879..793a560086d 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -212,7 +212,11 @@ service DocumentProcessorService { // Creates a processor from the // [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The - // processor will be at `ENABLED` state by default after its creation. + // processor will be at `ENABLED` state by default after its creation. Note + // that this method requires the `documentai.processors.create` permission on + // the project, which is highly privileged. A user or service account with + // this permission can create new processors that can interact with any gcs + // bucket in your project. rpc CreateProcessor(CreateProcessorRequest) returns (Processor) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/processors" diff --git a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json index 1752e378815..3bda75e6424 100644 --- a/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json +++ b/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json @@ -631,7 +631,7 @@ "regionTag": "documentai_v1_generated_DocumentProcessorService_CreateProcessor_async", "title": "DocumentProcessorService createProcessor Sample", "origin": "API_DEFINITION", - "description": " Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The processor will be at `ENABLED` state by default after its creation.", + "description": " Creates a processor from the [ProcessorType][google.cloud.documentai.v1.ProcessorType] provided. The processor will be at `ENABLED` state by default after its creation. Note that this method requires the `documentai.processors.create` permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.", "canonical": true, "file": "document_processor_service.create_processor.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts index 1c4deff91a5..1f3ada45d29 100644 --- a/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts +++ b/packages/google-cloud-documentai/src/v1/document_processor_service_client.ts @@ -1129,7 +1129,11 @@ export class DocumentProcessorServiceClient { /** * Creates a processor from the * {@link protos.google.cloud.documentai.v1.ProcessorType|ProcessorType} provided. The - * processor will be at `ENABLED` state by default after its creation. + * processor will be at `ENABLED` state by default after its creation. Note + * that this method requires the `documentai.processors.create` permission on + * the project, which is highly privileged. A user or service account with + * this permission can create new processors that can interact with any gcs + * bucket in your project. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-edgenetwork/CHANGELOG.md b/packages/google-cloud-edgenetwork/CHANGELOG.md index 317289e0918..e5abd1f6342 100644 --- a/packages/google-cloud-edgenetwork/CHANGELOG.md +++ b/packages/google-cloud-edgenetwork/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/edgenetwork-v0.5.0...edgenetwork-v0.6.0) (2024-06-26) + + +### Features + +* [edgenetwork] A new field `bonding_type` is added to message `.google.cloud.edgenetwork.v1.Subnet` ([#5505](https://github.com/googleapis/google-cloud-node/issues/5505)) ([04e52ae](https://github.com/googleapis/google-cloud-node/commit/04e52ae670c14b47c80635a90761b3ee7fcd35c3)) + ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/edgenetwork-v0.4.0...edgenetwork-v0.5.0) (2024-05-21) diff --git a/packages/google-cloud-edgenetwork/package.json b/packages/google-cloud-edgenetwork/package.json index 714974c8e3a..89305c001be 100644 --- a/packages/google-cloud-edgenetwork/package.json +++ b/packages/google-cloud-edgenetwork/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/edgenetwork", - "version": "0.5.0", + "version": "0.6.0", "description": "Distributed Cloud Edge Network API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-edgenetwork/protos/google/cloud/edgenetwork/v1/resources.proto b/packages/google-cloud-edgenetwork/protos/google/cloud/edgenetwork/v1/resources.proto index a910c92bddf..254dfade62b 100644 --- a/packages/google-cloud-edgenetwork/protos/google/cloud/edgenetwork/v1/resources.proto +++ b/packages/google-cloud-edgenetwork/protos/google/cloud/edgenetwork/v1/resources.proto @@ -118,6 +118,22 @@ message Subnet { pattern: "projects/{project}/locations/{location}/zones/{zone}/subnets/{subnet}" }; + // Bonding type in the subnet. + enum BondingType { + // Unspecified + // Bonding type will be unspecified by default and if the user chooses to + // not specify a bonding type at time of creating the VLAN. This will be + // treated as mixed bonding where the VLAN will have both bonded and + // non-bonded connectivity to machines. + BONDING_TYPE_UNSPECIFIED = 0; + + // Single homed. + BONDED = 1; + + // Multi homed. + NON_BONDED = 2; + } + // Required. The canonical resource name of the subnet. string name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -154,6 +170,13 @@ message Subnet { // automatically. int32 vlan_id = 9 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A bonding type in the subnet creation specifies whether a VLAN + // being created will be present on Bonded or Non-Bonded or Both port types. + // In addition, this flag is to be used to set the specific network + // configuration which clusters can then use for their workloads based on the + // bonding choice. + BondingType bonding_type = 11 [(google.api.field_behavior) = OPTIONAL]; + // Output only. Current stage of the resource to the device by config push. ResourceState state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-edgenetwork/protos/protos.d.ts b/packages/google-cloud-edgenetwork/protos/protos.d.ts index 7c7e79a0dfc..b52ef7e9662 100644 --- a/packages/google-cloud-edgenetwork/protos/protos.d.ts +++ b/packages/google-cloud-edgenetwork/protos/protos.d.ts @@ -314,6 +314,9 @@ export namespace google { /** Subnet vlanId */ vlanId?: (number|null); + /** Subnet bondingType */ + bondingType?: (google.cloud.edgenetwork.v1.Subnet.BondingType|keyof typeof google.cloud.edgenetwork.v1.Subnet.BondingType|null); + /** Subnet state */ state?: (google.cloud.edgenetwork.v1.ResourceState|keyof typeof google.cloud.edgenetwork.v1.ResourceState|null); } @@ -354,6 +357,9 @@ export namespace google { /** Subnet vlanId. */ public vlanId: number; + /** Subnet bondingType. */ + public bondingType: (google.cloud.edgenetwork.v1.Subnet.BondingType|keyof typeof google.cloud.edgenetwork.v1.Subnet.BondingType); + /** Subnet state. */ public state: (google.cloud.edgenetwork.v1.ResourceState|keyof typeof google.cloud.edgenetwork.v1.ResourceState); @@ -435,6 +441,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Subnet { + + /** BondingType enum. */ + enum BondingType { + BONDING_TYPE_UNSPECIFIED = 0, + BONDED = 1, + NON_BONDED = 2 + } + } + /** Properties of an Interconnect. */ interface IInterconnect { diff --git a/packages/google-cloud-edgenetwork/protos/protos.js b/packages/google-cloud-edgenetwork/protos/protos.js index 904b170c526..9e70ff1c564 100644 --- a/packages/google-cloud-edgenetwork/protos/protos.js +++ b/packages/google-cloud-edgenetwork/protos/protos.js @@ -810,6 +810,7 @@ * @property {Array.|null} [ipv4Cidr] Subnet ipv4Cidr * @property {Array.|null} [ipv6Cidr] Subnet ipv6Cidr * @property {number|null} [vlanId] Subnet vlanId + * @property {google.cloud.edgenetwork.v1.Subnet.BondingType|null} [bondingType] Subnet bondingType * @property {google.cloud.edgenetwork.v1.ResourceState|null} [state] Subnet state */ @@ -903,6 +904,14 @@ */ Subnet.prototype.vlanId = 0; + /** + * Subnet bondingType. + * @member {google.cloud.edgenetwork.v1.Subnet.BondingType} bondingType + * @memberof google.cloud.edgenetwork.v1.Subnet + * @instance + */ + Subnet.prototype.bondingType = 0; + /** * Subnet state. * @member {google.cloud.edgenetwork.v1.ResourceState} state @@ -958,6 +967,8 @@ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.vlanId); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.bondingType != null && Object.hasOwnProperty.call(message, "bondingType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.bondingType); return writer; }; @@ -1051,6 +1062,10 @@ message.vlanId = reader.int32(); break; } + case 11: { + message.bondingType = reader.int32(); + break; + } case 10: { message.state = reader.int32(); break; @@ -1134,6 +1149,15 @@ if (message.vlanId != null && message.hasOwnProperty("vlanId")) if (!$util.isInteger(message.vlanId)) return "vlanId: integer expected"; + if (message.bondingType != null && message.hasOwnProperty("bondingType")) + switch (message.bondingType) { + default: + return "bondingType: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: @@ -1200,6 +1224,26 @@ } if (object.vlanId != null) message.vlanId = object.vlanId | 0; + switch (object.bondingType) { + default: + if (typeof object.bondingType === "number") { + message.bondingType = object.bondingType; + break; + } + break; + case "BONDING_TYPE_UNSPECIFIED": + case 0: + message.bondingType = 0; + break; + case "BONDED": + case 1: + message.bondingType = 1; + break; + case "NON_BONDED": + case 2: + message.bondingType = 2; + break; + } switch (object.state) { default: if (typeof object.state === "number") { @@ -1262,6 +1306,7 @@ object.network = ""; object.vlanId = 0; object.state = options.enums === String ? "STATE_UNKNOWN" : 0; + object.bondingType = options.enums === String ? "BONDING_TYPE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1293,6 +1338,8 @@ object.vlanId = message.vlanId; if (message.state != null && message.hasOwnProperty("state")) object.state = options.enums === String ? $root.google.cloud.edgenetwork.v1.ResourceState[message.state] === undefined ? message.state : $root.google.cloud.edgenetwork.v1.ResourceState[message.state] : message.state; + if (message.bondingType != null && message.hasOwnProperty("bondingType")) + object.bondingType = options.enums === String ? $root.google.cloud.edgenetwork.v1.Subnet.BondingType[message.bondingType] === undefined ? message.bondingType : $root.google.cloud.edgenetwork.v1.Subnet.BondingType[message.bondingType] : message.bondingType; return object; }; @@ -1322,6 +1369,22 @@ return typeUrlPrefix + "/google.cloud.edgenetwork.v1.Subnet"; }; + /** + * BondingType enum. + * @name google.cloud.edgenetwork.v1.Subnet.BondingType + * @enum {number} + * @property {number} BONDING_TYPE_UNSPECIFIED=0 BONDING_TYPE_UNSPECIFIED value + * @property {number} BONDED=1 BONDED value + * @property {number} NON_BONDED=2 NON_BONDED value + */ + Subnet.BondingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BONDING_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BONDED"] = 1; + values[valuesById[2] = "NON_BONDED"] = 2; + return values; + })(); + return Subnet; })(); diff --git a/packages/google-cloud-edgenetwork/protos/protos.json b/packages/google-cloud-edgenetwork/protos/protos.json index 8a1c144b9c0..8bb7d032636 100644 --- a/packages/google-cloud-edgenetwork/protos/protos.json +++ b/packages/google-cloud-edgenetwork/protos/protos.json @@ -180,6 +180,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "bondingType": { + "type": "BondingType", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "state": { "type": "ResourceState", "id": 10, @@ -187,6 +194,15 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } } + }, + "nested": { + "BondingType": { + "values": { + "BONDING_TYPE_UNSPECIFIED": 0, + "BONDED": 1, + "NON_BONDED": 2 + } + } } }, "Interconnect": { diff --git a/packages/google-cloud-edgenetwork/samples/generated/v1/snippet_metadata_google.cloud.edgenetwork.v1.json b/packages/google-cloud-edgenetwork/samples/generated/v1/snippet_metadata_google.cloud.edgenetwork.v1.json index fb153e198ee..354ad7a41d0 100644 --- a/packages/google-cloud-edgenetwork/samples/generated/v1/snippet_metadata_google.cloud.edgenetwork.v1.json +++ b/packages/google-cloud-edgenetwork/samples/generated/v1/snippet_metadata_google.cloud.edgenetwork.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-edgenetwork", - "version": "0.5.0", + "version": "0.6.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-edgenetwork/samples/package.json b/packages/google-cloud-edgenetwork/samples/package.json index 8d9291ea3cd..727d936d91f 100644 --- a/packages/google-cloud-edgenetwork/samples/package.json +++ b/packages/google-cloud-edgenetwork/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/edgenetwork": "^0.5.0" + "@google-cloud/edgenetwork": "^0.6.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-gkehub/CHANGELOG.md b/packages/google-cloud-gkehub/CHANGELOG.md index 92712e73776..6709189a4c9 100644 --- a/packages/google-cloud-gkehub/CHANGELOG.md +++ b/packages/google-cloud-gkehub/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.5.0](https://github.com/googleapis/google-cloud-node/compare/gke-hub-v4.4.0...gke-hub-v4.5.0) (2024-06-26) + + +### Features + +* [gkehub] add a new field `PENDING` under `DeploymentState` enum ([#5472](https://github.com/googleapis/google-cloud-node/issues/5472)) ([dc87003](https://github.com/googleapis/google-cloud-node/commit/dc87003cc97da35701fca6127f41cfc088c5a99d)) + ## [4.4.0](https://github.com/googleapis/google-cloud-node/compare/gke-hub-v4.3.0...gke-hub-v4.4.0) (2024-05-23) diff --git a/packages/google-cloud-gkehub/package.json b/packages/google-cloud-gkehub/package.json index b836c741130..3590a98e855 100644 --- a/packages/google-cloud-gkehub/package.json +++ b/packages/google-cloud-gkehub/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/gke-hub", - "version": "4.4.0", + "version": "4.5.0", "description": "Gkehub client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-gkehub/protos/google/cloud/gkehub/v1/configmanagement/configmanagement.proto b/packages/google-cloud-gkehub/protos/google/cloud/gkehub/v1/configmanagement/configmanagement.proto index 8d69e97d8ba..dbfa47fdf39 100644 --- a/packages/google-cloud-gkehub/protos/google/cloud/gkehub/v1/configmanagement/configmanagement.proto +++ b/packages/google-cloud-gkehub/protos/google/cloud/gkehub/v1/configmanagement/configmanagement.proto @@ -39,15 +39,15 @@ enum DeploymentState { // Deployment was attempted to be installed, but has errors ERROR = 3; + + // Deployment is installing or terminating + PENDING = 4; } // **Anthos Config Management**: State for a single cluster. message MembershipState { - // The user-defined name for the cluster used by ClusterSelectors to group - // clusters together. This should match Membership's membership_name, - // unless the user installed ACM on the cluster manually prior to enabling - // the ACM hub feature. - // Unique within a Anthos Config Management installation. + // This field is set to the `cluster_name` field of the Membership Spec if it + // is not empty. Otherwise, it is set to the cluster's fleet membership name. string cluster_name = 1; // Membership configuration in the cluster. This represents the actual state @@ -71,6 +71,18 @@ message MembershipState { // **Anthos Config Management**: Configuration for a single cluster. // Intended to parallel the ConfigManagement CR. message MembershipSpec { + // Whether to automatically manage the Feature. + enum Management { + // Unspecified + MANAGEMENT_UNSPECIFIED = 0; + + // Google will manage the Feature for the cluster. + MANAGEMENT_AUTOMATIC = 1; + + // User will manually manage the Feature for the cluster. + MANAGEMENT_MANUAL = 2; + } + // Config Sync configuration for the cluster. ConfigSync config_sync = 1; @@ -82,6 +94,18 @@ message MembershipSpec { // Version of ACM installed. string version = 10; + + // The user-specified cluster name used by Config Sync cluster-name-selector + // annotation or ClusterSelector, for applying configs to only a subset + // of clusters. + // Omit this field if the cluster's fleet membership name is used by Config + // Sync cluster-name-selector annotation or ClusterSelector. + // Set this field if a name different from the cluster's fleet membership name + // is used by Config Sync cluster-name-selector annotation or ClusterSelector. + string cluster = 11; + + // Enables automatic Feature management. + Management management = 12; } // Configuration for Config Sync @@ -90,8 +114,33 @@ message ConfigSync { GitConfig git = 7; // Specifies whether the Config Sync Repo is - // in “hierarchical” or “unstructured” mode. + // in "hierarchical" or "unstructured" mode. string source_format = 8; + + // Enables the installation of ConfigSync. + // If set to true, ConfigSync resources will be created and the other + // ConfigSync fields will be applied if exist. + // If set to false, all other ConfigSync fields will be ignored, ConfigSync + // resources will be deleted. + // If omitted, ConfigSync resources will be managed depends on the presence + // of the git or oci field. + optional bool enabled = 10; + + // Set to true to enable the Config Sync admission webhook to prevent drifts. + // If set to `false`, disables the Config Sync admission webhook and does not + // prevent drifts. + bool prevent_drift = 11; + + // OCI repo configuration for the cluster + OciConfig oci = 12; + + // The Email of the Google Cloud Service Account (GSA) used for exporting + // Config Sync metrics to Cloud Monitoring when Workload Identity is enabled. + // The GSA should have the Monitoring Metric Writer + // (roles/monitoring.metricWriter) IAM role. + // The Kubernetes ServiceAccount `default` in the namespace + // `config-management-monitoring` should be bound to the GSA. + string metrics_gcp_service_account_email = 15; } // Git repo configuration for a single cluster. @@ -112,17 +161,40 @@ message GitConfig { // Git revision (tag or hash) to check out. Default HEAD. string sync_rev = 5; - // Type of secret configured for access to the Git repo. + // Type of secret configured for access to the Git repo. Must be one of ssh, + // cookiefile, gcenode, token, gcpserviceaccount or none. The + // validation of this is case-sensitive. Required. string secret_type = 6; // URL for the HTTPS proxy to be used when communicating with the Git repo. string https_proxy = 7; - // The GCP Service Account Email used for auth when secret_type is + // The Google Cloud Service Account Email used for auth when secret_type is // gcpServiceAccount. string gcp_service_account_email = 8; } +// OCI repo configuration for a single cluster +message OciConfig { + // The OCI image repository URL for the package to sync from. + // e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`. + string sync_repo = 1; + + // The absolute path of the directory that contains + // the local resources. Default: the root directory of the image. + string policy_dir = 2; + + // Period in seconds between consecutive syncs. Default: 15. + int64 sync_wait_secs = 3; + + // Type of secret configured for access to the Git repo. + string secret_type = 4; + + // The Google Cloud Service Account Email used for auth when secret_type is + // gcpServiceAccount. + string gcp_service_account_email = 5; +} + // Configuration for Policy Controller message PolicyController { // Enables the installation of Policy Controller. @@ -208,6 +280,41 @@ message InstallError { // State information for ConfigSync message ConfigSyncState { + // CRDState representing the state of a CRD + enum CRDState { + // CRD's state cannot be determined + CRD_STATE_UNSPECIFIED = 0; + + // CRD is not installed + NOT_INSTALLED = 1; + + // CRD is installed + INSTALLED = 2; + + // CRD is terminating (i.e., it has been deleted and is cleaning up) + TERMINATING = 3; + + // CRD is installing + INSTALLING = 4; + } + + enum State { + // CS's state cannot be determined. + STATE_UNSPECIFIED = 0; + + // CS is not installed. + CONFIG_SYNC_NOT_INSTALLED = 1; + + // The expected CS version is installed successfully. + CONFIG_SYNC_INSTALLED = 2; + + // CS encounters errors. + CONFIG_SYNC_ERROR = 3; + + // CS is installing or terminating. + CONFIG_SYNC_PENDING = 4; + } + // The version of ConfigSync deployed ConfigSyncVersion version = 1; @@ -217,6 +324,25 @@ message ConfigSyncState { // The state of ConfigSync's process to sync configs to a cluster SyncState sync_state = 3; + + // Errors pertaining to the installation of Config Sync. + repeated ConfigSyncError errors = 4; + + // The state of the RootSync CRD + CRDState rootsync_crd = 5; + + // The state of the Reposync CRD + CRDState reposync_crd = 6; + + // The state of CS + // This field summarizes the other fields in this message. + State state = 7; +} + +// Errors pertaining to the installation of Config Sync +message ConfigSyncError { + // A string representing the user facing error message + string error_message = 1; } // Specific versioning information pertaining to ConfigSync's Pods @@ -238,6 +364,9 @@ message ConfigSyncVersion { // Version of the deployed reconciler container in root-reconciler pod string root_reconciler = 6; + + // Version of the deployed admission_webhook pod + string admission_webhook = 7; } // The state of ConfigSync's deployment on a cluster @@ -259,29 +388,31 @@ message ConfigSyncDeploymentState { // Deployment state of root-reconciler DeploymentState root_reconciler = 6; + + // Deployment state of admission-webhook + DeploymentState admission_webhook = 7; } // State indicating an ACM's progress syncing configurations to a cluster message SyncState { - // An enum representing an ACM's status syncing configs to a cluster + // An enum representing Config Sync's status of syncing configs to a cluster. enum SyncCode { - // ACM cannot determine a sync code + // Config Sync cannot determine a sync code SYNC_CODE_UNSPECIFIED = 0; - // ACM successfully synced the git Repo with the cluster + // Config Sync successfully synced the git Repo with the cluster SYNCED = 1; - // ACM is in the progress of syncing a new change + // Config Sync is in the progress of syncing a new change PENDING = 2; - // Indicates an error configuring ACM, and user action is required + // Indicates an error configuring Config Sync, and user action is required ERROR = 3; - // ACM has been installed (operator manifest deployed), - // but not configured. + // Config Sync has been installed but not configured NOT_CONFIGURED = 4; - // ACM has not been installed (no operator pod found) + // Config Sync has not been installed NOT_INSTALLED = 5; // Error authorizing with the cluster diff --git a/packages/google-cloud-gkehub/protos/protos.d.ts b/packages/google-cloud-gkehub/protos/protos.d.ts index b3089c20192..be4fa1c2ee0 100644 --- a/packages/google-cloud-gkehub/protos/protos.d.ts +++ b/packages/google-cloud-gkehub/protos/protos.d.ts @@ -4969,7 +4969,8 @@ export namespace google { DEPLOYMENT_STATE_UNSPECIFIED = 0, NOT_INSTALLED = 1, INSTALLED = 2, - ERROR = 3 + ERROR = 3, + PENDING = 4 } /** Properties of a MembershipState. */ @@ -5113,6 +5114,12 @@ export namespace google { /** MembershipSpec version */ version?: (string|null); + + /** MembershipSpec cluster */ + cluster?: (string|null); + + /** MembershipSpec management */ + management?: (google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management|keyof typeof google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management|null); } /** Represents a MembershipSpec. */ @@ -5136,6 +5143,12 @@ export namespace google { /** MembershipSpec version. */ public version: string; + /** MembershipSpec cluster. */ + public cluster: string; + + /** MembershipSpec management. */ + public management: (google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management|keyof typeof google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management); + /** * Creates a new MembershipSpec instance using the specified properties. * @param [properties] Properties to set @@ -5214,6 +5227,16 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace MembershipSpec { + + /** Management enum. */ + enum Management { + MANAGEMENT_UNSPECIFIED = 0, + MANAGEMENT_AUTOMATIC = 1, + MANAGEMENT_MANUAL = 2 + } + } + /** Properties of a ConfigSync. */ interface IConfigSync { @@ -5222,6 +5245,18 @@ export namespace google { /** ConfigSync sourceFormat */ sourceFormat?: (string|null); + + /** ConfigSync enabled */ + enabled?: (boolean|null); + + /** ConfigSync preventDrift */ + preventDrift?: (boolean|null); + + /** ConfigSync oci */ + oci?: (google.cloud.gkehub.configmanagement.v1.IOciConfig|null); + + /** ConfigSync metricsGcpServiceAccountEmail */ + metricsGcpServiceAccountEmail?: (string|null); } /** Represents a ConfigSync. */ @@ -5239,6 +5274,21 @@ export namespace google { /** ConfigSync sourceFormat. */ public sourceFormat: string; + /** ConfigSync enabled. */ + public enabled?: (boolean|null); + + /** ConfigSync preventDrift. */ + public preventDrift: boolean; + + /** ConfigSync oci. */ + public oci?: (google.cloud.gkehub.configmanagement.v1.IOciConfig|null); + + /** ConfigSync metricsGcpServiceAccountEmail. */ + public metricsGcpServiceAccountEmail: string; + + /** ConfigSync _enabled. */ + public _enabled?: "enabled"; + /** * Creates a new ConfigSync instance using the specified properties. * @param [properties] Properties to set @@ -5456,6 +5506,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an OciConfig. */ + interface IOciConfig { + + /** OciConfig syncRepo */ + syncRepo?: (string|null); + + /** OciConfig policyDir */ + policyDir?: (string|null); + + /** OciConfig syncWaitSecs */ + syncWaitSecs?: (number|Long|string|null); + + /** OciConfig secretType */ + secretType?: (string|null); + + /** OciConfig gcpServiceAccountEmail */ + gcpServiceAccountEmail?: (string|null); + } + + /** Represents an OciConfig. */ + class OciConfig implements IOciConfig { + + /** + * Constructs a new OciConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkehub.configmanagement.v1.IOciConfig); + + /** OciConfig syncRepo. */ + public syncRepo: string; + + /** OciConfig policyDir. */ + public policyDir: string; + + /** OciConfig syncWaitSecs. */ + public syncWaitSecs: (number|Long|string); + + /** OciConfig secretType. */ + public secretType: string; + + /** OciConfig gcpServiceAccountEmail. */ + public gcpServiceAccountEmail: string; + + /** + * Creates a new OciConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OciConfig instance + */ + public static create(properties?: google.cloud.gkehub.configmanagement.v1.IOciConfig): google.cloud.gkehub.configmanagement.v1.OciConfig; + + /** + * Encodes the specified OciConfig message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.OciConfig.verify|verify} messages. + * @param message OciConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkehub.configmanagement.v1.IOciConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OciConfig message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.OciConfig.verify|verify} messages. + * @param message OciConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkehub.configmanagement.v1.IOciConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OciConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OciConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkehub.configmanagement.v1.OciConfig; + + /** + * Decodes an OciConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OciConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkehub.configmanagement.v1.OciConfig; + + /** + * Verifies an OciConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OciConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OciConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkehub.configmanagement.v1.OciConfig; + + /** + * Creates a plain object from an OciConfig message. Also converts values to other types if specified. + * @param message OciConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkehub.configmanagement.v1.OciConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OciConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OciConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PolicyController. */ interface IPolicyController { @@ -6224,6 +6395,18 @@ export namespace google { /** ConfigSyncState syncState */ syncState?: (google.cloud.gkehub.configmanagement.v1.ISyncState|null); + + /** ConfigSyncState errors */ + errors?: (google.cloud.gkehub.configmanagement.v1.IConfigSyncError[]|null); + + /** ConfigSyncState rootsyncCrd */ + rootsyncCrd?: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|null); + + /** ConfigSyncState reposyncCrd */ + reposyncCrd?: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|null); + + /** ConfigSyncState state */ + state?: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State|null); } /** Represents a ConfigSyncState. */ @@ -6244,6 +6427,18 @@ export namespace google { /** ConfigSyncState syncState. */ public syncState?: (google.cloud.gkehub.configmanagement.v1.ISyncState|null); + /** ConfigSyncState errors. */ + public errors: google.cloud.gkehub.configmanagement.v1.IConfigSyncError[]; + + /** ConfigSyncState rootsyncCrd. */ + public rootsyncCrd: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState); + + /** ConfigSyncState reposyncCrd. */ + public reposyncCrd: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState); + + /** ConfigSyncState state. */ + public state: (google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State|keyof typeof google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State); + /** * Creates a new ConfigSyncState instance using the specified properties. * @param [properties] Properties to set @@ -6322,6 +6517,124 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace ConfigSyncState { + + /** CRDState enum. */ + enum CRDState { + CRD_STATE_UNSPECIFIED = 0, + NOT_INSTALLED = 1, + INSTALLED = 2, + TERMINATING = 3, + INSTALLING = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CONFIG_SYNC_NOT_INSTALLED = 1, + CONFIG_SYNC_INSTALLED = 2, + CONFIG_SYNC_ERROR = 3, + CONFIG_SYNC_PENDING = 4 + } + } + + /** Properties of a ConfigSyncError. */ + interface IConfigSyncError { + + /** ConfigSyncError errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a ConfigSyncError. */ + class ConfigSyncError implements IConfigSyncError { + + /** + * Constructs a new ConfigSyncError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gkehub.configmanagement.v1.IConfigSyncError); + + /** ConfigSyncError errorMessage. */ + public errorMessage: string; + + /** + * Creates a new ConfigSyncError instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigSyncError instance + */ + public static create(properties?: google.cloud.gkehub.configmanagement.v1.IConfigSyncError): google.cloud.gkehub.configmanagement.v1.ConfigSyncError; + + /** + * Encodes the specified ConfigSyncError message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncError.verify|verify} messages. + * @param message ConfigSyncError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gkehub.configmanagement.v1.IConfigSyncError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigSyncError message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncError.verify|verify} messages. + * @param message ConfigSyncError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gkehub.configmanagement.v1.IConfigSyncError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigSyncError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigSyncError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gkehub.configmanagement.v1.ConfigSyncError; + + /** + * Decodes a ConfigSyncError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigSyncError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gkehub.configmanagement.v1.ConfigSyncError; + + /** + * Verifies a ConfigSyncError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigSyncError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigSyncError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gkehub.configmanagement.v1.ConfigSyncError; + + /** + * Creates a plain object from a ConfigSyncError message. Also converts values to other types if specified. + * @param message ConfigSyncError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gkehub.configmanagement.v1.ConfigSyncError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigSyncError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigSyncError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ConfigSyncVersion. */ interface IConfigSyncVersion { @@ -6342,6 +6655,9 @@ export namespace google { /** ConfigSyncVersion rootReconciler */ rootReconciler?: (string|null); + + /** ConfigSyncVersion admissionWebhook */ + admissionWebhook?: (string|null); } /** Represents a ConfigSyncVersion. */ @@ -6371,6 +6687,9 @@ export namespace google { /** ConfigSyncVersion rootReconciler. */ public rootReconciler: string; + /** ConfigSyncVersion admissionWebhook. */ + public admissionWebhook: string; + /** * Creates a new ConfigSyncVersion instance using the specified properties. * @param [properties] Properties to set @@ -6469,6 +6788,9 @@ export namespace google { /** ConfigSyncDeploymentState rootReconciler */ rootReconciler?: (google.cloud.gkehub.configmanagement.v1.DeploymentState|keyof typeof google.cloud.gkehub.configmanagement.v1.DeploymentState|null); + + /** ConfigSyncDeploymentState admissionWebhook */ + admissionWebhook?: (google.cloud.gkehub.configmanagement.v1.DeploymentState|keyof typeof google.cloud.gkehub.configmanagement.v1.DeploymentState|null); } /** Represents a ConfigSyncDeploymentState. */ @@ -6498,6 +6820,9 @@ export namespace google { /** ConfigSyncDeploymentState rootReconciler. */ public rootReconciler: (google.cloud.gkehub.configmanagement.v1.DeploymentState|keyof typeof google.cloud.gkehub.configmanagement.v1.DeploymentState); + /** ConfigSyncDeploymentState admissionWebhook. */ + public admissionWebhook: (google.cloud.gkehub.configmanagement.v1.DeploymentState|keyof typeof google.cloud.gkehub.configmanagement.v1.DeploymentState); + /** * Creates a new ConfigSyncDeploymentState instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-gkehub/protos/protos.js b/packages/google-cloud-gkehub/protos/protos.js index a05d789cd86..62e83f107d5 100644 --- a/packages/google-cloud-gkehub/protos/protos.js +++ b/packages/google-cloud-gkehub/protos/protos.js @@ -14096,6 +14096,7 @@ * @property {number} NOT_INSTALLED=1 NOT_INSTALLED value * @property {number} INSTALLED=2 INSTALLED value * @property {number} ERROR=3 ERROR value + * @property {number} PENDING=4 PENDING value */ v1.DeploymentState = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -14103,6 +14104,7 @@ values[valuesById[1] = "NOT_INSTALLED"] = 1; values[valuesById[2] = "INSTALLED"] = 2; values[valuesById[3] = "ERROR"] = 3; + values[valuesById[4] = "PENDING"] = 4; return values; })(); @@ -14460,6 +14462,8 @@ * @property {google.cloud.gkehub.configmanagement.v1.IPolicyController|null} [policyController] MembershipSpec policyController * @property {google.cloud.gkehub.configmanagement.v1.IHierarchyControllerConfig|null} [hierarchyController] MembershipSpec hierarchyController * @property {string|null} [version] MembershipSpec version + * @property {string|null} [cluster] MembershipSpec cluster + * @property {google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management|null} [management] MembershipSpec management */ /** @@ -14509,6 +14513,22 @@ */ MembershipSpec.prototype.version = ""; + /** + * MembershipSpec cluster. + * @member {string} cluster + * @memberof google.cloud.gkehub.configmanagement.v1.MembershipSpec + * @instance + */ + MembershipSpec.prototype.cluster = ""; + + /** + * MembershipSpec management. + * @member {google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management} management + * @memberof google.cloud.gkehub.configmanagement.v1.MembershipSpec + * @instance + */ + MembershipSpec.prototype.management = 0; + /** * Creates a new MembershipSpec instance using the specified properties. * @function create @@ -14541,6 +14561,10 @@ $root.google.cloud.gkehub.configmanagement.v1.HierarchyControllerConfig.encode(message.hierarchyController, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.version); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.cluster); + if (message.management != null && Object.hasOwnProperty.call(message, "management")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.management); return writer; }; @@ -14591,6 +14615,14 @@ message.version = reader.string(); break; } + case 11: { + message.cluster = reader.string(); + break; + } + case 12: { + message.management = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -14644,6 +14676,18 @@ if (message.version != null && message.hasOwnProperty("version")) if (!$util.isString(message.version)) return "version: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.management != null && message.hasOwnProperty("management")) + switch (message.management) { + default: + return "management: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -14676,6 +14720,28 @@ } if (object.version != null) message.version = String(object.version); + if (object.cluster != null) + message.cluster = String(object.cluster); + switch (object.management) { + default: + if (typeof object.management === "number") { + message.management = object.management; + break; + } + break; + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.management = 0; + break; + case "MANAGEMENT_AUTOMATIC": + case 1: + message.management = 1; + break; + case "MANAGEMENT_MANUAL": + case 2: + message.management = 2; + break; + } return message; }; @@ -14697,6 +14763,8 @@ object.policyController = null; object.hierarchyController = null; object.version = ""; + object.cluster = ""; + object.management = options.enums === String ? "MANAGEMENT_UNSPECIFIED" : 0; } if (message.configSync != null && message.hasOwnProperty("configSync")) object.configSync = $root.google.cloud.gkehub.configmanagement.v1.ConfigSync.toObject(message.configSync, options); @@ -14706,6 +14774,10 @@ object.hierarchyController = $root.google.cloud.gkehub.configmanagement.v1.HierarchyControllerConfig.toObject(message.hierarchyController, options); if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.management != null && message.hasOwnProperty("management")) + object.management = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management[message.management] === undefined ? message.management : $root.google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management[message.management] : message.management; return object; }; @@ -14735,6 +14807,22 @@ return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.MembershipSpec"; }; + /** + * Management enum. + * @name google.cloud.gkehub.configmanagement.v1.MembershipSpec.Management + * @enum {number} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} MANAGEMENT_AUTOMATIC=1 MANAGEMENT_AUTOMATIC value + * @property {number} MANAGEMENT_MANUAL=2 MANAGEMENT_MANUAL value + */ + MembershipSpec.Management = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MANAGEMENT_AUTOMATIC"] = 1; + values[valuesById[2] = "MANAGEMENT_MANUAL"] = 2; + return values; + })(); + return MembershipSpec; })(); @@ -14746,6 +14834,10 @@ * @interface IConfigSync * @property {google.cloud.gkehub.configmanagement.v1.IGitConfig|null} [git] ConfigSync git * @property {string|null} [sourceFormat] ConfigSync sourceFormat + * @property {boolean|null} [enabled] ConfigSync enabled + * @property {boolean|null} [preventDrift] ConfigSync preventDrift + * @property {google.cloud.gkehub.configmanagement.v1.IOciConfig|null} [oci] ConfigSync oci + * @property {string|null} [metricsGcpServiceAccountEmail] ConfigSync metricsGcpServiceAccountEmail */ /** @@ -14779,6 +14871,52 @@ */ ConfigSync.prototype.sourceFormat = ""; + /** + * ConfigSync enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSync + * @instance + */ + ConfigSync.prototype.enabled = null; + + /** + * ConfigSync preventDrift. + * @member {boolean} preventDrift + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSync + * @instance + */ + ConfigSync.prototype.preventDrift = false; + + /** + * ConfigSync oci. + * @member {google.cloud.gkehub.configmanagement.v1.IOciConfig|null|undefined} oci + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSync + * @instance + */ + ConfigSync.prototype.oci = null; + + /** + * ConfigSync metricsGcpServiceAccountEmail. + * @member {string} metricsGcpServiceAccountEmail + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSync + * @instance + */ + ConfigSync.prototype.metricsGcpServiceAccountEmail = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfigSync _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSync + * @instance + */ + Object.defineProperty(ConfigSync.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ConfigSync instance using the specified properties. * @function create @@ -14807,6 +14945,14 @@ $root.google.cloud.gkehub.configmanagement.v1.GitConfig.encode(message.git, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.sourceFormat != null && Object.hasOwnProperty.call(message, "sourceFormat")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceFormat); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enabled); + if (message.preventDrift != null && Object.hasOwnProperty.call(message, "preventDrift")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.preventDrift); + if (message.oci != null && Object.hasOwnProperty.call(message, "oci")) + $root.google.cloud.gkehub.configmanagement.v1.OciConfig.encode(message.oci, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.metricsGcpServiceAccountEmail != null && Object.hasOwnProperty.call(message, "metricsGcpServiceAccountEmail")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.metricsGcpServiceAccountEmail); return writer; }; @@ -14849,6 +14995,22 @@ message.sourceFormat = reader.string(); break; } + case 10: { + message.enabled = reader.bool(); + break; + } + case 11: { + message.preventDrift = reader.bool(); + break; + } + case 12: { + message.oci = $root.google.cloud.gkehub.configmanagement.v1.OciConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.metricsGcpServiceAccountEmail = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14884,6 +15046,7 @@ ConfigSync.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.git != null && message.hasOwnProperty("git")) { var error = $root.google.cloud.gkehub.configmanagement.v1.GitConfig.verify(message.git); if (error) @@ -14892,6 +15055,22 @@ if (message.sourceFormat != null && message.hasOwnProperty("sourceFormat")) if (!$util.isString(message.sourceFormat)) return "sourceFormat: string expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.preventDrift != null && message.hasOwnProperty("preventDrift")) + if (typeof message.preventDrift !== "boolean") + return "preventDrift: boolean expected"; + if (message.oci != null && message.hasOwnProperty("oci")) { + var error = $root.google.cloud.gkehub.configmanagement.v1.OciConfig.verify(message.oci); + if (error) + return "oci." + error; + } + if (message.metricsGcpServiceAccountEmail != null && message.hasOwnProperty("metricsGcpServiceAccountEmail")) + if (!$util.isString(message.metricsGcpServiceAccountEmail)) + return "metricsGcpServiceAccountEmail: string expected"; return null; }; @@ -14914,6 +15093,17 @@ } if (object.sourceFormat != null) message.sourceFormat = String(object.sourceFormat); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.preventDrift != null) + message.preventDrift = Boolean(object.preventDrift); + if (object.oci != null) { + if (typeof object.oci !== "object") + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSync.oci: object expected"); + message.oci = $root.google.cloud.gkehub.configmanagement.v1.OciConfig.fromObject(object.oci); + } + if (object.metricsGcpServiceAccountEmail != null) + message.metricsGcpServiceAccountEmail = String(object.metricsGcpServiceAccountEmail); return message; }; @@ -14933,11 +15123,25 @@ if (options.defaults) { object.git = null; object.sourceFormat = ""; + object.preventDrift = false; + object.oci = null; + object.metricsGcpServiceAccountEmail = ""; } if (message.git != null && message.hasOwnProperty("git")) object.git = $root.google.cloud.gkehub.configmanagement.v1.GitConfig.toObject(message.git, options); if (message.sourceFormat != null && message.hasOwnProperty("sourceFormat")) object.sourceFormat = message.sourceFormat; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.preventDrift != null && message.hasOwnProperty("preventDrift")) + object.preventDrift = message.preventDrift; + if (message.oci != null && message.hasOwnProperty("oci")) + object.oci = $root.google.cloud.gkehub.configmanagement.v1.OciConfig.toObject(message.oci, options); + if (message.metricsGcpServiceAccountEmail != null && message.hasOwnProperty("metricsGcpServiceAccountEmail")) + object.metricsGcpServiceAccountEmail = message.metricsGcpServiceAccountEmail; return object; }; @@ -15349,30 +15553,28 @@ return GitConfig; })(); - v1.PolicyController = (function() { + v1.OciConfig = (function() { /** - * Properties of a PolicyController. + * Properties of an OciConfig. * @memberof google.cloud.gkehub.configmanagement.v1 - * @interface IPolicyController - * @property {boolean|null} [enabled] PolicyController enabled - * @property {boolean|null} [templateLibraryInstalled] PolicyController templateLibraryInstalled - * @property {number|Long|null} [auditIntervalSeconds] PolicyController auditIntervalSeconds - * @property {Array.|null} [exemptableNamespaces] PolicyController exemptableNamespaces - * @property {boolean|null} [referentialRulesEnabled] PolicyController referentialRulesEnabled - * @property {boolean|null} [logDeniesEnabled] PolicyController logDeniesEnabled + * @interface IOciConfig + * @property {string|null} [syncRepo] OciConfig syncRepo + * @property {string|null} [policyDir] OciConfig policyDir + * @property {number|Long|null} [syncWaitSecs] OciConfig syncWaitSecs + * @property {string|null} [secretType] OciConfig secretType + * @property {string|null} [gcpServiceAccountEmail] OciConfig gcpServiceAccountEmail */ /** - * Constructs a new PolicyController. + * Constructs a new OciConfig. * @memberof google.cloud.gkehub.configmanagement.v1 - * @classdesc Represents a PolicyController. - * @implements IPolicyController + * @classdesc Represents an OciConfig. + * @implements IOciConfig * @constructor - * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController=} [properties] Properties to set + * @param {google.cloud.gkehub.configmanagement.v1.IOciConfig=} [properties] Properties to set */ - function PolicyController(properties) { - this.exemptableNamespaces = []; + function OciConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15380,173 +15582,131 @@ } /** - * PolicyController enabled. - * @member {boolean} enabled - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController - * @instance - */ - PolicyController.prototype.enabled = false; - - /** - * PolicyController templateLibraryInstalled. - * @member {boolean|null|undefined} templateLibraryInstalled - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController - * @instance - */ - PolicyController.prototype.templateLibraryInstalled = null; - - /** - * PolicyController auditIntervalSeconds. - * @member {number|Long|null|undefined} auditIntervalSeconds - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController - * @instance - */ - PolicyController.prototype.auditIntervalSeconds = null; - - /** - * PolicyController exemptableNamespaces. - * @member {Array.} exemptableNamespaces - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * OciConfig syncRepo. + * @member {string} syncRepo + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @instance */ - PolicyController.prototype.exemptableNamespaces = $util.emptyArray; + OciConfig.prototype.syncRepo = ""; /** - * PolicyController referentialRulesEnabled. - * @member {boolean} referentialRulesEnabled - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * OciConfig policyDir. + * @member {string} policyDir + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @instance */ - PolicyController.prototype.referentialRulesEnabled = false; + OciConfig.prototype.policyDir = ""; /** - * PolicyController logDeniesEnabled. - * @member {boolean} logDeniesEnabled - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * OciConfig syncWaitSecs. + * @member {number|Long} syncWaitSecs + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @instance */ - PolicyController.prototype.logDeniesEnabled = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + OciConfig.prototype.syncWaitSecs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * PolicyController _templateLibraryInstalled. - * @member {"templateLibraryInstalled"|undefined} _templateLibraryInstalled - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * OciConfig secretType. + * @member {string} secretType + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @instance */ - Object.defineProperty(PolicyController.prototype, "_templateLibraryInstalled", { - get: $util.oneOfGetter($oneOfFields = ["templateLibraryInstalled"]), - set: $util.oneOfSetter($oneOfFields) - }); + OciConfig.prototype.secretType = ""; /** - * PolicyController _auditIntervalSeconds. - * @member {"auditIntervalSeconds"|undefined} _auditIntervalSeconds - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * OciConfig gcpServiceAccountEmail. + * @member {string} gcpServiceAccountEmail + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @instance */ - Object.defineProperty(PolicyController.prototype, "_auditIntervalSeconds", { - get: $util.oneOfGetter($oneOfFields = ["auditIntervalSeconds"]), - set: $util.oneOfSetter($oneOfFields) - }); + OciConfig.prototype.gcpServiceAccountEmail = ""; /** - * Creates a new PolicyController instance using the specified properties. + * Creates a new OciConfig instance using the specified properties. * @function create - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static - * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController=} [properties] Properties to set - * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController instance + * @param {google.cloud.gkehub.configmanagement.v1.IOciConfig=} [properties] Properties to set + * @returns {google.cloud.gkehub.configmanagement.v1.OciConfig} OciConfig instance */ - PolicyController.create = function create(properties) { - return new PolicyController(properties); + OciConfig.create = function create(properties) { + return new OciConfig(properties); }; /** - * Encodes the specified PolicyController message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.PolicyController.verify|verify} messages. + * Encodes the specified OciConfig message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.OciConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static - * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController} message PolicyController message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IOciConfig} message OciConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyController.encode = function encode(message, writer) { + OciConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); - if (message.templateLibraryInstalled != null && Object.hasOwnProperty.call(message, "templateLibraryInstalled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.templateLibraryInstalled); - if (message.auditIntervalSeconds != null && Object.hasOwnProperty.call(message, "auditIntervalSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.auditIntervalSeconds); - if (message.exemptableNamespaces != null && message.exemptableNamespaces.length) - for (var i = 0; i < message.exemptableNamespaces.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.exemptableNamespaces[i]); - if (message.referentialRulesEnabled != null && Object.hasOwnProperty.call(message, "referentialRulesEnabled")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.referentialRulesEnabled); - if (message.logDeniesEnabled != null && Object.hasOwnProperty.call(message, "logDeniesEnabled")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.logDeniesEnabled); + if (message.syncRepo != null && Object.hasOwnProperty.call(message, "syncRepo")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.syncRepo); + if (message.policyDir != null && Object.hasOwnProperty.call(message, "policyDir")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.policyDir); + if (message.syncWaitSecs != null && Object.hasOwnProperty.call(message, "syncWaitSecs")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.syncWaitSecs); + if (message.secretType != null && Object.hasOwnProperty.call(message, "secretType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.secretType); + if (message.gcpServiceAccountEmail != null && Object.hasOwnProperty.call(message, "gcpServiceAccountEmail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcpServiceAccountEmail); return writer; }; /** - * Encodes the specified PolicyController message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.PolicyController.verify|verify} messages. + * Encodes the specified OciConfig message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.OciConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static - * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController} message PolicyController message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IOciConfig} message OciConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyController.encodeDelimited = function encodeDelimited(message, writer) { + OciConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PolicyController message from the specified reader or buffer. + * Decodes an OciConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController + * @returns {google.cloud.gkehub.configmanagement.v1.OciConfig} OciConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PolicyController.decode = function decode(reader, length) { + OciConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.PolicyController(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.OciConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); + message.syncRepo = reader.string(); break; } case 2: { - message.templateLibraryInstalled = reader.bool(); + message.policyDir = reader.string(); break; } case 3: { - message.auditIntervalSeconds = reader.int64(); + message.syncWaitSecs = reader.int64(); break; } case 4: { - if (!(message.exemptableNamespaces && message.exemptableNamespaces.length)) - message.exemptableNamespaces = []; - message.exemptableNamespaces.push(reader.string()); + message.secretType = reader.string(); break; } case 5: { - message.referentialRulesEnabled = reader.bool(); - break; - } - case 6: { - message.logDeniesEnabled = reader.bool(); + message.gcpServiceAccountEmail = reader.string(); break; } default: @@ -15558,39 +15718,393 @@ }; /** - * Decodes a PolicyController message from the specified reader or buffer, length delimited. + * Decodes an OciConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController + * @returns {google.cloud.gkehub.configmanagement.v1.OciConfig} OciConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PolicyController.decodeDelimited = function decodeDelimited(reader) { + OciConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PolicyController message. + * Verifies an OciConfig message. * @function verify - * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PolicyController.verify = function verify(message) { + OciConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) - if (typeof message.enabled !== "boolean") - return "enabled: boolean expected"; - if (message.templateLibraryInstalled != null && message.hasOwnProperty("templateLibraryInstalled")) { - properties._templateLibraryInstalled = 1; - if (typeof message.templateLibraryInstalled !== "boolean") + if (message.syncRepo != null && message.hasOwnProperty("syncRepo")) + if (!$util.isString(message.syncRepo)) + return "syncRepo: string expected"; + if (message.policyDir != null && message.hasOwnProperty("policyDir")) + if (!$util.isString(message.policyDir)) + return "policyDir: string expected"; + if (message.syncWaitSecs != null && message.hasOwnProperty("syncWaitSecs")) + if (!$util.isInteger(message.syncWaitSecs) && !(message.syncWaitSecs && $util.isInteger(message.syncWaitSecs.low) && $util.isInteger(message.syncWaitSecs.high))) + return "syncWaitSecs: integer|Long expected"; + if (message.secretType != null && message.hasOwnProperty("secretType")) + if (!$util.isString(message.secretType)) + return "secretType: string expected"; + if (message.gcpServiceAccountEmail != null && message.hasOwnProperty("gcpServiceAccountEmail")) + if (!$util.isString(message.gcpServiceAccountEmail)) + return "gcpServiceAccountEmail: string expected"; + return null; + }; + + /** + * Creates an OciConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkehub.configmanagement.v1.OciConfig} OciConfig + */ + OciConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.OciConfig) + return object; + var message = new $root.google.cloud.gkehub.configmanagement.v1.OciConfig(); + if (object.syncRepo != null) + message.syncRepo = String(object.syncRepo); + if (object.policyDir != null) + message.policyDir = String(object.policyDir); + if (object.syncWaitSecs != null) + if ($util.Long) + (message.syncWaitSecs = $util.Long.fromValue(object.syncWaitSecs)).unsigned = false; + else if (typeof object.syncWaitSecs === "string") + message.syncWaitSecs = parseInt(object.syncWaitSecs, 10); + else if (typeof object.syncWaitSecs === "number") + message.syncWaitSecs = object.syncWaitSecs; + else if (typeof object.syncWaitSecs === "object") + message.syncWaitSecs = new $util.LongBits(object.syncWaitSecs.low >>> 0, object.syncWaitSecs.high >>> 0).toNumber(); + if (object.secretType != null) + message.secretType = String(object.secretType); + if (object.gcpServiceAccountEmail != null) + message.gcpServiceAccountEmail = String(object.gcpServiceAccountEmail); + return message; + }; + + /** + * Creates a plain object from an OciConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig + * @static + * @param {google.cloud.gkehub.configmanagement.v1.OciConfig} message OciConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OciConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.syncRepo = ""; + object.policyDir = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.syncWaitSecs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.syncWaitSecs = options.longs === String ? "0" : 0; + object.secretType = ""; + object.gcpServiceAccountEmail = ""; + } + if (message.syncRepo != null && message.hasOwnProperty("syncRepo")) + object.syncRepo = message.syncRepo; + if (message.policyDir != null && message.hasOwnProperty("policyDir")) + object.policyDir = message.policyDir; + if (message.syncWaitSecs != null && message.hasOwnProperty("syncWaitSecs")) + if (typeof message.syncWaitSecs === "number") + object.syncWaitSecs = options.longs === String ? String(message.syncWaitSecs) : message.syncWaitSecs; + else + object.syncWaitSecs = options.longs === String ? $util.Long.prototype.toString.call(message.syncWaitSecs) : options.longs === Number ? new $util.LongBits(message.syncWaitSecs.low >>> 0, message.syncWaitSecs.high >>> 0).toNumber() : message.syncWaitSecs; + if (message.secretType != null && message.hasOwnProperty("secretType")) + object.secretType = message.secretType; + if (message.gcpServiceAccountEmail != null && message.hasOwnProperty("gcpServiceAccountEmail")) + object.gcpServiceAccountEmail = message.gcpServiceAccountEmail; + return object; + }; + + /** + * Converts this OciConfig to JSON. + * @function toJSON + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig + * @instance + * @returns {Object.} JSON object + */ + OciConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OciConfig + * @function getTypeUrl + * @memberof google.cloud.gkehub.configmanagement.v1.OciConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OciConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.OciConfig"; + }; + + return OciConfig; + })(); + + v1.PolicyController = (function() { + + /** + * Properties of a PolicyController. + * @memberof google.cloud.gkehub.configmanagement.v1 + * @interface IPolicyController + * @property {boolean|null} [enabled] PolicyController enabled + * @property {boolean|null} [templateLibraryInstalled] PolicyController templateLibraryInstalled + * @property {number|Long|null} [auditIntervalSeconds] PolicyController auditIntervalSeconds + * @property {Array.|null} [exemptableNamespaces] PolicyController exemptableNamespaces + * @property {boolean|null} [referentialRulesEnabled] PolicyController referentialRulesEnabled + * @property {boolean|null} [logDeniesEnabled] PolicyController logDeniesEnabled + */ + + /** + * Constructs a new PolicyController. + * @memberof google.cloud.gkehub.configmanagement.v1 + * @classdesc Represents a PolicyController. + * @implements IPolicyController + * @constructor + * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController=} [properties] Properties to set + */ + function PolicyController(properties) { + this.exemptableNamespaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyController enabled. + * @member {boolean} enabled + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.enabled = false; + + /** + * PolicyController templateLibraryInstalled. + * @member {boolean|null|undefined} templateLibraryInstalled + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.templateLibraryInstalled = null; + + /** + * PolicyController auditIntervalSeconds. + * @member {number|Long|null|undefined} auditIntervalSeconds + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.auditIntervalSeconds = null; + + /** + * PolicyController exemptableNamespaces. + * @member {Array.} exemptableNamespaces + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.exemptableNamespaces = $util.emptyArray; + + /** + * PolicyController referentialRulesEnabled. + * @member {boolean} referentialRulesEnabled + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.referentialRulesEnabled = false; + + /** + * PolicyController logDeniesEnabled. + * @member {boolean} logDeniesEnabled + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + PolicyController.prototype.logDeniesEnabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PolicyController _templateLibraryInstalled. + * @member {"templateLibraryInstalled"|undefined} _templateLibraryInstalled + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + Object.defineProperty(PolicyController.prototype, "_templateLibraryInstalled", { + get: $util.oneOfGetter($oneOfFields = ["templateLibraryInstalled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PolicyController _auditIntervalSeconds. + * @member {"auditIntervalSeconds"|undefined} _auditIntervalSeconds + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @instance + */ + Object.defineProperty(PolicyController.prototype, "_auditIntervalSeconds", { + get: $util.oneOfGetter($oneOfFields = ["auditIntervalSeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PolicyController instance using the specified properties. + * @function create + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController=} [properties] Properties to set + * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController instance + */ + PolicyController.create = function create(properties) { + return new PolicyController(properties); + }; + + /** + * Encodes the specified PolicyController message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.PolicyController.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController} message PolicyController message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyController.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.templateLibraryInstalled != null && Object.hasOwnProperty.call(message, "templateLibraryInstalled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.templateLibraryInstalled); + if (message.auditIntervalSeconds != null && Object.hasOwnProperty.call(message, "auditIntervalSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.auditIntervalSeconds); + if (message.exemptableNamespaces != null && message.exemptableNamespaces.length) + for (var i = 0; i < message.exemptableNamespaces.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.exemptableNamespaces[i]); + if (message.referentialRulesEnabled != null && Object.hasOwnProperty.call(message, "referentialRulesEnabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.referentialRulesEnabled); + if (message.logDeniesEnabled != null && Object.hasOwnProperty.call(message, "logDeniesEnabled")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.logDeniesEnabled); + return writer; + }; + + /** + * Encodes the specified PolicyController message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.PolicyController.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IPolicyController} message PolicyController message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyController.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyController message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyController.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.PolicyController(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.templateLibraryInstalled = reader.bool(); + break; + } + case 3: { + message.auditIntervalSeconds = reader.int64(); + break; + } + case 4: { + if (!(message.exemptableNamespaces && message.exemptableNamespaces.length)) + message.exemptableNamespaces = []; + message.exemptableNamespaces.push(reader.string()); + break; + } + case 5: { + message.referentialRulesEnabled = reader.bool(); + break; + } + case 6: { + message.logDeniesEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyController message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkehub.configmanagement.v1.PolicyController} PolicyController + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyController.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyController message. + * @function verify + * @memberof google.cloud.gkehub.configmanagement.v1.PolicyController + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyController.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.templateLibraryInstalled != null && message.hasOwnProperty("templateLibraryInstalled")) { + properties._templateLibraryInstalled = 1; + if (typeof message.templateLibraryInstalled !== "boolean") return "templateLibraryInstalled: boolean expected"; } if (message.auditIntervalSeconds != null && message.hasOwnProperty("auditIntervalSeconds")) { @@ -16133,6 +16647,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.extension != null && message.hasOwnProperty("extension")) @@ -16143,6 +16658,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -16183,6 +16699,10 @@ case 3: message.hnc = 3; break; + case "PENDING": + case 4: + message.hnc = 4; + break; } switch (object.extension) { default: @@ -16207,6 +16727,10 @@ case 3: message.extension = 3; break; + case "PENDING": + case 4: + message.extension = 4; + break; } return message; }; @@ -16904,6 +17428,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.errors != null && message.hasOwnProperty("errors")) { @@ -16955,6 +17480,10 @@ case 3: message.deploymentState = 3; break; + case "PENDING": + case 4: + message.deploymentState = 4; + break; } if (object.errors) { if (!Array.isArray(object.errors)) @@ -17054,75 +17583,372 @@ } /** - * InstallError errorMessage. - * @member {string} errorMessage - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * InstallError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @instance + */ + InstallError.prototype.errorMessage = ""; + + /** + * Creates a new InstallError instance using the specified properties. + * @function create + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IInstallError=} [properties] Properties to set + * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError instance + */ + InstallError.create = function create(properties) { + return new InstallError(properties); + }; + + /** + * Encodes the specified InstallError message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.InstallError.verify|verify} messages. + * @function encode + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IInstallError} message InstallError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstallError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified InstallError message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.InstallError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {google.cloud.gkehub.configmanagement.v1.IInstallError} message InstallError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstallError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstallError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstallError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.InstallError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstallError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstallError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstallError message. + * @function verify + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstallError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates an InstallError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + */ + InstallError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.InstallError) + return object; + var message = new $root.google.cloud.gkehub.configmanagement.v1.InstallError(); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from an InstallError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {google.cloud.gkehub.configmanagement.v1.InstallError} message InstallError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstallError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.errorMessage = ""; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this InstallError to JSON. + * @function toJSON + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @instance + * @returns {Object.} JSON object + */ + InstallError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstallError + * @function getTypeUrl + * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstallError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.InstallError"; + }; + + return InstallError; + })(); + + v1.ConfigSyncState = (function() { + + /** + * Properties of a ConfigSyncState. + * @memberof google.cloud.gkehub.configmanagement.v1 + * @interface IConfigSyncState + * @property {google.cloud.gkehub.configmanagement.v1.IConfigSyncVersion|null} [version] ConfigSyncState version + * @property {google.cloud.gkehub.configmanagement.v1.IConfigSyncDeploymentState|null} [deploymentState] ConfigSyncState deploymentState + * @property {google.cloud.gkehub.configmanagement.v1.ISyncState|null} [syncState] ConfigSyncState syncState + * @property {Array.|null} [errors] ConfigSyncState errors + * @property {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|null} [rootsyncCrd] ConfigSyncState rootsyncCrd + * @property {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState|null} [reposyncCrd] ConfigSyncState reposyncCrd + * @property {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State|null} [state] ConfigSyncState state + */ + + /** + * Constructs a new ConfigSyncState. + * @memberof google.cloud.gkehub.configmanagement.v1 + * @classdesc Represents a ConfigSyncState. + * @implements IConfigSyncState + * @constructor + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState=} [properties] Properties to set + */ + function ConfigSyncState(properties) { + 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]]; + } + + /** + * ConfigSyncState version. + * @member {google.cloud.gkehub.configmanagement.v1.IConfigSyncVersion|null|undefined} version + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.version = null; + + /** + * ConfigSyncState deploymentState. + * @member {google.cloud.gkehub.configmanagement.v1.IConfigSyncDeploymentState|null|undefined} deploymentState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.deploymentState = null; + + /** + * ConfigSyncState syncState. + * @member {google.cloud.gkehub.configmanagement.v1.ISyncState|null|undefined} syncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.syncState = null; + + /** + * ConfigSyncState errors. + * @member {Array.} errors + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.errors = $util.emptyArray; + + /** + * ConfigSyncState rootsyncCrd. + * @member {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState} rootsyncCrd + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.rootsyncCrd = 0; + + /** + * ConfigSyncState reposyncCrd. + * @member {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState} reposyncCrd + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @instance + */ + ConfigSyncState.prototype.reposyncCrd = 0; + + /** + * ConfigSyncState state. + * @member {google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State} state + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @instance */ - InstallError.prototype.errorMessage = ""; + ConfigSyncState.prototype.state = 0; /** - * Creates a new InstallError instance using the specified properties. + * Creates a new ConfigSyncState instance using the specified properties. * @function create - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static - * @param {google.cloud.gkehub.configmanagement.v1.IInstallError=} [properties] Properties to set - * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError instance + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState=} [properties] Properties to set + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState instance */ - InstallError.create = function create(properties) { - return new InstallError(properties); + ConfigSyncState.create = function create(properties) { + return new ConfigSyncState(properties); }; /** - * Encodes the specified InstallError message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.InstallError.verify|verify} messages. + * Encodes the specified ConfigSyncState message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncState.verify|verify} messages. * @function encode - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static - * @param {google.cloud.gkehub.configmanagement.v1.IInstallError} message InstallError message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState} message ConfigSyncState message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstallError.encode = function encode(message, writer) { + ConfigSyncState.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorMessage); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) + $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.encode(message.deploymentState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.syncState != null && Object.hasOwnProperty.call(message, "syncState")) + $root.google.cloud.gkehub.configmanagement.v1.SyncState.encode(message.syncState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError.encode(message.errors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rootsyncCrd != null && Object.hasOwnProperty.call(message, "rootsyncCrd")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.rootsyncCrd); + if (message.reposyncCrd != null && Object.hasOwnProperty.call(message, "reposyncCrd")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reposyncCrd); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); return writer; }; /** - * Encodes the specified InstallError message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.InstallError.verify|verify} messages. + * Encodes the specified ConfigSyncState message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncState.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static - * @param {google.cloud.gkehub.configmanagement.v1.IInstallError} message InstallError message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState} message ConfigSyncState message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstallError.encodeDelimited = function encodeDelimited(message, writer) { + ConfigSyncState.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InstallError message from the specified reader or buffer. + * Decodes a ConfigSyncState message from the specified reader or buffer. * @function decode - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InstallError.decode = function decode(reader, length) { + ConfigSyncState.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.InstallError(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.errorMessage = reader.string(); + message.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.decode(reader, reader.uint32()); + break; + } + case 3: { + message.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError.decode(reader, reader.uint32())); + break; + } + case 5: { + message.rootsyncCrd = reader.int32(); + break; + } + case 6: { + message.reposyncCrd = reader.int32(); + break; + } + case 7: { + message.state = reader.int32(); break; } default: @@ -17134,124 +17960,346 @@ }; /** - * Decodes an InstallError message from the specified reader or buffer, length delimited. + * Decodes a ConfigSyncState message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InstallError.decodeDelimited = function decodeDelimited(reader) { + ConfigSyncState.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InstallError message. + * Verifies a ConfigSyncState message. * @function verify - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InstallError.verify = function verify(message) { + ConfigSyncState.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - if (!$util.isString(message.errorMessage)) - return "errorMessage: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.verify(message.version); + if (error) + return "version." + error; + } + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) { + var error = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.verify(message.deploymentState); + if (error) + return "deploymentState." + error; + } + if (message.syncState != null && message.hasOwnProperty("syncState")) { + var error = $root.google.cloud.gkehub.configmanagement.v1.SyncState.verify(message.syncState); + if (error) + return "syncState." + 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.cloud.gkehub.configmanagement.v1.ConfigSyncError.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + if (message.rootsyncCrd != null && message.hasOwnProperty("rootsyncCrd")) + switch (message.rootsyncCrd) { + default: + return "rootsyncCrd: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.reposyncCrd != null && message.hasOwnProperty("reposyncCrd")) + switch (message.reposyncCrd) { + default: + return "reposyncCrd: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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; + } return null; }; /** - * Creates an InstallError message from a plain object. Also converts values to their respective internal types. + * Creates a ConfigSyncState message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static * @param {Object.} object Plain object - * @returns {google.cloud.gkehub.configmanagement.v1.InstallError} InstallError + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState */ - InstallError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.InstallError) + ConfigSyncState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState) return object; - var message = new $root.google.cloud.gkehub.configmanagement.v1.InstallError(); - if (object.errorMessage != null) - message.errorMessage = String(object.errorMessage); + var message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.version: object expected"); + message.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.fromObject(object.version); + } + if (object.deploymentState != null) { + if (typeof object.deploymentState !== "object") + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.deploymentState: object expected"); + message.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.fromObject(object.deploymentState); + } + if (object.syncState != null) { + if (typeof object.syncState !== "object") + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.syncState: object expected"); + message.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.fromObject(object.syncState); + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.errors: object expected"); + message.errors[i] = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError.fromObject(object.errors[i]); + } + } + switch (object.rootsyncCrd) { + default: + if (typeof object.rootsyncCrd === "number") { + message.rootsyncCrd = object.rootsyncCrd; + break; + } + break; + case "CRD_STATE_UNSPECIFIED": + case 0: + message.rootsyncCrd = 0; + break; + case "NOT_INSTALLED": + case 1: + message.rootsyncCrd = 1; + break; + case "INSTALLED": + case 2: + message.rootsyncCrd = 2; + break; + case "TERMINATING": + case 3: + message.rootsyncCrd = 3; + break; + case "INSTALLING": + case 4: + message.rootsyncCrd = 4; + break; + } + switch (object.reposyncCrd) { + default: + if (typeof object.reposyncCrd === "number") { + message.reposyncCrd = object.reposyncCrd; + break; + } + break; + case "CRD_STATE_UNSPECIFIED": + case 0: + message.reposyncCrd = 0; + break; + case "NOT_INSTALLED": + case 1: + message.reposyncCrd = 1; + break; + case "INSTALLED": + case 2: + message.reposyncCrd = 2; + break; + case "TERMINATING": + case 3: + message.reposyncCrd = 3; + break; + case "INSTALLING": + case 4: + message.reposyncCrd = 4; + break; + } + 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 "CONFIG_SYNC_NOT_INSTALLED": + case 1: + message.state = 1; + break; + case "CONFIG_SYNC_INSTALLED": + case 2: + message.state = 2; + break; + case "CONFIG_SYNC_ERROR": + case 3: + message.state = 3; + break; + case "CONFIG_SYNC_PENDING": + case 4: + message.state = 4; + break; + } return message; }; /** - * Creates a plain object from an InstallError message. Also converts values to other types if specified. + * Creates a plain object from a ConfigSyncState message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static - * @param {google.cloud.gkehub.configmanagement.v1.InstallError} message InstallError + * @param {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} message ConfigSyncState * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstallError.toObject = function toObject(message, options) { + ConfigSyncState.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.errorMessage = ""; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - object.errorMessage = message.errorMessage; + if (options.arrays || options.defaults) + object.errors = []; + if (options.defaults) { + object.version = null; + object.deploymentState = null; + object.syncState = null; + object.rootsyncCrd = options.enums === String ? "CRD_STATE_UNSPECIFIED" : 0; + object.reposyncCrd = options.enums === String ? "CRD_STATE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.toObject(message.version, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.toObject(message.deploymentState, options); + if (message.syncState != null && message.hasOwnProperty("syncState")) + object.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.toObject(message.syncState, options); + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError.toObject(message.errors[j], options); + } + if (message.rootsyncCrd != null && message.hasOwnProperty("rootsyncCrd")) + object.rootsyncCrd = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState[message.rootsyncCrd] === undefined ? message.rootsyncCrd : $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState[message.rootsyncCrd] : message.rootsyncCrd; + if (message.reposyncCrd != null && message.hasOwnProperty("reposyncCrd")) + object.reposyncCrd = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState[message.reposyncCrd] === undefined ? message.reposyncCrd : $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState[message.reposyncCrd] : message.reposyncCrd; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State[message.state] === undefined ? message.state : $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State[message.state] : message.state; return object; }; /** - * Converts this InstallError to JSON. + * Converts this ConfigSyncState to JSON. * @function toJSON - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @instance * @returns {Object.} JSON object */ - InstallError.prototype.toJSON = function toJSON() { + ConfigSyncState.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for InstallError + * Gets the default type url for ConfigSyncState * @function getTypeUrl - * @memberof google.cloud.gkehub.configmanagement.v1.InstallError + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - InstallError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ConfigSyncState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.InstallError"; + return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.ConfigSyncState"; }; - return InstallError; + /** + * CRDState enum. + * @name google.cloud.gkehub.configmanagement.v1.ConfigSyncState.CRDState + * @enum {number} + * @property {number} CRD_STATE_UNSPECIFIED=0 CRD_STATE_UNSPECIFIED value + * @property {number} NOT_INSTALLED=1 NOT_INSTALLED value + * @property {number} INSTALLED=2 INSTALLED value + * @property {number} TERMINATING=3 TERMINATING value + * @property {number} INSTALLING=4 INSTALLING value + */ + ConfigSyncState.CRDState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CRD_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_INSTALLED"] = 1; + values[valuesById[2] = "INSTALLED"] = 2; + values[valuesById[3] = "TERMINATING"] = 3; + values[valuesById[4] = "INSTALLING"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.gkehub.configmanagement.v1.ConfigSyncState.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CONFIG_SYNC_NOT_INSTALLED=1 CONFIG_SYNC_NOT_INSTALLED value + * @property {number} CONFIG_SYNC_INSTALLED=2 CONFIG_SYNC_INSTALLED value + * @property {number} CONFIG_SYNC_ERROR=3 CONFIG_SYNC_ERROR value + * @property {number} CONFIG_SYNC_PENDING=4 CONFIG_SYNC_PENDING value + */ + ConfigSyncState.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFIG_SYNC_NOT_INSTALLED"] = 1; + values[valuesById[2] = "CONFIG_SYNC_INSTALLED"] = 2; + values[valuesById[3] = "CONFIG_SYNC_ERROR"] = 3; + values[valuesById[4] = "CONFIG_SYNC_PENDING"] = 4; + return values; + })(); + + return ConfigSyncState; })(); - v1.ConfigSyncState = (function() { + v1.ConfigSyncError = (function() { /** - * Properties of a ConfigSyncState. + * Properties of a ConfigSyncError. * @memberof google.cloud.gkehub.configmanagement.v1 - * @interface IConfigSyncState - * @property {google.cloud.gkehub.configmanagement.v1.IConfigSyncVersion|null} [version] ConfigSyncState version - * @property {google.cloud.gkehub.configmanagement.v1.IConfigSyncDeploymentState|null} [deploymentState] ConfigSyncState deploymentState - * @property {google.cloud.gkehub.configmanagement.v1.ISyncState|null} [syncState] ConfigSyncState syncState + * @interface IConfigSyncError + * @property {string|null} [errorMessage] ConfigSyncError errorMessage */ /** - * Constructs a new ConfigSyncState. + * Constructs a new ConfigSyncError. * @memberof google.cloud.gkehub.configmanagement.v1 - * @classdesc Represents a ConfigSyncState. - * @implements IConfigSyncState + * @classdesc Represents a ConfigSyncError. + * @implements IConfigSyncError * @constructor - * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState=} [properties] Properties to set + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncError=} [properties] Properties to set */ - function ConfigSyncState(properties) { + function ConfigSyncError(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17259,103 +18307,75 @@ } /** - * ConfigSyncState version. - * @member {google.cloud.gkehub.configmanagement.v1.IConfigSyncVersion|null|undefined} version - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState - * @instance - */ - ConfigSyncState.prototype.version = null; - - /** - * ConfigSyncState deploymentState. - * @member {google.cloud.gkehub.configmanagement.v1.IConfigSyncDeploymentState|null|undefined} deploymentState - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState - * @instance - */ - ConfigSyncState.prototype.deploymentState = null; - - /** - * ConfigSyncState syncState. - * @member {google.cloud.gkehub.configmanagement.v1.ISyncState|null|undefined} syncState - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * ConfigSyncError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @instance */ - ConfigSyncState.prototype.syncState = null; + ConfigSyncError.prototype.errorMessage = ""; /** - * Creates a new ConfigSyncState instance using the specified properties. + * Creates a new ConfigSyncError instance using the specified properties. * @function create - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static - * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState=} [properties] Properties to set - * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState instance + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncError=} [properties] Properties to set + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncError} ConfigSyncError instance */ - ConfigSyncState.create = function create(properties) { - return new ConfigSyncState(properties); + ConfigSyncError.create = function create(properties) { + return new ConfigSyncError(properties); }; /** - * Encodes the specified ConfigSyncState message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncState.verify|verify} messages. + * Encodes the specified ConfigSyncError message. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncError.verify|verify} messages. * @function encode - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static - * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState} message ConfigSyncState message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncError} message ConfigSyncError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConfigSyncState.encode = function encode(message, writer) { + ConfigSyncError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) - $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.encode(message.deploymentState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.syncState != null && Object.hasOwnProperty.call(message, "syncState")) - $root.google.cloud.gkehub.configmanagement.v1.SyncState.encode(message.syncState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorMessage); return writer; }; /** - * Encodes the specified ConfigSyncState message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncState.verify|verify} messages. + * Encodes the specified ConfigSyncError message, length delimited. Does not implicitly {@link google.cloud.gkehub.configmanagement.v1.ConfigSyncError.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static - * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncState} message ConfigSyncState message or plain object to encode + * @param {google.cloud.gkehub.configmanagement.v1.IConfigSyncError} message ConfigSyncError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConfigSyncState.encodeDelimited = function encodeDelimited(message, writer) { + ConfigSyncError.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConfigSyncState message from the specified reader or buffer. + * Decodes a ConfigSyncError message from the specified reader or buffer. * @function decode - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncError} ConfigSyncError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConfigSyncState.decode = function decode(reader, length) { + ConfigSyncError.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.decode(reader, reader.uint32()); - break; - } - case 2: { - message.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.decode(reader, reader.uint32()); - break; - } - case 3: { - message.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.decode(reader, reader.uint32()); + message.errorMessage = reader.string(); break; } default: @@ -17367,134 +18387,102 @@ }; /** - * Decodes a ConfigSyncState message from the specified reader or buffer, length delimited. + * Decodes a ConfigSyncError message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncError} ConfigSyncError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConfigSyncState.decodeDelimited = function decodeDelimited(reader) { + ConfigSyncError.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConfigSyncState message. + * Verifies a ConfigSyncError message. * @function verify - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConfigSyncState.verify = function verify(message) { + ConfigSyncError.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.verify(message.version); - if (error) - return "version." + error; - } - if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) { - var error = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.verify(message.deploymentState); - if (error) - return "deploymentState." + error; - } - if (message.syncState != null && message.hasOwnProperty("syncState")) { - var error = $root.google.cloud.gkehub.configmanagement.v1.SyncState.verify(message.syncState); - if (error) - return "syncState." + error; - } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; return null; }; /** - * Creates a ConfigSyncState message from a plain object. Also converts values to their respective internal types. + * Creates a ConfigSyncError message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static * @param {Object.} object Plain object - * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} ConfigSyncState + * @returns {google.cloud.gkehub.configmanagement.v1.ConfigSyncError} ConfigSyncError */ - ConfigSyncState.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState) + ConfigSyncError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError) return object; - var message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncState(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.version: object expected"); - message.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.fromObject(object.version); - } - if (object.deploymentState != null) { - if (typeof object.deploymentState !== "object") - throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.deploymentState: object expected"); - message.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.fromObject(object.deploymentState); - } - if (object.syncState != null) { - if (typeof object.syncState !== "object") - throw TypeError(".google.cloud.gkehub.configmanagement.v1.ConfigSyncState.syncState: object expected"); - message.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.fromObject(object.syncState); - } + var message = new $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncError(); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); return message; }; /** - * Creates a plain object from a ConfigSyncState message. Also converts values to other types if specified. + * Creates a plain object from a ConfigSyncError message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static - * @param {google.cloud.gkehub.configmanagement.v1.ConfigSyncState} message ConfigSyncState + * @param {google.cloud.gkehub.configmanagement.v1.ConfigSyncError} message ConfigSyncError * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConfigSyncState.toObject = function toObject(message, options) { + ConfigSyncError.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.version = null; - object.deploymentState = null; - object.syncState = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion.toObject(message.version, options); - if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) - object.deploymentState = $root.google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState.toObject(message.deploymentState, options); - if (message.syncState != null && message.hasOwnProperty("syncState")) - object.syncState = $root.google.cloud.gkehub.configmanagement.v1.SyncState.toObject(message.syncState, options); + if (options.defaults) + object.errorMessage = ""; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; return object; }; /** - * Converts this ConfigSyncState to JSON. + * Converts this ConfigSyncError to JSON. * @function toJSON - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @instance * @returns {Object.} JSON object */ - ConfigSyncState.prototype.toJSON = function toJSON() { + ConfigSyncError.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ConfigSyncState + * Gets the default type url for ConfigSyncError * @function getTypeUrl - * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncState + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncError * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ConfigSyncState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ConfigSyncError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.ConfigSyncState"; + return typeUrlPrefix + "/google.cloud.gkehub.configmanagement.v1.ConfigSyncError"; }; - return ConfigSyncState; + return ConfigSyncError; })(); v1.ConfigSyncVersion = (function() { @@ -17509,6 +18497,7 @@ * @property {string|null} [monitor] ConfigSyncVersion monitor * @property {string|null} [reconcilerManager] ConfigSyncVersion reconcilerManager * @property {string|null} [rootReconciler] ConfigSyncVersion rootReconciler + * @property {string|null} [admissionWebhook] ConfigSyncVersion admissionWebhook */ /** @@ -17574,6 +18563,14 @@ */ ConfigSyncVersion.prototype.rootReconciler = ""; + /** + * ConfigSyncVersion admissionWebhook. + * @member {string} admissionWebhook + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncVersion + * @instance + */ + ConfigSyncVersion.prototype.admissionWebhook = ""; + /** * Creates a new ConfigSyncVersion instance using the specified properties. * @function create @@ -17610,6 +18607,8 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.reconcilerManager); if (message.rootReconciler != null && Object.hasOwnProperty.call(message, "rootReconciler")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.rootReconciler); + if (message.admissionWebhook != null && Object.hasOwnProperty.call(message, "admissionWebhook")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.admissionWebhook); return writer; }; @@ -17668,6 +18667,10 @@ message.rootReconciler = reader.string(); break; } + case 7: { + message.admissionWebhook = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -17721,6 +18724,9 @@ if (message.rootReconciler != null && message.hasOwnProperty("rootReconciler")) if (!$util.isString(message.rootReconciler)) return "rootReconciler: string expected"; + if (message.admissionWebhook != null && message.hasOwnProperty("admissionWebhook")) + if (!$util.isString(message.admissionWebhook)) + return "admissionWebhook: string expected"; return null; }; @@ -17748,6 +18754,8 @@ message.reconcilerManager = String(object.reconcilerManager); if (object.rootReconciler != null) message.rootReconciler = String(object.rootReconciler); + if (object.admissionWebhook != null) + message.admissionWebhook = String(object.admissionWebhook); return message; }; @@ -17771,6 +18779,7 @@ object.monitor = ""; object.reconcilerManager = ""; object.rootReconciler = ""; + object.admissionWebhook = ""; } if (message.importer != null && message.hasOwnProperty("importer")) object.importer = message.importer; @@ -17784,6 +18793,8 @@ object.reconcilerManager = message.reconcilerManager; if (message.rootReconciler != null && message.hasOwnProperty("rootReconciler")) object.rootReconciler = message.rootReconciler; + if (message.admissionWebhook != null && message.hasOwnProperty("admissionWebhook")) + object.admissionWebhook = message.admissionWebhook; return object; }; @@ -17828,6 +18839,7 @@ * @property {google.cloud.gkehub.configmanagement.v1.DeploymentState|null} [monitor] ConfigSyncDeploymentState monitor * @property {google.cloud.gkehub.configmanagement.v1.DeploymentState|null} [reconcilerManager] ConfigSyncDeploymentState reconcilerManager * @property {google.cloud.gkehub.configmanagement.v1.DeploymentState|null} [rootReconciler] ConfigSyncDeploymentState rootReconciler + * @property {google.cloud.gkehub.configmanagement.v1.DeploymentState|null} [admissionWebhook] ConfigSyncDeploymentState admissionWebhook */ /** @@ -17893,6 +18905,14 @@ */ ConfigSyncDeploymentState.prototype.rootReconciler = 0; + /** + * ConfigSyncDeploymentState admissionWebhook. + * @member {google.cloud.gkehub.configmanagement.v1.DeploymentState} admissionWebhook + * @memberof google.cloud.gkehub.configmanagement.v1.ConfigSyncDeploymentState + * @instance + */ + ConfigSyncDeploymentState.prototype.admissionWebhook = 0; + /** * Creates a new ConfigSyncDeploymentState instance using the specified properties. * @function create @@ -17929,6 +18949,8 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconcilerManager); if (message.rootReconciler != null && Object.hasOwnProperty.call(message, "rootReconciler")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.rootReconciler); + if (message.admissionWebhook != null && Object.hasOwnProperty.call(message, "admissionWebhook")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.admissionWebhook); return writer; }; @@ -17987,6 +19009,10 @@ message.rootReconciler = reader.int32(); break; } + case 7: { + message.admissionWebhook = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -18030,6 +19056,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.syncer != null && message.hasOwnProperty("syncer")) @@ -18040,6 +19067,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.gitSync != null && message.hasOwnProperty("gitSync")) @@ -18050,6 +19078,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.monitor != null && message.hasOwnProperty("monitor")) @@ -18060,6 +19089,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.reconcilerManager != null && message.hasOwnProperty("reconcilerManager")) @@ -18070,6 +19100,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.rootReconciler != null && message.hasOwnProperty("rootReconciler")) @@ -18080,6 +19111,18 @@ case 1: case 2: case 3: + case 4: + break; + } + if (message.admissionWebhook != null && message.hasOwnProperty("admissionWebhook")) + switch (message.admissionWebhook) { + default: + return "admissionWebhook: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: break; } return null; @@ -18120,6 +19163,10 @@ case 3: message.importer = 3; break; + case "PENDING": + case 4: + message.importer = 4; + break; } switch (object.syncer) { default: @@ -18144,6 +19191,10 @@ case 3: message.syncer = 3; break; + case "PENDING": + case 4: + message.syncer = 4; + break; } switch (object.gitSync) { default: @@ -18168,6 +19219,10 @@ case 3: message.gitSync = 3; break; + case "PENDING": + case 4: + message.gitSync = 4; + break; } switch (object.monitor) { default: @@ -18192,6 +19247,10 @@ case 3: message.monitor = 3; break; + case "PENDING": + case 4: + message.monitor = 4; + break; } switch (object.reconcilerManager) { default: @@ -18216,6 +19275,10 @@ case 3: message.reconcilerManager = 3; break; + case "PENDING": + case 4: + message.reconcilerManager = 4; + break; } switch (object.rootReconciler) { default: @@ -18240,6 +19303,38 @@ case 3: message.rootReconciler = 3; break; + case "PENDING": + case 4: + message.rootReconciler = 4; + break; + } + switch (object.admissionWebhook) { + default: + if (typeof object.admissionWebhook === "number") { + message.admissionWebhook = object.admissionWebhook; + break; + } + break; + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.admissionWebhook = 0; + break; + case "NOT_INSTALLED": + case 1: + message.admissionWebhook = 1; + break; + case "INSTALLED": + case 2: + message.admissionWebhook = 2; + break; + case "ERROR": + case 3: + message.admissionWebhook = 3; + break; + case "PENDING": + case 4: + message.admissionWebhook = 4; + break; } return message; }; @@ -18264,6 +19359,7 @@ object.monitor = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; object.reconcilerManager = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; object.rootReconciler = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.admissionWebhook = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; } if (message.importer != null && message.hasOwnProperty("importer")) object.importer = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.importer] === undefined ? message.importer : $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.importer] : message.importer; @@ -18277,6 +19373,8 @@ object.reconcilerManager = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.reconcilerManager] === undefined ? message.reconcilerManager : $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.reconcilerManager] : message.reconcilerManager; if (message.rootReconciler != null && message.hasOwnProperty("rootReconciler")) object.rootReconciler = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.rootReconciler] === undefined ? message.rootReconciler : $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.rootReconciler] : message.rootReconciler; + if (message.admissionWebhook != null && message.hasOwnProperty("admissionWebhook")) + object.admissionWebhook = options.enums === String ? $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.admissionWebhook] === undefined ? message.admissionWebhook : $root.google.cloud.gkehub.configmanagement.v1.DeploymentState[message.admissionWebhook] : message.admissionWebhook; return object; }; @@ -20147,6 +21245,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.gatekeeperAudit != null && message.hasOwnProperty("gatekeeperAudit")) @@ -20157,6 +21256,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -20197,6 +21297,10 @@ case 3: message.gatekeeperControllerManagerState = 3; break; + case "PENDING": + case 4: + message.gatekeeperControllerManagerState = 4; + break; } switch (object.gatekeeperAudit) { default: @@ -20221,6 +21325,10 @@ case 3: message.gatekeeperAudit = 3; break; + case "PENDING": + case 4: + message.gatekeeperAudit = 4; + break; } return message; }; diff --git a/packages/google-cloud-gkehub/protos/protos.json b/packages/google-cloud-gkehub/protos/protos.json index 734abdb3d6f..874479b71d3 100644 --- a/packages/google-cloud-gkehub/protos/protos.json +++ b/packages/google-cloud-gkehub/protos/protos.json @@ -1412,7 +1412,8 @@ "DEPLOYMENT_STATE_UNSPECIFIED": 0, "NOT_INSTALLED": 1, "INSTALLED": 2, - "ERROR": 3 + "ERROR": 3, + "PENDING": 4 } }, "MembershipState": { @@ -1460,10 +1461,34 @@ "version": { "type": "string", "id": 10 + }, + "cluster": { + "type": "string", + "id": 11 + }, + "management": { + "type": "Management", + "id": 12 + } + }, + "nested": { + "Management": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "MANAGEMENT_AUTOMATIC": 1, + "MANAGEMENT_MANUAL": 2 + } } } }, "ConfigSync": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + } + }, "fields": { "git": { "type": "GitConfig", @@ -1472,6 +1497,25 @@ "sourceFormat": { "type": "string", "id": 8 + }, + "enabled": { + "type": "bool", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "preventDrift": { + "type": "bool", + "id": 11 + }, + "oci": { + "type": "OciConfig", + "id": 12 + }, + "metricsGcpServiceAccountEmail": { + "type": "string", + "id": 15 } } }, @@ -1511,6 +1555,30 @@ } } }, + "OciConfig": { + "fields": { + "syncRepo": { + "type": "string", + "id": 1 + }, + "policyDir": { + "type": "string", + "id": 2 + }, + "syncWaitSecs": { + "type": "int64", + "id": 3 + }, + "secretType": { + "type": "string", + "id": 4 + }, + "gcpServiceAccountEmail": { + "type": "string", + "id": 5 + } + } + }, "PolicyController": { "oneofs": { "_templateLibraryInstalled": { @@ -1648,6 +1716,51 @@ "syncState": { "type": "SyncState", "id": 3 + }, + "errors": { + "rule": "repeated", + "type": "ConfigSyncError", + "id": 4 + }, + "rootsyncCrd": { + "type": "CRDState", + "id": 5 + }, + "reposyncCrd": { + "type": "CRDState", + "id": 6 + }, + "state": { + "type": "State", + "id": 7 + } + }, + "nested": { + "CRDState": { + "values": { + "CRD_STATE_UNSPECIFIED": 0, + "NOT_INSTALLED": 1, + "INSTALLED": 2, + "TERMINATING": 3, + "INSTALLING": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CONFIG_SYNC_NOT_INSTALLED": 1, + "CONFIG_SYNC_INSTALLED": 2, + "CONFIG_SYNC_ERROR": 3, + "CONFIG_SYNC_PENDING": 4 + } + } + } + }, + "ConfigSyncError": { + "fields": { + "errorMessage": { + "type": "string", + "id": 1 } } }, @@ -1676,6 +1789,10 @@ "rootReconciler": { "type": "string", "id": 6 + }, + "admissionWebhook": { + "type": "string", + "id": 7 } } }, @@ -1704,6 +1821,10 @@ "rootReconciler": { "type": "DeploymentState", "id": 6 + }, + "admissionWebhook": { + "type": "DeploymentState", + "id": 7 } } }, diff --git a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json index 5726dc62925..04c708b1a0a 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata.google.cloud.gkehub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json index 5726dc62925..04c708b1a0a 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1/snippet_metadata_google.cloud.gkehub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json index ff15ec486af..73c43483d05 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata.google.cloud.gkehub.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json index ff15ec486af..73c43483d05 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha/snippet_metadata_google.cloud.gkehub.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json index fb65b8ad896..67afcea4be7 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata.google.cloud.gkehub.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json index fb65b8ad896..67afcea4be7 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json +++ b/packages/google-cloud-gkehub/samples/generated/v1alpha2/snippet_metadata_google.cloud.gkehub.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json index 6a8bf8071ac..eacde54ca10 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata.google.cloud.gkehub.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json index 6a8bf8071ac..eacde54ca10 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta/snippet_metadata_google.cloud.gkehub.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json index 021ff72fa89..2bf47c97bd8 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata.google.cloud.gkehub.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json index 021ff72fa89..2bf47c97bd8 100644 --- a/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json +++ b/packages/google-cloud-gkehub/samples/generated/v1beta1/snippet_metadata_google.cloud.gkehub.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gkehub", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gkehub/samples/package.json b/packages/google-cloud-gkehub/samples/package.json index 6486ff00909..b1db75608f2 100644 --- a/packages/google-cloud-gkehub/samples/package.json +++ b/packages/google-cloud-gkehub/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/gke-hub": "^4.4.0" + "@google-cloud/gke-hub": "^4.5.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-kms-inventory/CHANGELOG.md b/packages/google-cloud-kms-inventory/CHANGELOG.md index df1b9acfaab..12a27530021 100644 --- a/packages/google-cloud-kms-inventory/CHANGELOG.md +++ b/packages/google-cloud-kms-inventory/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.0](https://github.com/googleapis/google-cloud-node/compare/kms-inventory-v1.4.0...kms-inventory-v1.5.0) (2024-06-21) + + +### Features + +* [kmsinventory] support Key Access Justifications policy configuration ([#5480](https://github.com/googleapis/google-cloud-node/issues/5480)) ([83da16f](https://github.com/googleapis/google-cloud-node/commit/83da16fbfb5fc37d689b72ef9d6f607d7167ae95)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/kms-inventory-v1.3.0...kms-inventory-v1.4.0) (2024-05-21) diff --git a/packages/google-cloud-kms-inventory/package.json b/packages/google-cloud-kms-inventory/package.json index 3a6c86a1075..cbb8089444c 100644 --- a/packages/google-cloud-kms-inventory/package.json +++ b/packages/google-cloud-kms-inventory/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/kms-inventory", - "version": "1.4.0", + "version": "1.5.0", "description": "Inventory client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-kms-inventory/protos/google/cloud/kms/v1/resources.proto b/packages/google-cloud-kms-inventory/protos/google/cloud/kms/v1/resources.proto index 74bf64b23ef..1995b8b5022 100644 --- a/packages/google-cloud-kms-inventory/protos/google/cloud/kms/v1/resources.proto +++ b/packages/google-cloud-kms-inventory/protos/google/cloud/kms/v1/resources.proto @@ -202,6 +202,17 @@ message CryptoKey { (google.api.field_behavior) = IMMUTABLE, (google.api.resource_reference) = { type: "*" } ]; + + // Optional. The policy used for Key Access Justifications Policy Enforcement. + // If this field is present and this key is enrolled in Key Access + // Justifications Policy Enforcement, the policy will be evaluated in encrypt, + // decrypt, and sign operations, and the operation will fail if rejected by + // the policy. The policy is defined by specifying zero or more allowed + // justification codes. + // https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes + // By default, this field is absent, and all justification codes are allowed. + KeyAccessJustificationsPolicy key_access_justifications_policy = 17 + [(google.api.field_behavior) = OPTIONAL]; } // A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate] @@ -921,3 +932,84 @@ enum ProtectionLevel { // Crypto operations are performed in an EKM-over-VPC backend. EXTERNAL_VPC = 4; } + +// Describes the reason for a data access. Please refer to +// https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes +// for the detailed semantic meaning of justification reason codes. +enum AccessReason { + // Unspecified access reason. + REASON_UNSPECIFIED = 0; + + // Customer-initiated support. + CUSTOMER_INITIATED_SUPPORT = 1; + + // Google-initiated access for system management and troubleshooting. + GOOGLE_INITIATED_SERVICE = 2; + + // Google-initiated access in response to a legal request or legal process. + THIRD_PARTY_DATA_REQUEST = 3; + + // Google-initiated access for security, fraud, abuse, or compliance purposes. + GOOGLE_INITIATED_REVIEW = 4; + + // Customer uses their account to perform any access to their own data which + // their IAM policy authorizes. + CUSTOMER_INITIATED_ACCESS = 5; + + // Google systems access customer data to help optimize the structure of the + // data or quality for future uses by the customer. + GOOGLE_INITIATED_SYSTEM_OPERATION = 6; + + // No reason is expected for this key request. + REASON_NOT_EXPECTED = 7; + + // Customer uses their account to perform any access to their own data which + // their IAM policy authorizes, and one of the following is true: + // + // * A Google administrator has reset the root-access account associated with + // the user's organization within the past 7 days. + // * A Google-initiated emergency access operation has interacted with a + // resource in the same project or folder as the currently accessed resource + // within the past 7 days. + MODIFIED_CUSTOMER_INITIATED_ACCESS = 8; + + // Google systems access customer data to help optimize the structure of the + // data or quality for future uses by the customer, and one of the following + // is true: + // + // * A Google administrator has reset the root-access account associated with + // the user's organization within the past 7 days. + // * A Google-initiated emergency access operation has interacted with a + // resource in the same project or folder as the currently accessed resource + // within the past 7 days. + MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9; + + // Google-initiated access to maintain system reliability. + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10; + + // One of the following operations is being executed while simultaneously + // encountering an internal technical issue which prevented a more precise + // justification code from being generated: + // + // * Your account has been used to perform any access to your own data which + // your IAM policy authorizes. + // * An automated Google system operates on encrypted customer data which your + // IAM policy authorizes. + // * Customer-initiated Google support access. + // * Google-initiated support access to protect system reliability. + CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11; +} + +// A +// [KeyAccessJustificationsPolicy][google.cloud.kms.v1.KeyAccessJustificationsPolicy] +// specifies zero or more allowed +// [AccessReason][google.cloud.kms.v1.AccessReason] values for encrypt, decrypt, +// and sign operations on a [CryptoKey][google.cloud.kms.v1.CryptoKey]. +message KeyAccessJustificationsPolicy { + // The list of allowed reasons for access to a + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. Zero allowed access reasons + // means all encrypt, decrypt, and sign operations for the + // [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with this policy will + // fail. + repeated AccessReason allowed_access_reasons = 1; +} diff --git a/packages/google-cloud-kms-inventory/protos/protos.d.ts b/packages/google-cloud-kms-inventory/protos/protos.d.ts index d5b4a3f8171..787714e13c1 100644 --- a/packages/google-cloud-kms-inventory/protos/protos.d.ts +++ b/packages/google-cloud-kms-inventory/protos/protos.d.ts @@ -1094,6 +1094,9 @@ export namespace google { /** CryptoKey cryptoKeyBackend */ cryptoKeyBackend?: (string|null); + + /** CryptoKey keyAccessJustificationsPolicy */ + keyAccessJustificationsPolicy?: (google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null); } /** Represents a CryptoKey. */ @@ -1138,6 +1141,9 @@ export namespace google { /** CryptoKey cryptoKeyBackend. */ public cryptoKeyBackend: string; + /** CryptoKey keyAccessJustificationsPolicy. */ + public keyAccessJustificationsPolicy?: (google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null); + /** CryptoKey rotationSchedule. */ public rotationSchedule?: "rotationPeriod"; @@ -2316,6 +2322,119 @@ export namespace google { EXTERNAL = 3, EXTERNAL_VPC = 4 } + + /** AccessReason enum. */ + enum AccessReason { + REASON_UNSPECIFIED = 0, + CUSTOMER_INITIATED_SUPPORT = 1, + GOOGLE_INITIATED_SERVICE = 2, + THIRD_PARTY_DATA_REQUEST = 3, + GOOGLE_INITIATED_REVIEW = 4, + CUSTOMER_INITIATED_ACCESS = 5, + GOOGLE_INITIATED_SYSTEM_OPERATION = 6, + REASON_NOT_EXPECTED = 7, + MODIFIED_CUSTOMER_INITIATED_ACCESS = 8, + MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9, + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10, + CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11 + } + + /** Properties of a KeyAccessJustificationsPolicy. */ + interface IKeyAccessJustificationsPolicy { + + /** KeyAccessJustificationsPolicy allowedAccessReasons */ + allowedAccessReasons?: (google.cloud.kms.v1.AccessReason[]|null); + } + + /** Represents a KeyAccessJustificationsPolicy. */ + class KeyAccessJustificationsPolicy implements IKeyAccessJustificationsPolicy { + + /** + * Constructs a new KeyAccessJustificationsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IKeyAccessJustificationsPolicy); + + /** KeyAccessJustificationsPolicy allowedAccessReasons. */ + public allowedAccessReasons: google.cloud.kms.v1.AccessReason[]; + + /** + * Creates a new KeyAccessJustificationsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyAccessJustificationsPolicy instance + */ + public static create(properties?: google.cloud.kms.v1.IKeyAccessJustificationsPolicy): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @param message KeyAccessJustificationsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IKeyAccessJustificationsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @param message KeyAccessJustificationsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IKeyAccessJustificationsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Verifies a KeyAccessJustificationsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyAccessJustificationsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyAccessJustificationsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Creates a plain object from a KeyAccessJustificationsPolicy message. Also converts values to other types if specified. + * @param message KeyAccessJustificationsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.KeyAccessJustificationsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyAccessJustificationsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyAccessJustificationsPolicy + * @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-kms-inventory/protos/protos.js b/packages/google-cloud-kms-inventory/protos/protos.js index 99069d726be..ede619f5138 100644 --- a/packages/google-cloud-kms-inventory/protos/protos.js +++ b/packages/google-cloud-kms-inventory/protos/protos.js @@ -2707,6 +2707,7 @@ * @property {boolean|null} [importOnly] CryptoKey importOnly * @property {google.protobuf.IDuration|null} [destroyScheduledDuration] CryptoKey destroyScheduledDuration * @property {string|null} [cryptoKeyBackend] CryptoKey cryptoKeyBackend + * @property {google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null} [keyAccessJustificationsPolicy] CryptoKey keyAccessJustificationsPolicy */ /** @@ -2813,6 +2814,14 @@ */ CryptoKey.prototype.cryptoKeyBackend = ""; + /** + * CryptoKey keyAccessJustificationsPolicy. + * @member {google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null|undefined} keyAccessJustificationsPolicy + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.keyAccessJustificationsPolicy = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2874,6 +2883,8 @@ $root.google.protobuf.Duration.encode(message.destroyScheduledDuration, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.cryptoKeyBackend != null && Object.hasOwnProperty.call(message, "cryptoKeyBackend")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.cryptoKeyBackend); + if (message.keyAccessJustificationsPolicy != null && Object.hasOwnProperty.call(message, "keyAccessJustificationsPolicy")) + $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.encode(message.keyAccessJustificationsPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -2971,6 +2982,10 @@ message.cryptoKeyBackend = reader.string(); break; } + case 17: { + message.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3069,6 +3084,11 @@ if (message.cryptoKeyBackend != null && message.hasOwnProperty("cryptoKeyBackend")) if (!$util.isString(message.cryptoKeyBackend)) return "cryptoKeyBackend: string expected"; + if (message.keyAccessJustificationsPolicy != null && message.hasOwnProperty("keyAccessJustificationsPolicy")) { + var error = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify(message.keyAccessJustificationsPolicy); + if (error) + return "keyAccessJustificationsPolicy." + error; + } return null; }; @@ -3159,6 +3179,11 @@ } if (object.cryptoKeyBackend != null) message.cryptoKeyBackend = String(object.cryptoKeyBackend); + if (object.keyAccessJustificationsPolicy != null) { + if (typeof object.keyAccessJustificationsPolicy !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.keyAccessJustificationsPolicy: object expected"); + message.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.fromObject(object.keyAccessJustificationsPolicy); + } return message; }; @@ -3187,6 +3212,7 @@ object.importOnly = false; object.destroyScheduledDuration = null; object.cryptoKeyBackend = ""; + object.keyAccessJustificationsPolicy = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3217,6 +3243,8 @@ object.destroyScheduledDuration = $root.google.protobuf.Duration.toObject(message.destroyScheduledDuration, options); if (message.cryptoKeyBackend != null && message.hasOwnProperty("cryptoKeyBackend")) object.cryptoKeyBackend = message.cryptoKeyBackend; + if (message.keyAccessJustificationsPolicy != null && message.hasOwnProperty("keyAccessJustificationsPolicy")) + object.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.toObject(message.keyAccessJustificationsPolicy, options); return object; }; @@ -6886,6 +6914,336 @@ return values; })(); + /** + * AccessReason enum. + * @name google.cloud.kms.v1.AccessReason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} CUSTOMER_INITIATED_SUPPORT=1 CUSTOMER_INITIATED_SUPPORT value + * @property {number} GOOGLE_INITIATED_SERVICE=2 GOOGLE_INITIATED_SERVICE value + * @property {number} THIRD_PARTY_DATA_REQUEST=3 THIRD_PARTY_DATA_REQUEST value + * @property {number} GOOGLE_INITIATED_REVIEW=4 GOOGLE_INITIATED_REVIEW value + * @property {number} CUSTOMER_INITIATED_ACCESS=5 CUSTOMER_INITIATED_ACCESS value + * @property {number} GOOGLE_INITIATED_SYSTEM_OPERATION=6 GOOGLE_INITIATED_SYSTEM_OPERATION value + * @property {number} REASON_NOT_EXPECTED=7 REASON_NOT_EXPECTED value + * @property {number} MODIFIED_CUSTOMER_INITIATED_ACCESS=8 MODIFIED_CUSTOMER_INITIATED_ACCESS value + * @property {number} MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION=9 MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION value + * @property {number} GOOGLE_RESPONSE_TO_PRODUCTION_ALERT=10 GOOGLE_RESPONSE_TO_PRODUCTION_ALERT value + * @property {number} CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING=11 CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING value + */ + v1.AccessReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOMER_INITIATED_SUPPORT"] = 1; + values[valuesById[2] = "GOOGLE_INITIATED_SERVICE"] = 2; + values[valuesById[3] = "THIRD_PARTY_DATA_REQUEST"] = 3; + values[valuesById[4] = "GOOGLE_INITIATED_REVIEW"] = 4; + values[valuesById[5] = "CUSTOMER_INITIATED_ACCESS"] = 5; + values[valuesById[6] = "GOOGLE_INITIATED_SYSTEM_OPERATION"] = 6; + values[valuesById[7] = "REASON_NOT_EXPECTED"] = 7; + values[valuesById[8] = "MODIFIED_CUSTOMER_INITIATED_ACCESS"] = 8; + values[valuesById[9] = "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION"] = 9; + values[valuesById[10] = "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT"] = 10; + values[valuesById[11] = "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING"] = 11; + return values; + })(); + + v1.KeyAccessJustificationsPolicy = (function() { + + /** + * Properties of a KeyAccessJustificationsPolicy. + * @memberof google.cloud.kms.v1 + * @interface IKeyAccessJustificationsPolicy + * @property {Array.|null} [allowedAccessReasons] KeyAccessJustificationsPolicy allowedAccessReasons + */ + + /** + * Constructs a new KeyAccessJustificationsPolicy. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a KeyAccessJustificationsPolicy. + * @implements IKeyAccessJustificationsPolicy + * @constructor + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy=} [properties] Properties to set + */ + function KeyAccessJustificationsPolicy(properties) { + this.allowedAccessReasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyAccessJustificationsPolicy allowedAccessReasons. + * @member {Array.} allowedAccessReasons + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @instance + */ + KeyAccessJustificationsPolicy.prototype.allowedAccessReasons = $util.emptyArray; + + /** + * Creates a new KeyAccessJustificationsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy=} [properties] Properties to set + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy instance + */ + KeyAccessJustificationsPolicy.create = function create(properties) { + return new KeyAccessJustificationsPolicy(properties); + }; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyAccessJustificationsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedAccessReasons != null && message.allowedAccessReasons.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.allowedAccessReasons.length; ++i) + writer.int32(message.allowedAccessReasons[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyAccessJustificationsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyAccessJustificationsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedAccessReasons && message.allowedAccessReasons.length)) + message.allowedAccessReasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedAccessReasons.push(reader.int32()); + } else + message.allowedAccessReasons.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyAccessJustificationsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyAccessJustificationsPolicy message. + * @function verify + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyAccessJustificationsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedAccessReasons != null && message.hasOwnProperty("allowedAccessReasons")) { + if (!Array.isArray(message.allowedAccessReasons)) + return "allowedAccessReasons: array expected"; + for (var i = 0; i < message.allowedAccessReasons.length; ++i) + switch (message.allowedAccessReasons[i]) { + default: + return "allowedAccessReasons: 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: + break; + } + } + return null; + }; + + /** + * Creates a KeyAccessJustificationsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + */ + KeyAccessJustificationsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy) + return object; + var message = new $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy(); + if (object.allowedAccessReasons) { + if (!Array.isArray(object.allowedAccessReasons)) + throw TypeError(".google.cloud.kms.v1.KeyAccessJustificationsPolicy.allowedAccessReasons: array expected"); + message.allowedAccessReasons = []; + for (var i = 0; i < object.allowedAccessReasons.length; ++i) + switch (object.allowedAccessReasons[i]) { + default: + if (typeof object.allowedAccessReasons[i] === "number") { + message.allowedAccessReasons[i] = object.allowedAccessReasons[i]; + break; + } + case "REASON_UNSPECIFIED": + case 0: + message.allowedAccessReasons[i] = 0; + break; + case "CUSTOMER_INITIATED_SUPPORT": + case 1: + message.allowedAccessReasons[i] = 1; + break; + case "GOOGLE_INITIATED_SERVICE": + case 2: + message.allowedAccessReasons[i] = 2; + break; + case "THIRD_PARTY_DATA_REQUEST": + case 3: + message.allowedAccessReasons[i] = 3; + break; + case "GOOGLE_INITIATED_REVIEW": + case 4: + message.allowedAccessReasons[i] = 4; + break; + case "CUSTOMER_INITIATED_ACCESS": + case 5: + message.allowedAccessReasons[i] = 5; + break; + case "GOOGLE_INITIATED_SYSTEM_OPERATION": + case 6: + message.allowedAccessReasons[i] = 6; + break; + case "REASON_NOT_EXPECTED": + case 7: + message.allowedAccessReasons[i] = 7; + break; + case "MODIFIED_CUSTOMER_INITIATED_ACCESS": + case 8: + message.allowedAccessReasons[i] = 8; + break; + case "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION": + case 9: + message.allowedAccessReasons[i] = 9; + break; + case "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT": + case 10: + message.allowedAccessReasons[i] = 10; + break; + case "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING": + case 11: + message.allowedAccessReasons[i] = 11; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a KeyAccessJustificationsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.KeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyAccessJustificationsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedAccessReasons = []; + if (message.allowedAccessReasons && message.allowedAccessReasons.length) { + object.allowedAccessReasons = []; + for (var j = 0; j < message.allowedAccessReasons.length; ++j) + object.allowedAccessReasons[j] = options.enums === String ? $root.google.cloud.kms.v1.AccessReason[message.allowedAccessReasons[j]] === undefined ? message.allowedAccessReasons[j] : $root.google.cloud.kms.v1.AccessReason[message.allowedAccessReasons[j]] : message.allowedAccessReasons[j]; + } + return object; + }; + + /** + * Converts this KeyAccessJustificationsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @instance + * @returns {Object.} JSON object + */ + KeyAccessJustificationsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyAccessJustificationsPolicy + * @function getTypeUrl + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyAccessJustificationsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.kms.v1.KeyAccessJustificationsPolicy"; + }; + + return KeyAccessJustificationsPolicy; + })(); + return v1; })(); diff --git a/packages/google-cloud-kms-inventory/protos/protos.json b/packages/google-cloud-kms-inventory/protos/protos.json index 2a8ec8fd51d..dbb5c0281b3 100644 --- a/packages/google-cloud-kms-inventory/protos/protos.json +++ b/packages/google-cloud-kms-inventory/protos/protos.json @@ -399,6 +399,13 @@ "(google.api.field_behavior)": "IMMUTABLE", "(google.api.resource_reference).type": "*" } + }, + "keyAccessJustificationsPolicy": { + "type": "KeyAccessJustificationsPolicy", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -814,6 +821,31 @@ "EXTERNAL": 3, "EXTERNAL_VPC": 4 } + }, + "AccessReason": { + "values": { + "REASON_UNSPECIFIED": 0, + "CUSTOMER_INITIATED_SUPPORT": 1, + "GOOGLE_INITIATED_SERVICE": 2, + "THIRD_PARTY_DATA_REQUEST": 3, + "GOOGLE_INITIATED_REVIEW": 4, + "CUSTOMER_INITIATED_ACCESS": 5, + "GOOGLE_INITIATED_SYSTEM_OPERATION": 6, + "REASON_NOT_EXPECTED": 7, + "MODIFIED_CUSTOMER_INITIATED_ACCESS": 8, + "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION": 9, + "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT": 10, + "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING": 11 + } + }, + "KeyAccessJustificationsPolicy": { + "fields": { + "allowedAccessReasons": { + "rule": "repeated", + "type": "AccessReason", + "id": 1 + } + } } } } diff --git a/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata.google.cloud.kms.inventory.v1.json b/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata.google.cloud.kms.inventory.v1.json index 27670e49cb1..f8e762770dc 100644 --- a/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata.google.cloud.kms.inventory.v1.json +++ b/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata.google.cloud.kms.inventory.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-inventory", - "version": "1.4.0", + "version": "1.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata_google.cloud.kms.inventory.v1.json b/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata_google.cloud.kms.inventory.v1.json index 27670e49cb1..f8e762770dc 100644 --- a/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata_google.cloud.kms.inventory.v1.json +++ b/packages/google-cloud-kms-inventory/samples/generated/v1/snippet_metadata_google.cloud.kms.inventory.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-inventory", - "version": "1.4.0", + "version": "1.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-kms-inventory/samples/package.json b/packages/google-cloud-kms-inventory/samples/package.json index 52aad3c3b91..6fc1822adcc 100644 --- a/packages/google-cloud-kms-inventory/samples/package.json +++ b/packages/google-cloud-kms-inventory/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/kms-inventory": "^1.4.0" + "@google-cloud/kms-inventory": "^1.5.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-kms/CHANGELOG.md b/packages/google-cloud-kms/CHANGELOG.md index 96b8ef34b24..757018c29ea 100644 --- a/packages/google-cloud-kms/CHANGELOG.md +++ b/packages/google-cloud-kms/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/kms?activeTab=versions +## [4.5.0](https://github.com/googleapis/google-cloud-node/compare/kms-v4.4.0...kms-v4.5.0) (2024-06-21) + + +### Features + +* [kms] support Key Access Justifications policy configuration ([#5479](https://github.com/googleapis/google-cloud-node/issues/5479)) ([a6a77c9](https://github.com/googleapis/google-cloud-node/commit/a6a77c9eda7428840ce2a01572ee2773b2760f36)) + ## [4.4.0](https://github.com/googleapis/google-cloud-node/compare/kms-v4.3.0...kms-v4.4.0) (2024-05-21) diff --git a/packages/google-cloud-kms/package.json b/packages/google-cloud-kms/package.json index 92fdd564603..e0d9ba6aa97 100644 --- a/packages/google-cloud-kms/package.json +++ b/packages/google-cloud-kms/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/kms", "description": "Google Cloud Key Management Service (KMS) API client for Node.js", - "version": "4.4.0", + "version": "4.5.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto b/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto index 74bf64b23ef..1995b8b5022 100644 --- a/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto +++ b/packages/google-cloud-kms/protos/google/cloud/kms/v1/resources.proto @@ -202,6 +202,17 @@ message CryptoKey { (google.api.field_behavior) = IMMUTABLE, (google.api.resource_reference) = { type: "*" } ]; + + // Optional. The policy used for Key Access Justifications Policy Enforcement. + // If this field is present and this key is enrolled in Key Access + // Justifications Policy Enforcement, the policy will be evaluated in encrypt, + // decrypt, and sign operations, and the operation will fail if rejected by + // the policy. The policy is defined by specifying zero or more allowed + // justification codes. + // https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes + // By default, this field is absent, and all justification codes are allowed. + KeyAccessJustificationsPolicy key_access_justifications_policy = 17 + [(google.api.field_behavior) = OPTIONAL]; } // A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate] @@ -921,3 +932,84 @@ enum ProtectionLevel { // Crypto operations are performed in an EKM-over-VPC backend. EXTERNAL_VPC = 4; } + +// Describes the reason for a data access. Please refer to +// https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes +// for the detailed semantic meaning of justification reason codes. +enum AccessReason { + // Unspecified access reason. + REASON_UNSPECIFIED = 0; + + // Customer-initiated support. + CUSTOMER_INITIATED_SUPPORT = 1; + + // Google-initiated access for system management and troubleshooting. + GOOGLE_INITIATED_SERVICE = 2; + + // Google-initiated access in response to a legal request or legal process. + THIRD_PARTY_DATA_REQUEST = 3; + + // Google-initiated access for security, fraud, abuse, or compliance purposes. + GOOGLE_INITIATED_REVIEW = 4; + + // Customer uses their account to perform any access to their own data which + // their IAM policy authorizes. + CUSTOMER_INITIATED_ACCESS = 5; + + // Google systems access customer data to help optimize the structure of the + // data or quality for future uses by the customer. + GOOGLE_INITIATED_SYSTEM_OPERATION = 6; + + // No reason is expected for this key request. + REASON_NOT_EXPECTED = 7; + + // Customer uses their account to perform any access to their own data which + // their IAM policy authorizes, and one of the following is true: + // + // * A Google administrator has reset the root-access account associated with + // the user's organization within the past 7 days. + // * A Google-initiated emergency access operation has interacted with a + // resource in the same project or folder as the currently accessed resource + // within the past 7 days. + MODIFIED_CUSTOMER_INITIATED_ACCESS = 8; + + // Google systems access customer data to help optimize the structure of the + // data or quality for future uses by the customer, and one of the following + // is true: + // + // * A Google administrator has reset the root-access account associated with + // the user's organization within the past 7 days. + // * A Google-initiated emergency access operation has interacted with a + // resource in the same project or folder as the currently accessed resource + // within the past 7 days. + MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9; + + // Google-initiated access to maintain system reliability. + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10; + + // One of the following operations is being executed while simultaneously + // encountering an internal technical issue which prevented a more precise + // justification code from being generated: + // + // * Your account has been used to perform any access to your own data which + // your IAM policy authorizes. + // * An automated Google system operates on encrypted customer data which your + // IAM policy authorizes. + // * Customer-initiated Google support access. + // * Google-initiated support access to protect system reliability. + CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11; +} + +// A +// [KeyAccessJustificationsPolicy][google.cloud.kms.v1.KeyAccessJustificationsPolicy] +// specifies zero or more allowed +// [AccessReason][google.cloud.kms.v1.AccessReason] values for encrypt, decrypt, +// and sign operations on a [CryptoKey][google.cloud.kms.v1.CryptoKey]. +message KeyAccessJustificationsPolicy { + // The list of allowed reasons for access to a + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. Zero allowed access reasons + // means all encrypt, decrypt, and sign operations for the + // [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with this policy will + // fail. + repeated AccessReason allowed_access_reasons = 1; +} diff --git a/packages/google-cloud-kms/protos/protos.d.ts b/packages/google-cloud-kms/protos/protos.d.ts index 0837231eefd..3c3b3d42120 100644 --- a/packages/google-cloud-kms/protos/protos.d.ts +++ b/packages/google-cloud-kms/protos/protos.d.ts @@ -3039,6 +3039,9 @@ export namespace google { /** CryptoKey cryptoKeyBackend */ cryptoKeyBackend?: (string|null); + + /** CryptoKey keyAccessJustificationsPolicy */ + keyAccessJustificationsPolicy?: (google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null); } /** Represents a CryptoKey. */ @@ -3083,6 +3086,9 @@ export namespace google { /** CryptoKey cryptoKeyBackend. */ public cryptoKeyBackend: string; + /** CryptoKey keyAccessJustificationsPolicy. */ + public keyAccessJustificationsPolicy?: (google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null); + /** CryptoKey rotationSchedule. */ public rotationSchedule?: "rotationPeriod"; @@ -4262,6 +4268,119 @@ export namespace google { EXTERNAL_VPC = 4 } + /** AccessReason enum. */ + enum AccessReason { + REASON_UNSPECIFIED = 0, + CUSTOMER_INITIATED_SUPPORT = 1, + GOOGLE_INITIATED_SERVICE = 2, + THIRD_PARTY_DATA_REQUEST = 3, + GOOGLE_INITIATED_REVIEW = 4, + CUSTOMER_INITIATED_ACCESS = 5, + GOOGLE_INITIATED_SYSTEM_OPERATION = 6, + REASON_NOT_EXPECTED = 7, + MODIFIED_CUSTOMER_INITIATED_ACCESS = 8, + MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION = 9, + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 10, + CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING = 11 + } + + /** Properties of a KeyAccessJustificationsPolicy. */ + interface IKeyAccessJustificationsPolicy { + + /** KeyAccessJustificationsPolicy allowedAccessReasons */ + allowedAccessReasons?: (google.cloud.kms.v1.AccessReason[]|null); + } + + /** Represents a KeyAccessJustificationsPolicy. */ + class KeyAccessJustificationsPolicy implements IKeyAccessJustificationsPolicy { + + /** + * Constructs a new KeyAccessJustificationsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.kms.v1.IKeyAccessJustificationsPolicy); + + /** KeyAccessJustificationsPolicy allowedAccessReasons. */ + public allowedAccessReasons: google.cloud.kms.v1.AccessReason[]; + + /** + * Creates a new KeyAccessJustificationsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyAccessJustificationsPolicy instance + */ + public static create(properties?: google.cloud.kms.v1.IKeyAccessJustificationsPolicy): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @param message KeyAccessJustificationsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.kms.v1.IKeyAccessJustificationsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @param message KeyAccessJustificationsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.kms.v1.IKeyAccessJustificationsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Verifies a KeyAccessJustificationsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyAccessJustificationsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyAccessJustificationsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.kms.v1.KeyAccessJustificationsPolicy; + + /** + * Creates a plain object from a KeyAccessJustificationsPolicy message. Also converts values to other types if specified. + * @param message KeyAccessJustificationsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.kms.v1.KeyAccessJustificationsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyAccessJustificationsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyAccessJustificationsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a KeyManagementService */ class KeyManagementService extends $protobuf.rpc.Service { diff --git a/packages/google-cloud-kms/protos/protos.js b/packages/google-cloud-kms/protos/protos.js index 16a2c2bafd2..fa14d3a3881 100644 --- a/packages/google-cloud-kms/protos/protos.js +++ b/packages/google-cloud-kms/protos/protos.js @@ -6669,6 +6669,7 @@ * @property {boolean|null} [importOnly] CryptoKey importOnly * @property {google.protobuf.IDuration|null} [destroyScheduledDuration] CryptoKey destroyScheduledDuration * @property {string|null} [cryptoKeyBackend] CryptoKey cryptoKeyBackend + * @property {google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null} [keyAccessJustificationsPolicy] CryptoKey keyAccessJustificationsPolicy */ /** @@ -6775,6 +6776,14 @@ */ CryptoKey.prototype.cryptoKeyBackend = ""; + /** + * CryptoKey keyAccessJustificationsPolicy. + * @member {google.cloud.kms.v1.IKeyAccessJustificationsPolicy|null|undefined} keyAccessJustificationsPolicy + * @memberof google.cloud.kms.v1.CryptoKey + * @instance + */ + CryptoKey.prototype.keyAccessJustificationsPolicy = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6836,6 +6845,8 @@ $root.google.protobuf.Duration.encode(message.destroyScheduledDuration, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.cryptoKeyBackend != null && Object.hasOwnProperty.call(message, "cryptoKeyBackend")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.cryptoKeyBackend); + if (message.keyAccessJustificationsPolicy != null && Object.hasOwnProperty.call(message, "keyAccessJustificationsPolicy")) + $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.encode(message.keyAccessJustificationsPolicy, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -6933,6 +6944,10 @@ message.cryptoKeyBackend = reader.string(); break; } + case 17: { + message.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7031,6 +7046,11 @@ if (message.cryptoKeyBackend != null && message.hasOwnProperty("cryptoKeyBackend")) if (!$util.isString(message.cryptoKeyBackend)) return "cryptoKeyBackend: string expected"; + if (message.keyAccessJustificationsPolicy != null && message.hasOwnProperty("keyAccessJustificationsPolicy")) { + var error = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify(message.keyAccessJustificationsPolicy); + if (error) + return "keyAccessJustificationsPolicy." + error; + } return null; }; @@ -7121,6 +7141,11 @@ } if (object.cryptoKeyBackend != null) message.cryptoKeyBackend = String(object.cryptoKeyBackend); + if (object.keyAccessJustificationsPolicy != null) { + if (typeof object.keyAccessJustificationsPolicy !== "object") + throw TypeError(".google.cloud.kms.v1.CryptoKey.keyAccessJustificationsPolicy: object expected"); + message.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.fromObject(object.keyAccessJustificationsPolicy); + } return message; }; @@ -7149,6 +7174,7 @@ object.importOnly = false; object.destroyScheduledDuration = null; object.cryptoKeyBackend = ""; + object.keyAccessJustificationsPolicy = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -7179,6 +7205,8 @@ object.destroyScheduledDuration = $root.google.protobuf.Duration.toObject(message.destroyScheduledDuration, options); if (message.cryptoKeyBackend != null && message.hasOwnProperty("cryptoKeyBackend")) object.cryptoKeyBackend = message.cryptoKeyBackend; + if (message.keyAccessJustificationsPolicy != null && message.hasOwnProperty("keyAccessJustificationsPolicy")) + object.keyAccessJustificationsPolicy = $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy.toObject(message.keyAccessJustificationsPolicy, options); return object; }; @@ -10848,6 +10876,336 @@ return values; })(); + /** + * AccessReason enum. + * @name google.cloud.kms.v1.AccessReason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} CUSTOMER_INITIATED_SUPPORT=1 CUSTOMER_INITIATED_SUPPORT value + * @property {number} GOOGLE_INITIATED_SERVICE=2 GOOGLE_INITIATED_SERVICE value + * @property {number} THIRD_PARTY_DATA_REQUEST=3 THIRD_PARTY_DATA_REQUEST value + * @property {number} GOOGLE_INITIATED_REVIEW=4 GOOGLE_INITIATED_REVIEW value + * @property {number} CUSTOMER_INITIATED_ACCESS=5 CUSTOMER_INITIATED_ACCESS value + * @property {number} GOOGLE_INITIATED_SYSTEM_OPERATION=6 GOOGLE_INITIATED_SYSTEM_OPERATION value + * @property {number} REASON_NOT_EXPECTED=7 REASON_NOT_EXPECTED value + * @property {number} MODIFIED_CUSTOMER_INITIATED_ACCESS=8 MODIFIED_CUSTOMER_INITIATED_ACCESS value + * @property {number} MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION=9 MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION value + * @property {number} GOOGLE_RESPONSE_TO_PRODUCTION_ALERT=10 GOOGLE_RESPONSE_TO_PRODUCTION_ALERT value + * @property {number} CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING=11 CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING value + */ + v1.AccessReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "CUSTOMER_INITIATED_SUPPORT"] = 1; + values[valuesById[2] = "GOOGLE_INITIATED_SERVICE"] = 2; + values[valuesById[3] = "THIRD_PARTY_DATA_REQUEST"] = 3; + values[valuesById[4] = "GOOGLE_INITIATED_REVIEW"] = 4; + values[valuesById[5] = "CUSTOMER_INITIATED_ACCESS"] = 5; + values[valuesById[6] = "GOOGLE_INITIATED_SYSTEM_OPERATION"] = 6; + values[valuesById[7] = "REASON_NOT_EXPECTED"] = 7; + values[valuesById[8] = "MODIFIED_CUSTOMER_INITIATED_ACCESS"] = 8; + values[valuesById[9] = "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION"] = 9; + values[valuesById[10] = "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT"] = 10; + values[valuesById[11] = "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING"] = 11; + return values; + })(); + + v1.KeyAccessJustificationsPolicy = (function() { + + /** + * Properties of a KeyAccessJustificationsPolicy. + * @memberof google.cloud.kms.v1 + * @interface IKeyAccessJustificationsPolicy + * @property {Array.|null} [allowedAccessReasons] KeyAccessJustificationsPolicy allowedAccessReasons + */ + + /** + * Constructs a new KeyAccessJustificationsPolicy. + * @memberof google.cloud.kms.v1 + * @classdesc Represents a KeyAccessJustificationsPolicy. + * @implements IKeyAccessJustificationsPolicy + * @constructor + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy=} [properties] Properties to set + */ + function KeyAccessJustificationsPolicy(properties) { + this.allowedAccessReasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyAccessJustificationsPolicy allowedAccessReasons. + * @member {Array.} allowedAccessReasons + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @instance + */ + KeyAccessJustificationsPolicy.prototype.allowedAccessReasons = $util.emptyArray; + + /** + * Creates a new KeyAccessJustificationsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy=} [properties] Properties to set + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy instance + */ + KeyAccessJustificationsPolicy.create = function create(properties) { + return new KeyAccessJustificationsPolicy(properties); + }; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyAccessJustificationsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedAccessReasons != null && message.allowedAccessReasons.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.allowedAccessReasons.length; ++i) + writer.int32(message.allowedAccessReasons[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified KeyAccessJustificationsPolicy message, length delimited. Does not implicitly {@link google.cloud.kms.v1.KeyAccessJustificationsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.IKeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyAccessJustificationsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyAccessJustificationsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedAccessReasons && message.allowedAccessReasons.length)) + message.allowedAccessReasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedAccessReasons.push(reader.int32()); + } else + message.allowedAccessReasons.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyAccessJustificationsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyAccessJustificationsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyAccessJustificationsPolicy message. + * @function verify + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyAccessJustificationsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedAccessReasons != null && message.hasOwnProperty("allowedAccessReasons")) { + if (!Array.isArray(message.allowedAccessReasons)) + return "allowedAccessReasons: array expected"; + for (var i = 0; i < message.allowedAccessReasons.length; ++i) + switch (message.allowedAccessReasons[i]) { + default: + return "allowedAccessReasons: 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: + break; + } + } + return null; + }; + + /** + * Creates a KeyAccessJustificationsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.kms.v1.KeyAccessJustificationsPolicy} KeyAccessJustificationsPolicy + */ + KeyAccessJustificationsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy) + return object; + var message = new $root.google.cloud.kms.v1.KeyAccessJustificationsPolicy(); + if (object.allowedAccessReasons) { + if (!Array.isArray(object.allowedAccessReasons)) + throw TypeError(".google.cloud.kms.v1.KeyAccessJustificationsPolicy.allowedAccessReasons: array expected"); + message.allowedAccessReasons = []; + for (var i = 0; i < object.allowedAccessReasons.length; ++i) + switch (object.allowedAccessReasons[i]) { + default: + if (typeof object.allowedAccessReasons[i] === "number") { + message.allowedAccessReasons[i] = object.allowedAccessReasons[i]; + break; + } + case "REASON_UNSPECIFIED": + case 0: + message.allowedAccessReasons[i] = 0; + break; + case "CUSTOMER_INITIATED_SUPPORT": + case 1: + message.allowedAccessReasons[i] = 1; + break; + case "GOOGLE_INITIATED_SERVICE": + case 2: + message.allowedAccessReasons[i] = 2; + break; + case "THIRD_PARTY_DATA_REQUEST": + case 3: + message.allowedAccessReasons[i] = 3; + break; + case "GOOGLE_INITIATED_REVIEW": + case 4: + message.allowedAccessReasons[i] = 4; + break; + case "CUSTOMER_INITIATED_ACCESS": + case 5: + message.allowedAccessReasons[i] = 5; + break; + case "GOOGLE_INITIATED_SYSTEM_OPERATION": + case 6: + message.allowedAccessReasons[i] = 6; + break; + case "REASON_NOT_EXPECTED": + case 7: + message.allowedAccessReasons[i] = 7; + break; + case "MODIFIED_CUSTOMER_INITIATED_ACCESS": + case 8: + message.allowedAccessReasons[i] = 8; + break; + case "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION": + case 9: + message.allowedAccessReasons[i] = 9; + break; + case "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT": + case 10: + message.allowedAccessReasons[i] = 10; + break; + case "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING": + case 11: + message.allowedAccessReasons[i] = 11; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a KeyAccessJustificationsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {google.cloud.kms.v1.KeyAccessJustificationsPolicy} message KeyAccessJustificationsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyAccessJustificationsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedAccessReasons = []; + if (message.allowedAccessReasons && message.allowedAccessReasons.length) { + object.allowedAccessReasons = []; + for (var j = 0; j < message.allowedAccessReasons.length; ++j) + object.allowedAccessReasons[j] = options.enums === String ? $root.google.cloud.kms.v1.AccessReason[message.allowedAccessReasons[j]] === undefined ? message.allowedAccessReasons[j] : $root.google.cloud.kms.v1.AccessReason[message.allowedAccessReasons[j]] : message.allowedAccessReasons[j]; + } + return object; + }; + + /** + * Converts this KeyAccessJustificationsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @instance + * @returns {Object.} JSON object + */ + KeyAccessJustificationsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyAccessJustificationsPolicy + * @function getTypeUrl + * @memberof google.cloud.kms.v1.KeyAccessJustificationsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyAccessJustificationsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.kms.v1.KeyAccessJustificationsPolicy"; + }; + + return KeyAccessJustificationsPolicy; + })(); + v1.KeyManagementService = (function() { /** diff --git a/packages/google-cloud-kms/protos/protos.json b/packages/google-cloud-kms/protos/protos.json index 0a2e6133f6d..5f177f0146c 100644 --- a/packages/google-cloud-kms/protos/protos.json +++ b/packages/google-cloud-kms/protos/protos.json @@ -911,6 +911,13 @@ "(google.api.field_behavior)": "IMMUTABLE", "(google.api.resource_reference).type": "*" } + }, + "keyAccessJustificationsPolicy": { + "type": "KeyAccessJustificationsPolicy", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1327,6 +1334,31 @@ "EXTERNAL_VPC": 4 } }, + "AccessReason": { + "values": { + "REASON_UNSPECIFIED": 0, + "CUSTOMER_INITIATED_SUPPORT": 1, + "GOOGLE_INITIATED_SERVICE": 2, + "THIRD_PARTY_DATA_REQUEST": 3, + "GOOGLE_INITIATED_REVIEW": 4, + "CUSTOMER_INITIATED_ACCESS": 5, + "GOOGLE_INITIATED_SYSTEM_OPERATION": 6, + "REASON_NOT_EXPECTED": 7, + "MODIFIED_CUSTOMER_INITIATED_ACCESS": 8, + "MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION": 9, + "GOOGLE_RESPONSE_TO_PRODUCTION_ALERT": 10, + "CUSTOMER_AUTHORIZED_WORKFLOW_SERVICING": 11 + } + }, + "KeyAccessJustificationsPolicy": { + "fields": { + "allowedAccessReasons": { + "rule": "repeated", + "type": "AccessReason", + "id": 1 + } + } + }, "KeyManagementService": { "options": { "(google.api.default_host)": "cloudkms.googleapis.com", diff --git a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json index 53cf4c71319..f8c176e65dc 100644 --- a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json +++ b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata.google.cloud.kms.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-kms", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata_google.cloud.kms.v1.json b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata_google.cloud.kms.v1.json index cfb7efadba7..4e5304c269f 100644 --- a/packages/google-cloud-kms/samples/generated/v1/snippet_metadata_google.cloud.kms.v1.json +++ b/packages/google-cloud-kms/samples/generated/v1/snippet_metadata_google.cloud.kms.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-kms", - "version": "4.4.0", + "version": "4.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-kms/samples/package.json b/packages/google-cloud-kms/samples/package.json index 2021afa2571..3391e011c27 100644 --- a/packages/google-cloud-kms/samples/package.json +++ b/packages/google-cloud-kms/samples/package.json @@ -14,7 +14,7 @@ "test": "c8 mocha --recursive test/ --timeout=800000" }, "dependencies": { - "@google-cloud/kms": "^4.4.0", + "@google-cloud/kms": "^4.5.0", "fast-crc32c": "^2.0.0", "jslint": "^0.12.1" }, diff --git a/packages/google-cloud-lifesciences/protos/google/cloud/lifesciences/v2beta/workflows.proto b/packages/google-cloud-lifesciences/protos/google/cloud/lifesciences/v2beta/workflows.proto index 69e11a8d2fd..a947a71226c 100644 --- a/packages/google-cloud-lifesciences/protos/google/cloud/lifesciences/v2beta/workflows.proto +++ b/packages/google-cloud-lifesciences/protos/google/cloud/lifesciences/v2beta/workflows.proto @@ -448,7 +448,7 @@ message ServiceAccount { // Carries information about an accelerator that can be attached to a VM. message Accelerator { - // The accelerator type string (for example, "nvidia-tesla-k80"). + // The accelerator type string (for example, "nvidia-tesla-t4"). // // Only NVIDIA GPU accelerators are currently supported. If an NVIDIA GPU is // attached, the required runtime libraries will be made available to all diff --git a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto index e40632f519b..ca497079af9 100644 --- a/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto +++ b/packages/google-cloud-oslogin/protos/google/cloud/oslogin/v1beta/oslogin.proto @@ -308,10 +308,7 @@ message SignSshPublicKeyRequest { // The SSH public key to sign. string ssh_public_key = 1; - // The parent project and zone for the signing request. This is needed to - // properly ensure per-organization ISS processing and potentially to provide - // for the possibility of zone-specific certificates used in the signing - // process. + // The parent project and region for the signing request. string parent = 2; } diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.sign_ssh_public_key.js b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.sign_ssh_public_key.js index 1c3eae72b2f..e685a4376f6 100644 --- a/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.sign_ssh_public_key.js +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/os_login_service.sign_ssh_public_key.js @@ -33,10 +33,7 @@ function main() { */ // const sshPublicKey = 'abc123' /** - * The parent project and zone for the signing request. This is needed to - * properly ensure per-organization ISS processing and potentially to provide - * for the possibility of zone-specific certificates used in the signing - * process. + * The parent project and region for the signing request. */ // const parent = 'abc123' diff --git a/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata_google.cloud.oslogin.v1beta.json b/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata_google.cloud.oslogin.v1beta.json index 9854cc919ae..53853bf71a3 100644 --- a/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata_google.cloud.oslogin.v1beta.json +++ b/packages/google-cloud-oslogin/samples/generated/v1beta/snippet_metadata_google.cloud.oslogin.v1beta.json @@ -342,7 +342,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 56, "type": "FULL" } ], diff --git a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts index 0f4b15f09df..bbb44df8322 100644 --- a/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts +++ b/packages/google-cloud-oslogin/src/v1beta/os_login_service_client.ts @@ -1058,10 +1058,7 @@ export class OsLoginServiceClient { * @param {string} request.sshPublicKey * The SSH public key to sign. * @param {string} request.parent - * The parent project and zone for the signing request. This is needed to - * properly ensure per-organization ISS processing and potentially to provide - * for the possibility of zone-specific certificates used in the signing - * process. + * The parent project and region for the signing request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md index f225be19a71..6bb3014a4d8 100644 --- a/packages/google-cloud-recaptchaenterprise/CHANGELOG.md +++ b/packages/google-cloud-recaptchaenterprise/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/recaptcha-enterprise?activeTab=versions +## [5.10.0](https://github.com/googleapis/google-cloud-node/compare/recaptcha-enterprise-v5.9.0...recaptcha-enterprise-v5.10.0) (2024-06-26) + + +### Features + +* [recaptchaenterprise] added SMS Toll Fraud assessment ([#5499](https://github.com/googleapis/google-cloud-node/issues/5499)) ([6179569](https://github.com/googleapis/google-cloud-node/commit/617956910ab08fb98763da804a85a6c3e6acec8d)) + ## [5.9.0](https://github.com/googleapis/google-cloud-node/compare/recaptcha-enterprise-v5.8.0...recaptcha-enterprise-v5.9.0) (2024-05-21) diff --git a/packages/google-cloud-recaptchaenterprise/package.json b/packages/google-cloud-recaptchaenterprise/package.json index a71ed37194b..472dd26619e 100644 --- a/packages/google-cloud-recaptchaenterprise/package.json +++ b/packages/google-cloud-recaptchaenterprise/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/googleapis/google-cloud-node.git" }, "name": "@google-cloud/recaptcha-enterprise", - "version": "5.9.0", + "version": "5.10.0", "author": "Google LLC", "description": "reCAPTCHA Enterprise API client for Node.js", "main": "build/src/index.js", diff --git a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto index c8163ccace7..be727b9e944 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto +++ b/packages/google-cloud-recaptchaenterprise/protos/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto @@ -649,6 +649,12 @@ message Assessment { // Output only. Fraud Signals specific to the users involved in a payment // transaction. FraudSignals fraud_signals = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Assessment returned when a site key, a token, and a phone + // number as `user_id` are provided. Account defender and SMS toll fraud + // protection need to be enabled. + PhoneFraudAssessment phone_fraud_assessment = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // The event being assessed. @@ -1116,6 +1122,33 @@ message FraudSignals { CardSignals card_signals = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Information about SMS toll fraud. +message SmsTollFraudVerdict { + // Reasons contributing to the SMS toll fraud verdict. + enum SmsTollFraudReason { + // Default unspecified reason + SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0; + + // The provided phone number was invalid + INVALID_PHONE_NUMBER = 1; + } + + // Output only. Probability of an SMS event being fraudulent. + // Values are from 0.0 (lowest) to 1.0 (highest). + float risk = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reasons contributing to the SMS toll fraud verdict. + repeated SmsTollFraudReason reasons = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Assessment for Phone Fraud +message PhoneFraudAssessment { + // Output only. Assessment of this phone event for risk of SMS toll fraud. + SmsTollFraudVerdict sms_toll_fraud_verdict = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Account defender risk assessment. message AccountDefenderAssessment { // Labels returned by account defender for this request. diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts index 2af289ee0a6..23f7037090e 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.d.ts @@ -1339,6 +1339,9 @@ export namespace google { /** Assessment fraudSignals */ fraudSignals?: (google.cloud.recaptchaenterprise.v1.IFraudSignals|null); + + /** Assessment phoneFraudAssessment */ + phoneFraudAssessment?: (google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null); } /** Represents an Assessment. */ @@ -1380,6 +1383,9 @@ export namespace google { /** Assessment fraudSignals. */ public fraudSignals?: (google.cloud.recaptchaenterprise.v1.IFraudSignals|null); + /** Assessment phoneFraudAssessment. */ + public phoneFraudAssessment?: (google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null); + /** * Creates a new Assessment instance using the specified properties. * @param [properties] Properties to set @@ -3526,6 +3532,215 @@ export namespace google { } } + /** Properties of a SmsTollFraudVerdict. */ + interface ISmsTollFraudVerdict { + + /** SmsTollFraudVerdict risk */ + risk?: (number|null); + + /** SmsTollFraudVerdict reasons */ + reasons?: (google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason[]|null); + } + + /** Represents a SmsTollFraudVerdict. */ + class SmsTollFraudVerdict implements ISmsTollFraudVerdict { + + /** + * Constructs a new SmsTollFraudVerdict. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict); + + /** SmsTollFraudVerdict risk. */ + public risk: number; + + /** SmsTollFraudVerdict reasons. */ + public reasons: google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason[]; + + /** + * Creates a new SmsTollFraudVerdict instance using the specified properties. + * @param [properties] Properties to set + * @returns SmsTollFraudVerdict instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict): google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict; + + /** + * Encodes the specified SmsTollFraudVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.verify|verify} messages. + * @param message SmsTollFraudVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SmsTollFraudVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.verify|verify} messages. + * @param message SmsTollFraudVerdict message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SmsTollFraudVerdict message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SmsTollFraudVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict; + + /** + * Decodes a SmsTollFraudVerdict message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SmsTollFraudVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict; + + /** + * Verifies a SmsTollFraudVerdict message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SmsTollFraudVerdict message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SmsTollFraudVerdict + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict; + + /** + * Creates a plain object from a SmsTollFraudVerdict message. Also converts values to other types if specified. + * @param message SmsTollFraudVerdict + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SmsTollFraudVerdict to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SmsTollFraudVerdict + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SmsTollFraudVerdict { + + /** SmsTollFraudReason enum. */ + enum SmsTollFraudReason { + SMS_TOLL_FRAUD_REASON_UNSPECIFIED = 0, + INVALID_PHONE_NUMBER = 1 + } + } + + /** Properties of a PhoneFraudAssessment. */ + interface IPhoneFraudAssessment { + + /** PhoneFraudAssessment smsTollFraudVerdict */ + smsTollFraudVerdict?: (google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict|null); + } + + /** Represents a PhoneFraudAssessment. */ + class PhoneFraudAssessment implements IPhoneFraudAssessment { + + /** + * Constructs a new PhoneFraudAssessment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment); + + /** PhoneFraudAssessment smsTollFraudVerdict. */ + public smsTollFraudVerdict?: (google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict|null); + + /** + * Creates a new PhoneFraudAssessment instance using the specified properties. + * @param [properties] Properties to set + * @returns PhoneFraudAssessment instance + */ + public static create(properties?: google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment): google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment; + + /** + * Encodes the specified PhoneFraudAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.verify|verify} messages. + * @param message PhoneFraudAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhoneFraudAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.verify|verify} messages. + * @param message PhoneFraudAssessment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhoneFraudAssessment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhoneFraudAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment; + + /** + * Decodes a PhoneFraudAssessment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhoneFraudAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment; + + /** + * Verifies a PhoneFraudAssessment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhoneFraudAssessment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhoneFraudAssessment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment; + + /** + * Creates a plain object from a PhoneFraudAssessment message. Also converts values to other types if specified. + * @param message PhoneFraudAssessment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhoneFraudAssessment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhoneFraudAssessment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AccountDefenderAssessment. */ interface IAccountDefenderAssessment { diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.js b/packages/google-cloud-recaptchaenterprise/protos/protos.js index b644cb2d654..cf8429691ea 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.js +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.js @@ -3124,6 +3124,7 @@ * @property {google.cloud.recaptchaenterprise.v1.IFirewallPolicyAssessment|null} [firewallPolicyAssessment] Assessment firewallPolicyAssessment * @property {google.cloud.recaptchaenterprise.v1.IFraudPreventionAssessment|null} [fraudPreventionAssessment] Assessment fraudPreventionAssessment * @property {google.cloud.recaptchaenterprise.v1.IFraudSignals|null} [fraudSignals] Assessment fraudSignals + * @property {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null} [phoneFraudAssessment] Assessment phoneFraudAssessment */ /** @@ -3221,6 +3222,14 @@ */ Assessment.prototype.fraudSignals = null; + /** + * Assessment phoneFraudAssessment. + * @member {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment|null|undefined} phoneFraudAssessment + * @memberof google.cloud.recaptchaenterprise.v1.Assessment + * @instance + */ + Assessment.prototype.phoneFraudAssessment = null; + /** * Creates a new Assessment instance using the specified properties. * @function create @@ -3263,6 +3272,8 @@ $root.google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment.encode(message.firewallPolicyAssessment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.fraudPreventionAssessment != null && Object.hasOwnProperty.call(message, "fraudPreventionAssessment")) $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.encode(message.fraudPreventionAssessment, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.phoneFraudAssessment != null && Object.hasOwnProperty.call(message, "phoneFraudAssessment")) + $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.encode(message.phoneFraudAssessment, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.fraudSignals != null && Object.hasOwnProperty.call(message, "fraudSignals")) $root.google.cloud.recaptchaenterprise.v1.FraudSignals.encode(message.fraudSignals, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; @@ -3339,6 +3350,10 @@ message.fraudSignals = $root.google.cloud.recaptchaenterprise.v1.FraudSignals.decode(reader, reader.uint32()); break; } + case 12: { + message.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3422,6 +3437,11 @@ if (error) return "fraudSignals." + error; } + if (message.phoneFraudAssessment != null && message.hasOwnProperty("phoneFraudAssessment")) { + var error = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.verify(message.phoneFraudAssessment); + if (error) + return "phoneFraudAssessment." + error; + } return null; }; @@ -3484,6 +3504,11 @@ throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.fraudSignals: object expected"); message.fraudSignals = $root.google.cloud.recaptchaenterprise.v1.FraudSignals.fromObject(object.fraudSignals); } + if (object.phoneFraudAssessment != null) { + if (typeof object.phoneFraudAssessment !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.Assessment.phoneFraudAssessment: object expected"); + message.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.fromObject(object.phoneFraudAssessment); + } return message; }; @@ -3510,6 +3535,7 @@ object.privatePasswordLeakVerification = null; object.firewallPolicyAssessment = null; object.fraudPreventionAssessment = null; + object.phoneFraudAssessment = null; object.fraudSignals = null; } if (message.name != null && message.hasOwnProperty("name")) @@ -3530,6 +3556,8 @@ object.firewallPolicyAssessment = $root.google.cloud.recaptchaenterprise.v1.FirewallPolicyAssessment.toObject(message.firewallPolicyAssessment, options); if (message.fraudPreventionAssessment != null && message.hasOwnProperty("fraudPreventionAssessment")) object.fraudPreventionAssessment = $root.google.cloud.recaptchaenterprise.v1.FraudPreventionAssessment.toObject(message.fraudPreventionAssessment, options); + if (message.phoneFraudAssessment != null && message.hasOwnProperty("phoneFraudAssessment")) + object.phoneFraudAssessment = $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.toObject(message.phoneFraudAssessment, options); if (message.fraudSignals != null && message.hasOwnProperty("fraudSignals")) object.fraudSignals = $root.google.cloud.recaptchaenterprise.v1.FraudSignals.toObject(message.fraudSignals, options); return object; @@ -8930,6 +8958,498 @@ return FraudSignals; })(); + v1.SmsTollFraudVerdict = (function() { + + /** + * Properties of a SmsTollFraudVerdict. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface ISmsTollFraudVerdict + * @property {number|null} [risk] SmsTollFraudVerdict risk + * @property {Array.|null} [reasons] SmsTollFraudVerdict reasons + */ + + /** + * Constructs a new SmsTollFraudVerdict. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a SmsTollFraudVerdict. + * @implements ISmsTollFraudVerdict + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict=} [properties] Properties to set + */ + function SmsTollFraudVerdict(properties) { + this.reasons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SmsTollFraudVerdict risk. + * @member {number} risk + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @instance + */ + SmsTollFraudVerdict.prototype.risk = 0; + + /** + * SmsTollFraudVerdict reasons. + * @member {Array.} reasons + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @instance + */ + SmsTollFraudVerdict.prototype.reasons = $util.emptyArray; + + /** + * Creates a new SmsTollFraudVerdict instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict} SmsTollFraudVerdict instance + */ + SmsTollFraudVerdict.create = function create(properties) { + return new SmsTollFraudVerdict(properties); + }; + + /** + * Encodes the specified SmsTollFraudVerdict message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict} message SmsTollFraudVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmsTollFraudVerdict.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.risk != null && Object.hasOwnProperty.call(message, "risk")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.risk); + if (message.reasons != null && message.reasons.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.reasons.length; ++i) + writer.int32(message.reasons[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SmsTollFraudVerdict message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict} message SmsTollFraudVerdict message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmsTollFraudVerdict.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SmsTollFraudVerdict message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict} SmsTollFraudVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmsTollFraudVerdict.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.risk = reader.float(); + break; + } + case 2: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.reasons.push(reader.int32()); + } else + message.reasons.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SmsTollFraudVerdict message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict} SmsTollFraudVerdict + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmsTollFraudVerdict.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SmsTollFraudVerdict message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SmsTollFraudVerdict.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.risk != null && message.hasOwnProperty("risk")) + if (typeof message.risk !== "number") + return "risk: number expected"; + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) + switch (message.reasons[i]) { + default: + return "reasons: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a SmsTollFraudVerdict message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict} SmsTollFraudVerdict + */ + SmsTollFraudVerdict.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict(); + if (object.risk != null) + message.risk = Number(object.risk); + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) + switch (object.reasons[i]) { + default: + if (typeof object.reasons[i] === "number") { + message.reasons[i] = object.reasons[i]; + break; + } + case "SMS_TOLL_FRAUD_REASON_UNSPECIFIED": + case 0: + message.reasons[i] = 0; + break; + case "INVALID_PHONE_NUMBER": + case 1: + message.reasons[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SmsTollFraudVerdict message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict} message SmsTollFraudVerdict + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SmsTollFraudVerdict.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; + if (options.defaults) + object.risk = 0; + if (message.risk != null && message.hasOwnProperty("risk")) + object.risk = options.json && !isFinite(message.risk) ? String(message.risk) : message.risk; + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = options.enums === String ? $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason[message.reasons[j]] === undefined ? message.reasons[j] : $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason[message.reasons[j]] : message.reasons[j]; + } + return object; + }; + + /** + * Converts this SmsTollFraudVerdict to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @instance + * @returns {Object.} JSON object + */ + SmsTollFraudVerdict.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SmsTollFraudVerdict + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SmsTollFraudVerdict.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict"; + }; + + /** + * SmsTollFraudReason enum. + * @name google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.SmsTollFraudReason + * @enum {number} + * @property {number} SMS_TOLL_FRAUD_REASON_UNSPECIFIED=0 SMS_TOLL_FRAUD_REASON_UNSPECIFIED value + * @property {number} INVALID_PHONE_NUMBER=1 INVALID_PHONE_NUMBER value + */ + SmsTollFraudVerdict.SmsTollFraudReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SMS_TOLL_FRAUD_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVALID_PHONE_NUMBER"] = 1; + return values; + })(); + + return SmsTollFraudVerdict; + })(); + + v1.PhoneFraudAssessment = (function() { + + /** + * Properties of a PhoneFraudAssessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @interface IPhoneFraudAssessment + * @property {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict|null} [smsTollFraudVerdict] PhoneFraudAssessment smsTollFraudVerdict + */ + + /** + * Constructs a new PhoneFraudAssessment. + * @memberof google.cloud.recaptchaenterprise.v1 + * @classdesc Represents a PhoneFraudAssessment. + * @implements IPhoneFraudAssessment + * @constructor + * @param {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment=} [properties] Properties to set + */ + function PhoneFraudAssessment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhoneFraudAssessment smsTollFraudVerdict. + * @member {google.cloud.recaptchaenterprise.v1.ISmsTollFraudVerdict|null|undefined} smsTollFraudVerdict + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @instance + */ + PhoneFraudAssessment.prototype.smsTollFraudVerdict = null; + + /** + * Creates a new PhoneFraudAssessment instance using the specified properties. + * @function create + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment=} [properties] Properties to set + * @returns {google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment} PhoneFraudAssessment instance + */ + PhoneFraudAssessment.create = function create(properties) { + return new PhoneFraudAssessment(properties); + }; + + /** + * Encodes the specified PhoneFraudAssessment message. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.verify|verify} messages. + * @function encode + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment} message PhoneFraudAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhoneFraudAssessment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.smsTollFraudVerdict != null && Object.hasOwnProperty.call(message, "smsTollFraudVerdict")) + $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.encode(message.smsTollFraudVerdict, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhoneFraudAssessment message, length delimited. Does not implicitly {@link google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.IPhoneFraudAssessment} message PhoneFraudAssessment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhoneFraudAssessment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhoneFraudAssessment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment} PhoneFraudAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhoneFraudAssessment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.smsTollFraudVerdict = $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhoneFraudAssessment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment} PhoneFraudAssessment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhoneFraudAssessment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhoneFraudAssessment message. + * @function verify + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhoneFraudAssessment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.smsTollFraudVerdict != null && message.hasOwnProperty("smsTollFraudVerdict")) { + var error = $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.verify(message.smsTollFraudVerdict); + if (error) + return "smsTollFraudVerdict." + error; + } + return null; + }; + + /** + * Creates a PhoneFraudAssessment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment} PhoneFraudAssessment + */ + PhoneFraudAssessment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment) + return object; + var message = new $root.google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment(); + if (object.smsTollFraudVerdict != null) { + if (typeof object.smsTollFraudVerdict !== "object") + throw TypeError(".google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment.smsTollFraudVerdict: object expected"); + message.smsTollFraudVerdict = $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.fromObject(object.smsTollFraudVerdict); + } + return message; + }; + + /** + * Creates a plain object from a PhoneFraudAssessment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment} message PhoneFraudAssessment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhoneFraudAssessment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.smsTollFraudVerdict = null; + if (message.smsTollFraudVerdict != null && message.hasOwnProperty("smsTollFraudVerdict")) + object.smsTollFraudVerdict = $root.google.cloud.recaptchaenterprise.v1.SmsTollFraudVerdict.toObject(message.smsTollFraudVerdict, options); + return object; + }; + + /** + * Converts this PhoneFraudAssessment to JSON. + * @function toJSON + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @instance + * @returns {Object.} JSON object + */ + PhoneFraudAssessment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhoneFraudAssessment + * @function getTypeUrl + * @memberof google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhoneFraudAssessment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.recaptchaenterprise.v1.PhoneFraudAssessment"; + }; + + return PhoneFraudAssessment; + })(); + v1.AccountDefenderAssessment = (function() { /** diff --git a/packages/google-cloud-recaptchaenterprise/protos/protos.json b/packages/google-cloud-recaptchaenterprise/protos/protos.json index 27118573a55..431d82bd6d6 100644 --- a/packages/google-cloud-recaptchaenterprise/protos/protos.json +++ b/packages/google-cloud-recaptchaenterprise/protos/protos.json @@ -740,6 +740,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "phoneFraudAssessment": { + "type": "PhoneFraudAssessment", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -1421,6 +1428,44 @@ } } }, + "SmsTollFraudVerdict": { + "fields": { + "risk": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reasons": { + "rule": "repeated", + "type": "SmsTollFraudReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SmsTollFraudReason": { + "values": { + "SMS_TOLL_FRAUD_REASON_UNSPECIFIED": 0, + "INVALID_PHONE_NUMBER": 1 + } + } + } + }, + "PhoneFraudAssessment": { + "fields": { + "smsTollFraudVerdict": { + "type": "SmsTollFraudVerdict", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "AccountDefenderAssessment": { "fields": { "labels": { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json index 6441e90f55b..7eb0196b094 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata.google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.9.0", + "version": "5.10.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json index 7288164af41..3fbca466727 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.9.0", + "version": "5.10.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json index 15daa23854c..d8778ee4822 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata.google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.9.0", + "version": "5.10.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json index 700b83de2a5..d96610b2e2a 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json +++ b/packages/google-cloud-recaptchaenterprise/samples/generated/v1beta1/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-recaptchaenterprise", - "version": "5.9.0", + "version": "5.10.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-recaptchaenterprise/samples/package.json b/packages/google-cloud-recaptchaenterprise/samples/package.json index 02a4f4aa3c6..08c7ee9657b 100644 --- a/packages/google-cloud-recaptchaenterprise/samples/package.json +++ b/packages/google-cloud-recaptchaenterprise/samples/package.json @@ -13,7 +13,7 @@ "test": "echo add tests" }, "dependencies": { - "@google-cloud/recaptcha-enterprise": "^5.9.0" + "@google-cloud/recaptcha-enterprise": "^5.10.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-retail/CHANGELOG.md b/packages/google-cloud-retail/CHANGELOG.md index fe5d129e343..6ab21ba7a8d 100644 --- a/packages/google-cloud-retail/CHANGELOG.md +++ b/packages/google-cloud-retail/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.5.0](https://github.com/googleapis/google-cloud-node/compare/retail-v3.4.0...retail-v3.5.0) (2024-06-21) + + +### Features + +* [retail] support merged facets ([#5446](https://github.com/googleapis/google-cloud-node/issues/5446)) ([140597e](https://github.com/googleapis/google-cloud-node/commit/140597eac392a4b777c3e0fda197544b0f2912ba)) + ## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/retail-v3.3.0...retail-v3.4.0) (2024-05-21) diff --git a/packages/google-cloud-retail/README.md b/packages/google-cloud-retail/README.md index 06e66abc828..6a3b33a91cf 100644 --- a/packages/google-cloud-retail/README.md +++ b/packages/google-cloud-retail/README.md @@ -121,6 +121,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Product_service.get_product | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.get_product.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.get_product.js,packages/google-cloud-retail/samples/README.md) | | Product_service.import_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js,packages/google-cloud-retail/samples/README.md) | | Product_service.list_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.list_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.list_products.js,packages/google-cloud-retail/samples/README.md) | +| Product_service.purge_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js,packages/google-cloud-retail/samples/README.md) | | Product_service.remove_fulfillment_places | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.remove_fulfillment_places.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.remove_fulfillment_places.js,packages/google-cloud-retail/samples/README.md) | | Product_service.remove_local_inventories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.remove_local_inventories.js,packages/google-cloud-retail/samples/README.md) | | Product_service.set_inventory | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.set_inventory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.set_inventory.js,packages/google-cloud-retail/samples/README.md) | @@ -139,6 +140,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | User_event_service.rejoin_user_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.rejoin_user_events.js,packages/google-cloud-retail/samples/README.md) | | User_event_service.write_user_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/user_event_service.write_user_event.js,packages/google-cloud-retail/samples/README.md) | | Analytics_service.export_analytics_metrics | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/analytics_service.export_analytics_metrics.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/analytics_service.export_analytics_metrics.js,packages/google-cloud-retail/samples/README.md) | +| Branch_service.get_branch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js,packages/google-cloud-retail/samples/README.md) | +| Branch_service.list_branches | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js,packages/google-cloud-retail/samples/README.md) | | Catalog_service.add_catalog_attribute | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js,packages/google-cloud-retail/samples/README.md) | | Catalog_service.batch_remove_catalog_attributes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.batch_remove_catalog_attributes.js,packages/google-cloud-retail/samples/README.md) | | Catalog_service.get_attributes_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.get_attributes_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-retail/samples/generated/v2alpha/catalog_service.get_attributes_config.js,packages/google-cloud-retail/samples/README.md) | @@ -182,6 +185,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Product_service.remove_local_inventories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/product_service.remove_local_inventories.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/product_service.remove_local_inventories.js,packages/google-cloud-retail/samples/README.md) | | Product_service.set_inventory | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/product_service.set_inventory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/product_service.set_inventory.js,packages/google-cloud-retail/samples/README.md) | | Product_service.update_product | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/product_service.update_product.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/product_service.update_product.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.accept_terms | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.enroll_solution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.get_alert_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_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-retail/samples/generated/v2alpha/project_service.get_alert_config.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.get_logging_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_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-retail/samples/generated/v2alpha/project_service.get_logging_config.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.get_project | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.list_enrolled_solutions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.update_alert_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_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-retail/samples/generated/v2alpha/project_service.update_alert_config.js,packages/google-cloud-retail/samples/README.md) | +| Project_service.update_logging_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_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-retail/samples/generated/v2alpha/project_service.update_logging_config.js,packages/google-cloud-retail/samples/README.md) | | Search_service.search | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js,packages/google-cloud-retail/samples/README.md) | | Serving_config_service.add_control | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js,packages/google-cloud-retail/samples/README.md) | | Serving_config_service.create_serving_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.create_serving_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-retail/samples/generated/v2alpha/serving_config_service.create_serving_config.js,packages/google-cloud-retail/samples/README.md) | @@ -231,6 +242,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Product_service.get_product | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.get_product.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.get_product.js,packages/google-cloud-retail/samples/README.md) | | Product_service.import_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js,packages/google-cloud-retail/samples/README.md) | | Product_service.list_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.list_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.list_products.js,packages/google-cloud-retail/samples/README.md) | +| Product_service.purge_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js,packages/google-cloud-retail/samples/README.md) | | Product_service.remove_fulfillment_places | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_fulfillment_places.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_fulfillment_places.js,packages/google-cloud-retail/samples/README.md) | | Product_service.remove_local_inventories | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_local_inventories.js,packages/google-cloud-retail/samples/README.md) | | Product_service.set_inventory | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.set_inventory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.set_inventory.js,packages/google-cloud-retail/samples/README.md) | diff --git a/packages/google-cloud-retail/package.json b/packages/google-cloud-retail/package.json index b1cf3f4956c..d375bd06681 100644 --- a/packages/google-cloud-retail/package.json +++ b/packages/google-cloud-retail/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/retail", - "version": "3.4.0", + "version": "3.5.0", "description": "Retail client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog.proto index 8276310fa2d..90e976418b1 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/catalog.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2/common.proto"; import "google/cloud/retail/v2/import_config.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2"; option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb"; @@ -87,6 +88,123 @@ message ProductLevelConfig { // Catalog level attribute config for an attribute. For example, if customers // want to enable/disable facet for a specific attribute. message CatalogAttribute { + // Possible options for the facet that corresponds to the current attribute + // config. + message FacetConfig { + // [Facet values][google.cloud.retail.v2.SearchResponse.Facet.values] to + // ignore on [facets][google.cloud.retail.v2.SearchResponse.Facet] during + // the specified time range for the given + // [SearchResponse.Facet.key][google.cloud.retail.v2.SearchResponse.Facet.key] + // attribute. + message IgnoredFacetValues { + // List of facet values to ignore for the following time range. The facet + // values are the same as the attribute values. There is a limit of 10 + // values per instance of IgnoredFacetValues. Each value can have at most + // 128 characters. + repeated string values = 1; + + // Time range for the current list of facet values to ignore. + // If multiple time ranges are specified for an facet value for the + // current attribute, consider all of them. If both are empty, ignore + // always. If start time and end time are set, then start time + // must be before end time. + // If start time is not empty and end time is empty, then will ignore + // these facet values after the start time. + google.protobuf.Timestamp start_time = 2; + + // If start time is empty and end time is not empty, then ignore these + // facet values before end time. + google.protobuf.Timestamp end_time = 3; + } + + // Replaces a set of textual facet values by the same (possibly different) + // merged facet value. Each facet value should appear at most once as a + // value per [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]. + // This feature is available only for textual custom attributes. + message MergedFacetValue { + // All the facet values that are replaces by the same + // [merged_value][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + // that follows. The maximum number of values per MergedFacetValue is 25. + // Each value can have up to 128 characters. + repeated string values = 1; + + // All the previous values are replaced by this merged facet value. + // This merged_value must be non-empty and can have up to 128 characters. + string merged_value = 2; + } + + // The current facet key (i.e. attribute config) maps into the + // [merged_facet_key][google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.merged_facet_key]. + // A facet key can have at most one child. The current facet key and the + // merged facet key need both to be textual custom attributes or both + // numerical custom attributes (same type). + message MergedFacet { + // The merged facet key should be a valid facet key that is different than + // the facet key of the current catalog attribute. We refer this is + // merged facet key as the child of the current catalog attribute. This + // merged facet key can't be a parent of another facet key (i.e. no + // directed path of length 2). This merged facet key needs to be either a + // textual custom attribute or a numerical custom attribute. + string merged_facet_key = 1; + } + + // Options to rerank based on facet values engaged by the user for the + // current key. That key needs to be a custom textual key and facetable. + // To use this control, you also need to pass all the facet keys engaged by + // the user in the request using the field [SearchRequest.FacetSpec]. In + // particular, if you don't pass the facet keys engaged that you want to + // rerank on, this control won't be effective. Moreover, to obtain better + // results, the facet values that you want to rerank on should be close to + // English (ideally made of words, underscores, and spaces). + message RerankConfig { + // If set to true, then we also rerank the dynamic facets based on the + // facet values engaged by the user for the current attribute key during + // serving. + bool rerank_facet = 1; + + // If empty, rerank on all facet values for the current key. Otherwise, + // will rerank on the facet values from this list only. + repeated string facet_values = 2; + } + + // If you don't set the facet + // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.intervals] + // in the request to a numerical attribute, then we use the computed + // intervals with rounded bounds obtained from all its product numerical + // attribute values. The computed intervals might not be ideal for some + // attributes. Therefore, we give you the option to overwrite them with the + // facet_intervals field. The maximum of facet intervals per + // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 40. Each + // interval must have a lower bound or an upper bound. If both bounds are + // provided, then the lower bound must be smaller or equal than the upper + // bound. + repeated Interval facet_intervals = 1; + + // Each instance represents a list of attribute values to ignore as facet + // values for a specific time range. The maximum number of instances per + // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 25. + repeated IgnoredFacetValues ignored_facet_values = 2; + + // Each instance replaces a list of facet values by a merged facet + // value. If a facet value is not in any list, then it will stay the same. + // To avoid conflicts, only paths of length 1 are accepted. In other words, + // if "dark_blue" merged into "BLUE", then the latter can't merge into + // "blues" because this would create a path of length 2. The maximum number + // of instances of MergedFacetValue per + // [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] is 100. This + // feature is available only for textual custom attributes. + repeated MergedFacetValue merged_facet_values = 3; + + // Use this field only if you want to merge a facet key into another facet + // key. + MergedFacet merged_facet = 4; + + // Set this field only if you want to rerank based on facet values engaged + // by the user for the current key. This option is only possible for custom + // facetable textual keys. + RerankConfig rerank_config = 5; + } + // The type of an attribute. enum AttributeType { // The type of the attribute is unknown. @@ -210,7 +328,9 @@ message CatalogAttribute { // are indexed so that it can be filtered, faceted, or boosted in // [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. IndexableOption indexable_option = 5; // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic @@ -232,7 +352,9 @@ message CatalogAttribute { // [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as // there are no text values associated to numerical attributes. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified, when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. SearchableOption searchable_option = 7; // If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. @@ -246,6 +368,9 @@ message CatalogAttribute { // results. If unset, the server behavior defaults to // [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. RetrievableOption retrievable_option = 12; + + // Contains facet options. + FacetConfig facet_config = 13; } // Catalog level attribute config. @@ -335,8 +460,8 @@ message CompletionConfig { // Output only. Name of the LRO corresponding to the latest suggestion terms // list import. // - // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - // retrieve the latest state of the Long Running Operation. + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API + // method to retrieve the latest state of the Long Running Operation. string last_suggestions_import_operation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto index 6f3b29ca8c4..78014a1490a 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/common.proto @@ -124,6 +124,12 @@ message Condition { // Range of time(s) specifying when Condition is active. // Condition true if any time range matches. repeated TimeRange active_time_range = 3; + + // Used to support browse uses cases. + // A list (up to 10 entries) of categories or departments. + // The format should be the same as + // [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; + repeated string page_categories = 4; } // A rule is a condition-action pair @@ -172,17 +178,19 @@ message Rule { } // * Rule Condition: - // - No - // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] - // provided is a global match. - // - 1 or more - // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] - // provided are combined with OR operator. + // - No + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + // provided is a global match. + // - 1 or more + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + // provided are combined with OR operator. + // // * Action Input: The request query and filter that are applied to the // retrieved products, in addition to any filters already provided with the // SearchRequest. The AND operator is used to combine the query's existing // filters with the filter rule(s). NOTE: May result in 0 results when // filters conflict. + // // * Action Result: Filters the returned objects to be ONLY those that passed // the filter. message FilterAction { @@ -190,10 +198,9 @@ message Rule { // // * [filter][google.cloud.retail.v2.Rule.FilterAction.filter] must be set. // * Filter syntax is identical to - // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. See + // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. For // more - // details at the Retail Search - // [user guide](/retail/search/docs/filter-and-order#filter). + // information, see [Filter](/retail/docs/filter-and-order#filter). // * To filter products with product ID "product_1" or "product_2", and // color // "Red" or "Blue":
@@ -206,7 +213,7 @@ message Rule { // Redirects a shopper to a specific page. // // * Rule Condition: - // - Must specify + // Must specify // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms]. // * Action Input: Request Query // * Action Result: Redirects shopper to provided uri. @@ -288,6 +295,78 @@ message Rule { repeated string ignore_terms = 1; } + // Force returns an attribute/facet in the request around a certain position + // or above. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Inputs: attribute name, position + // + // * Action Result: Will force return a facet key around a certain position + // or above if the condition is satisfied. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] is + // "shoes", the + // [ForceReturnFacetAction.FacetPositionAdjustment.attribute_name][google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.attribute_name] + // is "size" and the + // [ForceReturnFacetAction.FacetPositionAdjustment.position][google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.position] + // is 8. + // + // Two cases: a) The facet key "size" is not already in the top 8 slots, then + // the facet "size" will appear at a position close to 8. b) The facet key + // "size" in among the top 8 positions in the request, then it will stay at + // its current rank. + message ForceReturnFacetAction { + // Each facet position adjustment consists of a single attribute name (i.e. + // facet key) along with a specified position. + message FacetPositionAdjustment { + // The attribute name to force return as a facet. Each attribute name + // should be a valid attribute name, be non-empty and contain at most 80 + // characters long. + string attribute_name = 1; + + // This is the position in the request as explained above. It should be + // strictly positive be at most 100. + int32 position = 2; + } + + // Each instance corresponds to a force return attribute for the given + // condition. There can't be more 3 instances here. + repeated FacetPositionAdjustment facet_position_adjustments = 1; + } + + // Removes an attribute/facet in the request if is present. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Input: attribute name + // + // * Action Result: Will remove the attribute (as a facet) from the request + // if it is present. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2.Condition.query_terms] is + // "shoes" and the attribute name "size", then facet key "size" will be + // removed from the request (if it is present). + message RemoveFacetAction { + // The attribute names (i.e. facet keys) to remove from the dynamic facets + // (if present in the request). There can't be more 3 attribute names. + // Each attribute name should be a valid attribute name, be non-empty and + // contain at most 80 characters. + repeated string attribute_names = 1; + } + // An action must be provided. oneof action { // A boost action. @@ -314,6 +393,12 @@ message Rule { // Treats a set of terms as synonyms of one another. TwowaySynonymsAction twoway_synonyms_action = 11; + + // Force returns an attribute as a facet in the request. + ForceReturnFacetAction force_return_facet_action = 12; + + // Remove an attribute as a facet in the request (if present). + RemoveFacetAction remove_facet_action = 13; } // Required. The condition that triggers the rule. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto index 17468ebd01b..a5f2b0ac83c 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/completion_service.proto @@ -151,10 +151,15 @@ message CompleteQueryRequest { // capped by 20. int32 max_suggestions = 5; - // The entity for customers that may run multiple different entities, domains, - // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + // If true, attribute suggestions are enabled and provided in response. + // + // This field is only available for "cloud-retail" dataset. + bool enable_attribute_suggestions = 9; + + // The entity for customers who run multiple entities, domains, sites, or + // regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // If this is set, it should be exactly matched with + // If this is set, it must be an exact match with // [UserEvent.entity][google.cloud.retail.v2.UserEvent.entity] to get // per-entity autocomplete results. string entity = 10; @@ -179,8 +184,10 @@ message CompleteQueryResponse { map attributes = 2; } - // Recent search of this user. + // Deprecated: Recent search of this user. message RecentSearchResult { + option deprecated = true; + // The recent search query. string recent_search = 1; } @@ -195,9 +202,9 @@ message CompleteQueryResponse { // attribution of complete model performance. string attribution_token = 2; - // Matched recent searches of this user. The maximum number of recent searches - // is 10. This field is a restricted feature. Contact Retail Search support - // team if you are interested in enabling it. + // Deprecated. Matched recent searches of this user. The maximum number of + // recent searches is 10. This field is a restricted feature. If you want to + // enable it, contact Retail Search support. // // This feature is only available when // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2.CompleteQueryRequest.visitor_id] @@ -216,5 +223,5 @@ message CompleteQueryResponse { // // Recent searches are deduplicated. More recent searches will be reserved // when duplication happens. - repeated RecentSearchResult recent_search_results = 3; + repeated RecentSearchResult recent_search_results = 3 [deprecated = true]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto index 8bb5e1543e1..3425f604bc5 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/import_config.proto @@ -196,7 +196,8 @@ message ImportProductsRequest { ImportErrorsConfig errors_config = 3; // Indicates which fields in the provided imported `products` to update. If - // not set, all fields are updated. + // not set, all fields are updated. If provided, only the existing product + // fields are updated. Missing products will not be created. google.protobuf.FieldMask update_mask = 4; // The mode of reconciliation between existing products and the products to be @@ -212,9 +213,14 @@ message ImportProductsRequest { // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has // to be within the same project as // [ImportProductsRequest.parent][google.cloud.retail.v2.ImportProductsRequest.parent]. - // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - // `pubsub.topics.publish` IAM permission on the topic. + // Make sure that both + // `cloud-retail-customer-data-access@system.gserviceaccount.com` and + // `service-@gcp-sa-retail.iam.gserviceaccount.com` + // have the `pubsub.topics.publish` IAM permission on the topic. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. string notification_pubsub_topic = 7; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/model.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/model.proto index 53f255911aa..69fff52e7d1 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/model.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/model.proto @@ -50,6 +50,25 @@ message Model { [(google.api.field_behavior) = OPTIONAL]; } + // Additional configs for the frequently-bought-together model type. + message FrequentlyBoughtTogetherFeaturesConfig { + // Optional. Specifies the context of the model when it is used in predict + // requests. Can only be set for the `frequently-bought-together` type. If + // it isn't specified, it defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + ContextProductsType context_products_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Additional model features config. + message ModelFeaturesConfig { + oneof type_dedicated_config { + // Additional configs for frequently-bought-together models. + FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = + 1; + } + } + // The serving state of the model. enum ServingState { // Unspecified serving state. @@ -118,6 +137,22 @@ message Model { DATA_ERROR = 2; } + // Use single or multiple context products for recommendations. + enum ContextProductsType { + // Unspecified default value, should never be explicitly set. + // Defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + + // Use only a single product as context for the recommendation. Typically + // used on pages like add-to-cart or product details. + SINGLE_CONTEXT_PRODUCT = 1; + + // Use one or multiple products as context for the recommendation. Typically + // used on shopping cart pages. + MULTIPLE_CONTEXT_PRODUCTS = 2; + } + // Required. The fully qualified resource name of the model. // // Format: @@ -236,4 +271,8 @@ message Model { // PageOptimizationConfig. repeated ServingConfigList serving_config_lists = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Additional model features config. + ModelFeaturesConfig model_features_config = 22 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto index 75128b7c7b5..71aee814edf 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product.proto @@ -103,23 +103,22 @@ message Product { } oneof expiration { - // The timestamp when this product becomes unavailable for - // [SearchService.Search][google.cloud.retail.v2.SearchService.Search]. Note - // that this is only applicable to - // [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] and - // [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION], and - // ignored for [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]. - // In general, we suggest the users to delete the stale products explicitly, - // instead of using this field to determine staleness. + // Note that this field is applied in the following ways: // - // If it is set, the [Product][google.cloud.retail.v2.Product] is not - // available for - // [SearchService.Search][google.cloud.retail.v2.SearchService.Search] after - // [expire_time][google.cloud.retail.v2.Product.expire_time]. However, the - // product can still be retrieved by - // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] - // and - // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + // * If the [Product][google.cloud.retail.v2.Product] is already expired + // when it is uploaded, this product + // is not indexed for search. + // + // * If the [Product][google.cloud.retail.v2.Product] is not expired when it + // is uploaded, only the + // [Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY]'s and + // [Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION]'s + // expireTime is respected, and + // [Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT]'s + // expireTime is not used. + // + // In general, we suggest the users to delete the stale + // products explicitly, instead of using this field to determine staleness. // // [expire_time][google.cloud.retail.v2.Product.expire_time] must be later // than [available_time][google.cloud.retail.v2.Product.available_time] and @@ -256,9 +255,10 @@ message Product { // error is returned. // // At most 250 values are allowed per - // [Product][google.cloud.retail.v2.Product]. Empty values are not allowed. - // Each value must be a UTF-8 encoded string with a length limit of 5,000 - // characters. Otherwise, an INVALID_ARGUMENT error is returned. + // [Product][google.cloud.retail.v2.Product] unless overridden through the + // Google Cloud console. Empty values are not allowed. Each value must be a + // UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [google_product_category][mc_google_product_category]. Schema.org property @@ -280,9 +280,10 @@ message Product { // The brands of the product. // - // A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - // string with a length limit of 1,000 characters. Otherwise, an - // INVALID_ARGUMENT error is returned. + // A maximum of 30 brands are allowed unless overridden through the Google + // Cloud console. Each + // brand must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [brand](https://support.google.com/merchants/answer/6324351). Schema.org diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto index e9ad2e318a8..8d953ac28d0 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/product_service.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/retail/v2/common.proto"; import "google/cloud/retail/v2/import_config.proto"; import "google/cloud/retail/v2/product.proto"; +import "google/cloud/retail/v2/purge_config.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -86,6 +87,35 @@ service ProductService { option (google.api.method_signature) = "name"; } + // Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s + // under a branch. + // + // This process is asynchronous. If the request is valid, the removal will be + // enqueued and processed offline. Depending on the number of + // [Product][google.cloud.retail.v2.Product]s, this operation could take hours + // to complete. Before the operation completes, some + // [Product][google.cloud.retail.v2.Product]s may still be returned by + // [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] + // or + // [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. + // + // Depending on the number of [Product][google.cloud.retail.v2.Product]s, this + // operation could take hours to complete. To get a sample of + // [Product][google.cloud.retail.v2.Product]s that would be deleted, set + // [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] + // to false. + rpc PurgeProducts(PurgeProductsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2.PurgeProductsResponse" + metadata_type: "google.cloud.retail.v2.PurgeProductsMetadata" + }; + } + // Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. // // Request processing may be synchronous. @@ -166,10 +196,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] - // method instead of - // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. + // method instead of the + // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] + // method. // [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. @@ -208,10 +239,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] - // method instead of - // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. + // method instead of the + // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] + // method. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto index ccbb1b2fda7..69c24612781 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/promotion.proto @@ -34,7 +34,7 @@ message Promotion { // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is // returned. // - // Google Merchant Center property - // [promotion](https://support.google.com/merchants/answer/7050148). + // Corresponds to Google Merchant Center property + // [promotion_id](https://support.google.com/merchants/answer/7050148). string promotion_id = 1; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto index 8a7acc711cf..8924b942745 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/purge_config.proto @@ -18,6 +18,7 @@ package google.cloud.retail.v2; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2"; option go_package = "cloud.google.com/go/retail/apiv2/retailpb;retailpb"; @@ -32,6 +33,95 @@ option ruby_package = "Google::Cloud::Retail::V2"; // This will be returned by the google.longrunning.Operation.metadata field. message PurgeMetadata {} +// Metadata related to the progress of the PurgeProducts operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeProductsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were deleted successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} + +// Request message for PurgeProducts method. +message PurgeProductsRequest { + // Required. The resource name of the branch under which the products are + // created. The format is + // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Required. The filter string to specify the products to be deleted with a + // length limit of 5,000 characters. + // + // Empty string filter is not allowed. "*" implies delete all items in a + // branch. + // + // The eligible fields for filtering are: + // + // * `availability`: Double quoted + // [Product.availability][google.cloud.retail.v2.Product.availability] string. + // * `create_time` : in ISO 8601 "zulu" format. + // + // Supported syntax: + // + // * Comparators (">", "<", ">=", "<=", "="). + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" + // * availability = "IN_STOCK" + // + // * Conjunctions ("AND") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + // + // * Disjunctions ("OR") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + // + // * Can support nested queries. + // Examples: + // * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + // OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + // + // * Filter Limits: + // * Filter should not contain more than 6 conditions. + // * Max nesting depth should not exceed 2 levels. + // + // Examples queries: + // * Delete back order products created before a timestamp. + // create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually perform the purge. + // If `force` is set to false, the method will return the expected purge count + // without deleting any products. + bool force = 3; +} + +// Response of the PurgeProductsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeProductsResponse { + // The total count of products purged as a result of the operation. + int64 purge_count = 1; + + // A sample of the product names that will be deleted. + // Only populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + repeated string purge_sample = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + // Request message for PurgeUserEvents method. message PurgeUserEventsRequest { // Required. The resource name of the catalog under which the events are diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto index 4c81410e9b5..c9b8cbb3e92 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/search_service.proto @@ -118,13 +118,13 @@ message SearchRequest { // values. Maximum number of intervals is 40. // // For all numerical facet keys that appear in the list of products from - // the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + // the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are // computed from their distribution weekly. If the model assigns a high // score to a numerical facet key and its intervals are not specified in - // the search request, these percentiles will become the bounds - // for its intervals and will be returned in the response. If the + // the search request, these percentiles become the bounds + // for its intervals and are returned in the response. If the // facet key intervals are specified in the request, then the specified - // intervals will be returned instead. + // intervals are returned instead. repeated Interval intervals = 2; // Only get facet for the given restricted values. For example, when using @@ -157,14 +157,14 @@ message SearchRequest { // Only get facet values that start with the given string prefix. For // example, suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // "categories" facet gives only "Women > Shoe" and "Women > Dress". // Only supported on textual fields. Maximum is 10. repeated string prefixes = 8; // Only get facet values that contains the given strings. For example, // suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // "categories" facet gives only "Women > Shoe" and "Men > Shoe". // Only supported on textual fields. Maximum is 10. repeated string contains = 9; @@ -197,7 +197,7 @@ message SearchRequest { string order_by = 4; // The query that is used to compute facet for the given facet key. - // When provided, it will override the default behavior of facet + // When provided, it overrides the default behavior of facet // computation. The query syntax is the same as a filter expression. See // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for // detail syntax and limitations. Notice that there is no limitation on @@ -206,9 +206,9 @@ message SearchRequest { // // In the response, // [SearchResponse.Facet.values.value][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.value] - // will be always "1" and + // is always "1" and // [SearchResponse.Facet.values.count][google.cloud.retail.v2.SearchResponse.Facet.FacetValue.count] - // will be the number of results that match the query. + // is the number of results that match the query. // // For example, you can set a customized facet for "shipToStore", // where @@ -216,7 +216,7 @@ message SearchRequest { // is "customizedShipToStore", and // [FacetKey.query][google.cloud.retail.v2.SearchRequest.FacetSpec.FacetKey.query] // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - // Then the facet will count the products that are both in stock and ship + // Then the facet counts the products that are both in stock and ship // to store "123". string query = 5; @@ -267,15 +267,15 @@ message SearchRequest { // Enables dynamic position for this facet. If set to true, the position of // this facet among all facets in the response is determined by Google - // Retail Search. It will be ordered together with dynamic facets if dynamic + // Retail Search. It is ordered together with dynamic facets if dynamic // facets is enabled. If set to false, the position of this facet in the - // response will be the same as in the request, and it will be ranked before + // response is the same as in the request, and it is ranked before // the facets with dynamic position enable and all dynamic facets. // // For example, you may always want to have rating facet returned in // the response, but it's not necessarily to always display the rating facet // at the top. In that case, you can set enable_dynamic_position to true so - // that the position of rating facet in response will be determined by + // that the position of rating facet in response is determined by // Google Retail Search. // // Another example, assuming you have the following facets in the request: @@ -286,13 +286,13 @@ message SearchRequest { // // * "brands", enable_dynamic_position = false // - // And also you have a dynamic facets enable, which will generate a facet - // 'gender'. Then the final order of the facets in the response can be + // And also you have a dynamic facets enable, which generates a facet + // "gender". Then, the final order of the facets in the response can be // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", // "rating") depends on how Google Retail Search orders "gender" and - // "rating" facets. However, notice that "price" and "brands" will always be - // ranked at 1st and 2nd position since their enable_dynamic_position are - // false. + // "rating" facets. However, notice that "price" and "brands" are always + // ranked at first and second position because their enable_dynamic_position + // values are false. bool enable_dynamic_position = 4; } @@ -489,7 +489,7 @@ message SearchRequest { // or the name of the legacy placement resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. // This field is used to identify the serving config name and the set - // of models that will be used to make the search. + // of models that are used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; // The branch resource name, such as @@ -554,8 +554,8 @@ message SearchRequest { // The filter syntax consists of an expression language for constructing a // predicate from one or more fields of the products being filtered. Filter - // expression is case-sensitive. See more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + // expression is case-sensitive. For more information, see + // [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string filter = 10; @@ -564,21 +564,21 @@ message SearchRequest { // checking any filters on the search page. // // The filter applied to every search request when quality improvement such as - // query expansion is needed. For example, if a query does not have enough - // results, an expanded query with - // [SearchRequest.canonical_filter][google.cloud.retail.v2.SearchRequest.canonical_filter] - // will be returned as a supplement of the original query. This field is - // strongly recommended to achieve high search quality. + // query expansion is needed. In the case a query does not have a sufficient + // amount of results this filter will be used to determine whether or not to + // enable the query expansion flow. The original filter will still be used for + // the query expanded search. + // This field is strongly recommended to achieve high search quality. // - // See [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter] for - // more details about filter syntax. + // For more information about filter syntax, see + // [SearchRequest.filter][google.cloud.retail.v2.SearchRequest.filter]. string canonical_filter = 28; // The order in which products are returned. Products can be ordered by // a field in an [Product][google.cloud.retail.v2.Product] object. Leave it - // unset if ordered by relevance. OrderBy expression is case-sensitive. See - // more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#order). + // unset if ordered by relevance. OrderBy expression is case-sensitive. For + // more information, see + // [Order](https://cloud.google.com/retail/docs/filter-and-order#order). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string order_by = 11; @@ -596,8 +596,8 @@ message SearchRequest { // textual facets can be dynamically generated. DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - // Boost specification to boost certain products. See more details at this - // [user guide](https://cloud.google.com/retail/docs/boosting). + // Boost specification to boost certain products. For more information, see + // [Boost results](https://cloud.google.com/retail/docs/boosting). // // Notice that if both // [ServingConfig.boost_control_ids][google.cloud.retail.v2.ServingConfig.boost_control_ids] @@ -609,8 +609,8 @@ message SearchRequest { BoostSpec boost_spec = 13; // The query expansion specification that specifies the conditions under which - // query expansion will occur. See more details at this [user - // guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + // query expansion occurs. For more information, see [Query + // expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). QueryExpansionSpec query_expansion_spec = 14; // The keys to fetch and rollup the matching @@ -685,7 +685,7 @@ message SearchRequest { // INVALID_ARGUMENT error is returned. repeated string variant_rollup_keys = 17; - // The categories associated with a category page. Required for category + // The categories associated with a category page. Must be set for category // navigation queries to achieve good search quality. The format should be // the same as // [UserEvent.page_categories][google.cloud.retail.v2.UserEvent.page_categories]; @@ -729,9 +729,9 @@ message SearchRequest { // key with multiple resources. // * Keys must start with a lowercase letter or international character. // - // See [Google Cloud - // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. + // For more information, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // in the Resource Manager documentation. map labels = 34; // The spell correction specification that specifies the mode under @@ -948,7 +948,7 @@ message SearchResponse { repeated ExperimentInfo experiment_info = 17; } -// Metadata for active A/B testing [Experiments][]. +// Metadata for active A/B testing [Experiment][]. message ExperimentInfo { // Metadata for active serving config A/B tests. message ServingConfigExperiment { @@ -961,8 +961,8 @@ message ExperimentInfo { }]; // The fully qualified resource name of the serving config - // [VariantArm.serving_config_id][] responsible for generating the search - // response. For example: + // [Experiment.VariantArm.serving_config_id][] responsible for generating + // the search response. For example: // `projects/*/locations/*/catalogs/*/servingConfigs/*`. string experiment_serving_config = 2 [(google.api.resource_reference) = { type: "retail.googleapis.com/ServingConfig" diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/serving_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/serving_config.proto index 537027397fa..5b234396f84 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/serving_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/serving_config.proto @@ -240,6 +240,10 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string enable_category_filter_level = 16; + // When the flag is enabled, the products in the denylist will not be filtered + // out in the recommendation filtering results. + bool ignore_recs_denylist = 24; + // The specification for personalization spec. // // Can only be set if diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto index 8dccddb7908..32859f1f88b 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2/user_event.proto @@ -37,6 +37,7 @@ message UserEvent { // Required. User event type. Allowed values are: // // * `add-to-cart`: Products being added to cart. + // * `remove-from-cart`: Products being removed from cart. // * `category-page-view`: Special pages such as sale or promotion pages // viewed. // * `detail-page-view`: Products detail page viewed. @@ -271,8 +272,8 @@ message UserEvent { // The entity for customers that may run multiple different entities, domains, // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // It is recommended to set this field to get better per-entity search, - // completion and prediction results. + // We recommend that you set this field to get better per-entity search, + // completion, and prediction results. string entity = 23; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch.proto new file mode 100644 index 00000000000..9667eae9674 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch.proto @@ -0,0 +1,245 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/product.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "BranchProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// A view that specifies different level of fields of a +// [Branch][google.cloud.retail.v2alpha.Branch] to show in responses. +enum BranchView { + // The value when it's unspecified. This defaults to the BASIC view. + BRANCH_VIEW_UNSPECIFIED = 0; + + // Includes basic metadata about the branch, but not statistical fields. + // See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch] + // to find what fields are excluded from BASIC view. + BRANCH_VIEW_BASIC = 1; + + // Includes all fields of a [Branch][google.cloud.retail.v2alpha.Branch]. + BRANCH_VIEW_FULL = 2; +} + +// A data branch that stores [Product][google.cloud.retail.v2alpha.Product]s. +message Branch { + option (google.api.resource) = { + type: "retail.googleapis.com/Branch" + pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}" + }; + + // A statistic about the number of products in a branch. + message ProductCountStatistic { + // Scope of what products are included for this count. + enum ProductCountScope { + // Default value for enum. This value is not used in the API response. + PRODUCT_COUNT_SCOPE_UNSPECIFIED = 0; + + // Scope for all existing products in the branch. Useful for understanding + // how many products there are in a branch. + ALL_PRODUCTS = 1; + + // Scope for products created or updated in the last 24 hours. + LAST_24_HOUR_UPDATE = 2; + } + + // [ProductCountScope] of the [counts]. + ProductCountScope scope = 1; + + // The number of products in + // [scope][google.cloud.retail.v2alpha.Branch.ProductCountStatistic.scope] + // broken down into different groups. + // + // The key is a group representing a set of products, and the value is the + // number of products in that group. + // Note: keys in this map may change over time. + // + // Possible keys: + // * "primary-in-stock", products have + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // type and + // [Product.Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK] + // availability. + // + // * "primary-out-of-stock", products have + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // type and + // [Product.Availability.OUT_OF_STOCK][google.cloud.retail.v2alpha.Product.Availability.OUT_OF_STOCK] + // availability. + // + // * "primary-preorder", products have + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // type and + // [Product.Availability.PREORDER][google.cloud.retail.v2alpha.Product.Availability.PREORDER] + // availability. + // + // * "primary-backorder", products have + // [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] + // type and + // [Product.Availability.BACKORDER][google.cloud.retail.v2alpha.Product.Availability.BACKORDER] + // availability. + // + // * "variant-in-stock", products have + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // type and + // [Product.Availability.IN_STOCK][google.cloud.retail.v2alpha.Product.Availability.IN_STOCK] + // availability. + // + // * "variant-out-of-stock", products have + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // type and + // [Product.Availability.OUT_OF_STOCK][google.cloud.retail.v2alpha.Product.Availability.OUT_OF_STOCK] + // availability. + // + // * "variant-preorder", products have + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // type and + // [Product.Availability.PREORDER][google.cloud.retail.v2alpha.Product.Availability.PREORDER] + // availability. + // + // * "variant-backorder", products have + // [Product.Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT] + // type and + // [Product.Availability.BACKORDER][google.cloud.retail.v2alpha.Product.Availability.BACKORDER] + // availability. + // + // * "price-discounted", products have [Product.price_info.price] < + // [Product.price_info.original_price]. + map counts = 2; + } + + // Metric measured on a group of + // [Product][google.cloud.retail.v2alpha.Product]s against a certain quality + // requirement. Contains the number of products that pass the check and the + // number of products that don't. + message QualityMetric { + // The key that represents a quality requirement rule. + // + // Supported keys: + // * "has-valid-uri": product has a valid and accessible + // [uri][google.cloud.retail.v2alpha.Product.uri]. + // + // * "available-expire-time-conformance": + // [Product.available_time][google.cloud.retail.v2alpha.Product.available_time] + // is early than "now", and + // [Product.expire_time][google.cloud.retail.v2alpha.Product.expire_time] is + // greater than "now". + // + // * "has-searchable-attributes": product has at least one + // [attribute][google.cloud.retail.v2alpha.Product.attributes] set to + // searchable. + // + // * "has-description": product has non-empty + // [description][google.cloud.retail.v2alpha.Product.description]. + // + // * "has-at-least-bigram-title": Product + // [title][google.cloud.retail.v2alpha.Product.title] has at least two + // words. A comprehensive title helps to improve search quality. + // + // * "variant-has-image": the + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] products has + // at least one [image][google.cloud.retail.v2alpha.Product.images]. You may + // ignore this metric if all your products are at + // [primary][google.cloud.retail.v2alpha.Product.Type.PRIMARY] level. + // + // * "variant-has-price-info": the + // [variant][google.cloud.retail.v2alpha.Product.Type.VARIANT] products has + // [price_info][google.cloud.retail.v2alpha.Product.price_info] set. You may + // ignore this metric if all your products are at + // [primary][google.cloud.retail.v2alpha.Product.Type.PRIMARY] level. + // + // * "has-publish-time": product has non-empty + // [publish_time][google.cloud.retail.v2alpha.Product.publish_time]. + string requirement_key = 1; + + // Number of products passing the quality requirement check. We only check + // searchable products. + int32 qualified_product_count = 2; + + // Number of products failing the quality requirement check. We only check + // searchable products. + int32 unqualified_product_count = 3; + + // Value from 0 to 100 representing the suggested percentage of products + // that meet the quality requirements to get good search and recommendation + // performance. 100 * (qualified_product_count) / + // (qualified_product_count + unqualified_product_count) should be greater + // or equal to this suggestion. + double suggested_quality_percent_threshold = 4; + + // A list of a maximum of 100 sample products that do not qualify for + // this requirement. + // + // This field is only populated in the response to + // [BranchService.GetBranch][google.cloud.retail.v2alpha.BranchService.GetBranch] + // API, and is always empty for + // [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches]. + // + // Only the following fields are set in the + // [Product][google.cloud.retail.v2alpha.Product]. + // + // * [Product.name][google.cloud.retail.v2alpha.Product.name] + // * [Product.id][google.cloud.retail.v2alpha.Product.id] + // * [Product.title][google.cloud.retail.v2alpha.Product.title] + repeated Product unqualified_sample_products = 5; + } + + // Immutable. Full resource name of the branch, such as + // `projects/*/locations/global/catalogs/default_catalog/branches/branch_id`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Human readable name of the branch to display in the UI. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this branch is set as the default branch of + // its parent catalog. + bool is_default = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of last import through + // [ProductService.ImportProducts][google.cloud.retail.v2alpha.ProductService.ImportProducts]. + // Empty value means no import has been made to this branch. + google.protobuf.Timestamp last_product_import_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics for number of products in the branch, provided for + // different + // [scopes][google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope]. + // + // This field is not populated in [BranchView.BASIC][] view. + repeated ProductCountStatistic product_count_stats = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The quality metrics measured among products of this branch. + // + // See + // [QualityMetric.requirement_key][google.cloud.retail.v2alpha.Branch.QualityMetric.requirement_key] + // for supported metrics. Metrics could be missing if failed to retrieve. + // + // This field is not populated in [BranchView.BASIC][] view. + repeated QualityMetric quality_metrics = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch_service.proto new file mode 100644 index 00000000000..79f95c361f6 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/branch_service.proto @@ -0,0 +1,111 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/branch.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "BranchServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for [Branch][google.cloud.retail.v2alpha.Branch] Management +// +// [Branch][google.cloud.retail.v2alpha.Branch]es are automatically created when +// a [Catalog][google.cloud.retail.v2alpha.Catalog] is created. There are fixed +// three branches in each catalog, and may use +// [ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches] method +// to get the details of all branches. +service BranchService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all [Branch][google.cloud.retail.v2alpha.Branch]s under the specified + // parent [Catalog][google.cloud.retail.v2alpha.Catalog]. + rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/branches" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a [Branch][google.cloud.retail.v2alpha.Branch]. + rpc GetBranch(GetBranchRequest) returns (Branch) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for +// [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches] +// method. +message ListBranchesRequest { + // Required. The parent catalog resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } + ]; + + // The view to apply to the returned + // [Branch][google.cloud.retail.v2alpha.Branch]. Defaults to + // [Branch.BranchView.BASIC] if unspecified. + // See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch] + // to find what fields are excluded from BASIC view. + BranchView view = 2; +} + +// Response for +// [BranchService.ListBranches][google.cloud.retail.v2alpha.BranchService.ListBranches] +// method. +message ListBranchesResponse { + // The Branches. + repeated Branch branches = 1; +} + +// Request for +// [BranchService.GetBranch][google.cloud.retail.v2alpha.BranchService.GetBranch] +// method. +message GetBranchRequest { + // Required. The name of the branch to retrieve. + // Format: + // `projects/*/locations/global/catalogs/default_catalog/branches/some_branch_id`. + // + // "default_branch" can be used as a special branch_id, it returns the + // default branch that has been set for the catalog. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // The view to apply to the returned + // [Branch][google.cloud.retail.v2alpha.Branch]. Defaults to + // [Branch.BranchView.BASIC] if unspecified. + // See documentation of fields of [Branch][google.cloud.retail.v2alpha.Branch] + // to find what fields are excluded from BASIC view. + BranchView view = 2; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto index 1f20308e7e3..891b328e9c2 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/catalog.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2alpha/common.proto"; import "google/cloud/retail/v2alpha/import_config.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; @@ -87,6 +88,124 @@ message ProductLevelConfig { // Catalog level attribute config for an attribute. For example, if customers // want to enable/disable facet for a specific attribute. message CatalogAttribute { + // Possible options for the facet that corresponds to the current attribute + // config. + message FacetConfig { + // [Facet values][google.cloud.retail.v2alpha.SearchResponse.Facet.values] + // to ignore on [facets][google.cloud.retail.v2alpha.SearchResponse.Facet] + // during the specified time range for the given + // [SearchResponse.Facet.key][google.cloud.retail.v2alpha.SearchResponse.Facet.key] + // attribute. + message IgnoredFacetValues { + // List of facet values to ignore for the following time range. The facet + // values are the same as the attribute values. There is a limit of 10 + // values per instance of IgnoredFacetValues. Each value can have at most + // 128 characters. + repeated string values = 1; + + // Time range for the current list of facet values to ignore. + // If multiple time ranges are specified for an facet value for the + // current attribute, consider all of them. If both are empty, ignore + // always. If start time and end time are set, then start time + // must be before end time. + // If start time is not empty and end time is empty, then will ignore + // these facet values after the start time. + google.protobuf.Timestamp start_time = 2; + + // If start time is empty and end time is not empty, then ignore these + // facet values before end time. + google.protobuf.Timestamp end_time = 3; + } + + // Replaces a set of textual facet values by the same (possibly different) + // merged facet value. Each facet value should appear at most once as a + // value per + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]. This + // feature is available only for textual custom attributes. + message MergedFacetValue { + // All the facet values that are replaces by the same + // [merged_value][google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + // that follows. The maximum number of values per MergedFacetValue is 25. + // Each value can have up to 128 characters. + repeated string values = 1; + + // All the previous values are replaced by this merged facet value. + // This merged_value must be non-empty and can have up to 128 characters. + string merged_value = 2; + } + + // The current facet key (i.e. attribute config) maps into the + // [merged_facet_key][google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.merged_facet_key]. + // A facet key can have at most one child. The current facet key and the + // merged facet key need both to be textual custom attributes or both + // numerical custom attributes (same type). + message MergedFacet { + // The merged facet key should be a valid facet key that is different than + // the facet key of the current catalog attribute. We refer this is + // merged facet key as the child of the current catalog attribute. This + // merged facet key can't be a parent of another facet key (i.e. no + // directed path of length 2). This merged facet key needs to be either a + // textual custom attribute or a numerical custom attribute. + string merged_facet_key = 1; + } + + // Options to rerank based on facet values engaged by the user for the + // current key. That key needs to be a custom textual key and facetable. + // To use this control, you also need to pass all the facet keys engaged by + // the user in the request using the field [SearchRequest.FacetSpec]. In + // particular, if you don't pass the facet keys engaged that you want to + // rerank on, this control won't be effective. Moreover, to obtain better + // results, the facet values that you want to rerank on should be close to + // English (ideally made of words, underscores, and spaces). + message RerankConfig { + // If set to true, then we also rerank the dynamic facets based on the + // facet values engaged by the user for the current attribute key during + // serving. + bool rerank_facet = 1; + + // If empty, rerank on all facet values for the current key. Otherwise, + // will rerank on the facet values from this list only. + repeated string facet_values = 2; + } + + // If you don't set the facet + // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals] + // in the request to a numerical attribute, then we use the computed + // intervals with rounded bounds obtained from all its product numerical + // attribute values. The computed intervals might not be ideal for some + // attributes. Therefore, we give you the option to overwrite them with the + // facet_intervals field. The maximum of facet intervals per + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 40. + // Each interval must have a lower bound or an upper bound. If both bounds + // are provided, then the lower bound must be smaller or equal than the + // upper bound. + repeated Interval facet_intervals = 1; + + // Each instance represents a list of attribute values to ignore as facet + // values for a specific time range. The maximum number of instances per + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 25. + repeated IgnoredFacetValues ignored_facet_values = 2; + + // Each instance replaces a list of facet values by a merged facet + // value. If a facet value is not in any list, then it will stay the same. + // To avoid conflicts, only paths of length 1 are accepted. In other words, + // if "dark_blue" merged into "BLUE", then the latter can't merge into + // "blues" because this would create a path of length 2. The maximum number + // of instances of MergedFacetValue per + // [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] is 100. + // This feature is available only for textual custom attributes. + repeated MergedFacetValue merged_facet_values = 3; + + // Use this field only if you want to merge a facet key into another facet + // key. + MergedFacet merged_facet = 4; + + // Set this field only if you want to rerank based on facet values engaged + // by the user for the current key. This option is only possible for custom + // facetable textual keys. + RerankConfig rerank_config = 5; + } + // The type of an attribute. enum AttributeType { // The type of the attribute is unknown. @@ -211,7 +330,9 @@ message CatalogAttribute { // are indexed so that it can be filtered, faceted, or boosted in // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. IndexableOption indexable_option = 5; // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic @@ -233,7 +354,9 @@ message CatalogAttribute { // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], // as there are no text values associated to numerical attributes. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified, when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2alpha.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. SearchableOption searchable_option = 7; // When @@ -255,6 +378,9 @@ message CatalogAttribute { // results. If unset, the server behavior defaults to // [RETRIEVABLE_DISABLED][google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. RetrievableOption retrievable_option = 12; + + // Contains facet options. + FacetConfig facet_config = 13; } // Catalog level attribute config. @@ -344,8 +470,8 @@ message CompletionConfig { // Output only. Name of the LRO corresponding to the latest suggestion terms // list import. // - // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - // retrieve the latest state of the Long Running Operation. + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API + // method to retrieve the latest state of the Long Running Operation. string last_suggestions_import_operation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -375,10 +501,10 @@ message CompletionConfig { } // Represents a link between a Merchant Center account and a branch. -// Once a link is established, products from the linked merchant center account -// will be streamed to the linked branch. +// After a link is established, products from the linked Merchant Center account +// are streamed to the linked branch. message MerchantCenterLink { - // Required. The linked [Merchant center account + // Required. The linked [Merchant Center account // ID](https://developers.google.com/shopping-content/guides/accountstatuses). // The account must be a standalone account or a sub-account of a MCA. int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -388,7 +514,7 @@ message MerchantCenterLink { // empty value will use the currently configured default branch. However, // changing the default branch later on won't change the linked branch here. // - // A single branch ID can only have one linked merchant center account ID. + // A single branch ID can only have one linked Merchant Center account ID. string branch_id = 2; // String representing the destination to import for, all if left empty. @@ -470,8 +596,8 @@ message Catalog { [(google.api.field_behavior) = REQUIRED]; // The Merchant Center linking configuration. - // Once a link is added, the data stream from Merchant Center to Cloud Retail + // After a link is added, the data stream from Merchant Center to Cloud Retail // will be enabled automatically. The requester must have access to the - // merchant center account in order to make changes to this field. + // Merchant Center account in order to make changes to this field. MerchantCenterLinkingConfig merchant_center_linking_config = 6; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto index a112dcdebe4..1b6da16d937 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/common.proto @@ -124,6 +124,12 @@ message Condition { // Range of time(s) specifying when Condition is active. // Condition true if any time range matches. repeated TimeRange active_time_range = 3; + + // Used to support browse uses cases. + // A list (up to 10 entries) of categories or departments. + // The format should be the same as + // [UserEvent.page_categories][google.cloud.retail.v2alpha.UserEvent.page_categories]; + repeated string page_categories = 4; } // A rule is a condition-action pair @@ -173,17 +179,19 @@ message Rule { } // * Rule Condition: - // - No - // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] - // provided is a global match. - // - 1 or more - // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] - // provided are combined with OR operator. + // - No + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // provided is a global match. + // - 1 or more + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // provided are combined with OR operator. + // // * Action Input: The request query and filter that are applied to the // retrieved products, in addition to any filters already provided with the // SearchRequest. The AND operator is used to combine the query's existing // filters with the filter rule(s). NOTE: May result in 0 results when // filters conflict. + // // * Action Result: Filters the returned objects to be ONLY those that passed // the filter. message FilterAction { @@ -193,9 +201,8 @@ message Rule { // set. // * Filter syntax is identical to // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]. - // See more - // details at the Retail Search - // [user guide](/retail/search/docs/filter-and-order#filter). + // For more + // information, see [Filter](/retail/docs/filter-and-order#filter). // * To filter products with product ID "product_1" or "product_2", and // color // "Red" or "Blue":
@@ -208,7 +215,7 @@ message Rule { // Redirects a shopper to a specific page. // // * Rule Condition: - // - Must specify + // Must specify // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms]. // * Action Input: Request Query // * Action Result: Redirects shopper to provided uri. @@ -290,6 +297,78 @@ message Rule { repeated string ignore_terms = 1; } + // Force returns an attribute/facet in the request around a certain position + // or above. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2alpha.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Inputs: attribute name, position + // + // * Action Result: Will force return a facet key around a certain position + // or above if the condition is satisfied. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // is "shoes", the + // [ForceReturnFacetAction.FacetPositionAdjustment.attribute_name][google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.attribute_name] + // is "size" and the + // [ForceReturnFacetAction.FacetPositionAdjustment.position][google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.position] + // is 8. + // + // Two cases: a) The facet key "size" is not already in the top 8 slots, then + // the facet "size" will appear at a position close to 8. b) The facet key + // "size" in among the top 8 positions in the request, then it will stay at + // its current rank. + message ForceReturnFacetAction { + // Each facet position adjustment consists of a single attribute name (i.e. + // facet key) along with a specified position. + message FacetPositionAdjustment { + // The attribute name to force return as a facet. Each attribute name + // should be a valid attribute name, be non-empty and contain at most 80 + // characters long. + string attribute_name = 1; + + // This is the position in the request as explained above. It should be + // strictly positive be at most 100. + int32 position = 2; + } + + // Each instance corresponds to a force return attribute for the given + // condition. There can't be more 3 instances here. + repeated FacetPositionAdjustment facet_position_adjustments = 1; + } + + // Removes an attribute/facet in the request if is present. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2alpha.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Input: attribute name + // + // * Action Result: Will remove the attribute (as a facet) from the request + // if it is present. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2alpha.Condition.query_terms] + // is "shoes" and the attribute name "size", then facet key "size" will be + // removed from the request (if it is present). + message RemoveFacetAction { + // The attribute names (i.e. facet keys) to remove from the dynamic facets + // (if present in the request). There can't be more 3 attribute names. + // Each attribute name should be a valid attribute name, be non-empty and + // contain at most 80 characters. + repeated string attribute_names = 1; + } + // An action must be provided. oneof action { // A boost action. @@ -316,6 +395,12 @@ message Rule { // Treats a set of terms as synonyms of one another. TwowaySynonymsAction twoway_synonyms_action = 11; + + // Force returns an attribute as a facet in the request. + ForceReturnFacetAction force_return_facet_action = 12; + + // Remove an attribute as a facet in the request (if present). + RemoveFacetAction remove_facet_action = 13; } // Required. The condition that triggers the rule. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto index 3b90365b05b..13a7ce61077 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/completion_service.proto @@ -157,10 +157,10 @@ message CompleteQueryRequest { // This field is only available for "cloud-retail" dataset. bool enable_attribute_suggestions = 9; - // The entity for customers that may run multiple different entities, domains, - // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + // The entity for customers who run multiple entities, domains, sites, or + // regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // If this is set, it should be exactly matched with + // If this is set, it must be an exact match with // [UserEvent.entity][google.cloud.retail.v2alpha.UserEvent.entity] to get // per-entity autocomplete results. string entity = 10; @@ -187,19 +187,22 @@ message CompleteQueryResponse { // Facet information for the suggestion term. Gives the number of items // resulting from a search with this suggestion term for each facet. // - // This is an experimental feature for limited customers. Please reach out - // to the support team if you would like to receive this information. + // This is an experimental feature for limited customers. If you want to + // receive this facet information, reach out to the Retail support team. repeated SearchResponse.Facet facets = 3; // Total number of products associated with a search with this suggestion. // - // This is an experimental feature for limited customers. Please reach out - // to the support team if you would like to receive this information. + // This is an experimental feature for limited customers. If you want to + // receive this product count information, reach out to the Retail support + // team. int32 total_product_count = 4; } - // Recent search of this user. + // Deprecated: Recent search of this user. message RecentSearchResult { + option deprecated = true; + // The recent search query. string recent_search = 1; } @@ -220,9 +223,9 @@ message CompleteQueryResponse { // attribution of complete model performance. string attribution_token = 2; - // Matched recent searches of this user. The maximum number of recent searches - // is 10. This field is a restricted feature. Contact Retail Search support - // team if you are interested in enabling it. + // Deprecated. Matched recent searches of this user. The maximum number of + // recent searches is 10. This field is a restricted feature. If you want to + // enable it, contact Retail Search support. // // This feature is only available when // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2alpha.CompleteQueryRequest.visitor_id] @@ -241,7 +244,7 @@ message CompleteQueryResponse { // // Recent searches are deduplicated. More recent searches will be reserved // when duplication happens. - repeated RecentSearchResult recent_search_results = 3; + repeated RecentSearchResult recent_search_results = 3 [deprecated = true]; // A map of matched attribute suggestions. This field is only available for // "cloud-retail" dataset. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto index d0077e56865..e82b7efb38d 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/import_config.proto @@ -196,7 +196,8 @@ message ImportProductsRequest { ImportErrorsConfig errors_config = 3; // Indicates which fields in the provided imported `products` to update. If - // not set, all fields are updated. + // not set, all fields are updated. If provided, only the existing product + // fields are updated. Missing products will not be created. google.protobuf.FieldMask update_mask = 4; // The mode of reconciliation between existing products and the products to be @@ -212,9 +213,14 @@ message ImportProductsRequest { // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has // to be within the same project as // [ImportProductsRequest.parent][google.cloud.retail.v2alpha.ImportProductsRequest.parent]. - // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - // `pubsub.topics.publish` IAM permission on the topic. + // Make sure that both + // `cloud-retail-customer-data-access@system.gserviceaccount.com` and + // `service-@gcp-sa-retail.iam.gserviceaccount.com` + // have the `pubsub.topics.publish` IAM permission on the topic. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. string notification_pubsub_topic = 7; // If true, this performs the FULL import even if it would delete a large diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto index 9135ab84388..6a979bf2791 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto @@ -30,8 +30,8 @@ option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; // Represents a link between a Merchant Center account and a branch. -// Once a link is established, products from the linked merchant center account -// will be streamed to the linked branch. +// After a link is established, products from the linked Merchant Center account +// are streamed to the linked branch. message MerchantCenterAccountLink { option (google.api.resource) = { type: "retail.googleapis.com/MerchantCenterAccountLink" @@ -88,12 +88,12 @@ message MerchantCenterAccountLink { // The account must be a standalone account or a sub-account of a MCA. int64 merchant_center_account_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The branch id (e.g. 0/1/2) within the catalog that products from + // Required. The branch ID (e.g. 0/1/2) within the catalog that products from // merchant_center_account_id are streamed to. When updating this field, an // empty value will use the currently configured default branch. However, // changing the default branch later on won't change the linked branch here. // - // A single branch id can only have one linked merchant center account id. + // A single branch ID can only have one linked Merchant Center account ID. string branch_id = 3 [(google.api.field_behavior) = REQUIRED]; // The FeedLabel used to perform filtering. @@ -122,8 +122,12 @@ message MerchantCenterAccountLink { // Output only. Represents the state of the link. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. GCP project ID. + // Output only. Google Cloud project ID. string project_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. An optional arbitrary string that could be used as a tag for + // tracking link source. + string source = 10 [(google.api.field_behavior) = OPTIONAL]; } // Common metadata related to the progress of the operations. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto index d79defdec39..2decfde2e31 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto @@ -86,7 +86,7 @@ service MerchantCenterAccountLinkService { message ListMerchantCenterAccountLinksRequest { // Required. The parent Catalog of the resource. // It must match this format: - // projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID} + // `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -107,7 +107,7 @@ message ListMerchantCenterAccountLinksResponse { message CreateMerchantCenterAccountLinkRequest { // Required. The branch resource where this MerchantCenterAccountLink will be // created. Format: - // projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}} + // `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" } @@ -130,7 +130,7 @@ message CreateMerchantCenterAccountLinkRequest { // method. message DeleteMerchantCenterAccountLinkRequest { // Required. Full resource name. Format: - // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id} + // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto index 51d474797ef..1a1791c7637 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/model.proto @@ -253,6 +253,25 @@ message Model { [(google.api.field_behavior) = OPTIONAL]; } + // Additional configs for the frequently-bought-together model type. + message FrequentlyBoughtTogetherFeaturesConfig { + // Optional. Specifies the context of the model when it is used in predict + // requests. Can only be set for the `frequently-bought-together` type. If + // it isn't specified, it defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2alpha.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + ContextProductsType context_products_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Additional model features config. + message ModelFeaturesConfig { + oneof type_dedicated_config { + // Additional configs for frequently-bought-together models. + FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = + 1; + } + } + // The serving state of the model. enum ServingState { // Unspecified serving state. @@ -321,6 +340,22 @@ message Model { DATA_ERROR = 2; } + // Use single or multiple context products for recommendations. + enum ContextProductsType { + // Unspecified default value, should never be explicitly set. + // Defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2alpha.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + + // Use only a single product as context for the recommendation. Typically + // used on pages like add-to-cart or product details. + SINGLE_CONTEXT_PRODUCT = 1; + + // Use one or multiple products as context for the recommendation. Typically + // used on shopping cart pages. + MULTIPLE_CONTEXT_PRODUCTS = 2; + } + // Training configuration specific to a // [Model.type][google.cloud.retail.v2alpha.Model.type] - currently, only for // page optimization. @@ -448,4 +483,8 @@ message Model { // PageOptimizationConfig. repeated ServingConfigList serving_config_lists = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Additional model features config. + ModelFeaturesConfig model_features_config = 22 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto index 394f21912e7..88a391f1fe8 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product.proto @@ -33,10 +33,6 @@ option java_package = "com.google.cloud.retail.v2alpha"; option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; -option (google.api.resource_definition) = { - type: "retail.googleapis.com/Branch" - pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}" -}; // Product captures all metadata information of items to be recommended or // searched. @@ -103,24 +99,22 @@ message Product { } oneof expiration { - // The timestamp when this product becomes unavailable for - // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. - // Note that this is only applicable to - // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and - // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], - // and ignored for - // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In - // general, we suggest the users to delete the stale products explicitly, - // instead of using this field to determine staleness. + // Note that this field is applied in the following ways: // - // If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not - // available for - // [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] - // after [expire_time][google.cloud.retail.v2alpha.Product.expire_time]. - // However, the product can still be retrieved by - // [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] - // and - // [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. + // * If the [Product][google.cloud.retail.v2alpha.Product] is already + // expired when it is uploaded, this product + // is not indexed for search. + // + // * If the [Product][google.cloud.retail.v2alpha.Product] is not expired + // when it is uploaded, only the + // [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY]'s and + // [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION]'s + // expireTime is respected, and + // [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]'s + // expireTime is not used. + // + // In general, we suggest the users to delete the stale + // products explicitly, instead of using this field to determine staleness. // // [expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be // later than @@ -264,9 +258,10 @@ message Product { // INVALID_ARGUMENT error is returned. // // At most 250 values are allowed per - // [Product][google.cloud.retail.v2alpha.Product]. Empty values are not - // allowed. Each value must be a UTF-8 encoded string with a length limit of - // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. + // [Product][google.cloud.retail.v2alpha.Product] unless overridden through + // the Google Cloud console. Empty values are not allowed. Each value must be + // a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, + // an INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [google_product_category][mc_google_product_category]. Schema.org property @@ -288,9 +283,10 @@ message Product { // The brands of the product. // - // A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - // string with a length limit of 1,000 characters. Otherwise, an - // INVALID_ARGUMENT error is returned. + // A maximum of 30 brands are allowed unless overridden through the Google + // Cloud console. Each + // brand must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [brand](https://support.google.com/merchants/answer/6324351). Schema.org diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto index 85f442a3a45..72c1edecfb9 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/product_service.proto @@ -196,10 +196,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] - // method instead of - // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces]. + // method instead of the + // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] + // method. // [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. @@ -238,10 +239,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] - // method instead of - // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. + // method instead of the + // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] + // method. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project.proto new file mode 100644 index 00000000000..6b91fce278d --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project.proto @@ -0,0 +1,188 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.retail.v2alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "ProjectProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Project level logging config to control what level of log will be generated +// and written to Cloud Logging. +message LoggingConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/LoggingConfig" + pattern: "projects/{project}/loggingConfig" + }; + + // The logging configurations for services supporting log generation. + message LogGenerationRule { + // The logging level. + // + // By default it is set to `LOG_WARNINGS_AND_ABOVE`. + LoggingLevel logging_level = 1; + + // The log sample rate for INFO level log entries. You can use this to + // reduce the number of entries generated for INFO level logs. + // + // DO NOT set this field if the + // [logging_level][google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.logging_level] + // is not + // [LoggingLevel.LOG_ALL][google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel.LOG_ALL]. + // Otherwise, an INVALID_ARGUMENT error is returned. + // + // Sample rate for INFO logs defaults to 1 when unset (generate and send all + // INFO logs to Cloud Logging). Its value must be greater than 0 and less + // than or equal to 1. + optional float info_log_sample_rate = 2; + } + + // The granular logging configurations for supported services. + message ServiceLogGenerationRule { + // Required. Supported service names: + // "CatalogService", + // "CompletionService", + // "ControlService", + // "MerchantCenterStreaming", + // "ModelService", + // "PredictionService", + // "ProductService", + // "ServingConfigService", + // "UserEventService", + string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The log generation rule that applies to this service. + LogGenerationRule log_generation_rule = 3; + } + + // The setting to control log generation. + enum LoggingLevel { + // Default value. Defaults to `LOG_FOR_WARNINGS_AND_ABOVE` if unset. + LOGGING_LEVEL_UNSPECIFIED = 0; + + // No log will be generated and sent to Cloud Logging. + LOGGING_DISABLED = 1; + + // Log for operations resulted in fatal error. + LOG_ERRORS_AND_ABOVE = 2; + + // In addition to `LOG_ERRORS_AND_ABOVE`, also log for operations that have + // soft errors, quality suggestions. + LOG_WARNINGS_AND_ABOVE = 3; + + // Log all operations, including successful ones. + LOG_ALL = 4; + } + + // Required. Immutable. The name of the LoggingConfig singleton resource. + // Format: projects/*/loggingConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The log generation rule that applies by default to all services + // supporting log generation. It can be overridden by + // [ServiceLogGenerationRule][google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule] + // for service level control. + LogGenerationRule default_log_generation_rule = 2; + + // Controls logging configurations more granularly for each supported + // service. + // + // This overrides the + // [default_log_generation_rule][google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule] + // for the services specified. For those not mentioned, they will fallback to + // the default log generation rule. + repeated ServiceLogGenerationRule service_log_generation_rules = 4; +} + +// Metadata that describes a Cloud Retail Project. +message Project { + option (google.api.resource) = { + type: "retail.googleapis.com/RetailProject" + pattern: "projects/{project}/retailProject" + }; + + // Output only. Full resource name of the retail project, such as + // `projects/{project_id_or_number}/retailProject`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Retail API solutions that the project has enrolled. + repeated SolutionType enrolled_solutions = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Project level alert config. +message AlertConfig { + option (google.api.resource) = { + type: "retail.googleapis.com/AlertConfig" + pattern: "projects/{project}/alertConfig" + }; + + // Alert policy for a customer. + message AlertPolicy { + // Recipient contact information. + message Recipient { + // Email address of the recipient. + string email_address = 1; + } + + // The enrollment status enum for alert policy. + enum EnrollStatus { + // Default value. Used for customers who have not responded to the + // alert policy. + ENROLL_STATUS_UNSPECIFIED = 0; + + // Customer is enrolled in this policy. + ENROLLED = 1; + + // Customer declined this policy. + DECLINED = 2; + } + + // The feature that provides alerting capability. Supported value is + // only `search-data-quality` for now. + string alert_group = 1; + + // The enrollment status of a customer. + EnrollStatus enroll_status = 2; + + // Recipients for the alert policy. + // One alert policy should not exceed 20 recipients. + repeated Recipient recipients = 3; + } + + // Required. Immutable. The name of the AlertConfig singleton resource. + // Format: projects/*/alertConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Alert policies for a customer. + // They must be unique by [AlertPolicy.alert_group] + repeated AlertPolicy alert_policies = 2; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project_service.proto new file mode 100644 index 00000000000..4e795901737 --- /dev/null +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/project_service.proto @@ -0,0 +1,273 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/common.proto"; +import "google/cloud/retail/v2alpha/project.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "ProjectServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for settings at Project level. +service ProjectService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets the project. + // + // Throws `NOT_FOUND` if the project wasn't initialized for the Retail API + // service. + rpc GetProject(GetProjectRequest) returns (Project) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/retailProject}" + }; + option (google.api.method_signature) = "name"; + } + + // Accepts service terms for this project. + // By making requests to this API, you agree to the terms of service linked + // below. + // https://cloud.google.com/retail/data-use-terms + rpc AcceptTerms(AcceptTermsRequest) returns (Project) { + option (google.api.http) = { + post: "/v2alpha/{project=projects/*/retailProject}:acceptTerms" + body: "*" + }; + option (google.api.method_signature) = "project"; + } + + // The method enrolls a solution of type [Retail + // Search][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH] + // into a project. + // + // The [Recommendations AI solution + // type][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION] + // is enrolled by default when your project enables Retail API, so you don't + // need to call the enrollSolution method for recommendations. + rpc EnrollSolution(EnrollSolutionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{project=projects/*}:enrollSolution" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.EnrollSolutionResponse" + metadata_type: "google.cloud.retail.v2alpha.EnrollSolutionMetadata" + }; + } + + // Lists all the retail API solutions the project has enrolled. + rpc ListEnrolledSolutions(ListEnrolledSolutionsRequest) + returns (ListEnrolledSolutionsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*}:enrolledSolutions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of the + // requested project. + rpc GetLoggingConfig(GetLoggingConfigRequest) returns (LoggingConfig) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/loggingConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of + // the requested project. + rpc UpdateLoggingConfig(UpdateLoggingConfigRequest) returns (LoggingConfig) { + option (google.api.http) = { + patch: "/v2alpha/{logging_config.name=projects/*/loggingConfig}" + body: "logging_config" + }; + option (google.api.method_signature) = "logging_config,update_mask"; + } + + // Get the [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] of the + // requested project. + rpc GetAlertConfig(GetAlertConfigRequest) returns (AlertConfig) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/alertConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // Update the alert config of the requested project. + rpc UpdateAlertConfig(UpdateAlertConfigRequest) returns (AlertConfig) { + option (google.api.http) = { + patch: "/v2alpha/{alert_config.name=projects/*/alertConfig}" + body: "alert_config" + }; + option (google.api.method_signature) = "alert_config,update_mask"; + } +} + +// Request for GetProject method. +message GetProjectRequest { + // Required. Full resource name of the project. Format: + // `projects/{project_number_or_id}/retailProject` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/RetailProject" + } + ]; +} + +// Request for AcceptTerms method. +message AcceptTermsRequest { + // Required. Full resource name of the project. Format: + // `projects/{project_number_or_id}/retailProject` + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/RetailProject" + } + ]; +} + +// Request for EnrollSolution method. +message EnrollSolutionRequest { + // Required. Full resource name of parent. Format: + // `projects/{project_number_or_id}` + string project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Solution to enroll. + SolutionType solution = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for EnrollSolution method. +message EnrollSolutionResponse { + // Retail API solution that the project has enrolled. + SolutionType enrolled_solution = 1; +} + +// Metadata related to the EnrollSolution method. +// This will be returned by the google.longrunning.Operation.metadata field. +message EnrollSolutionMetadata {} + +// Request for ListEnrolledSolutions method. +message ListEnrolledSolutionsRequest { + // Required. Full resource name of parent. Format: + // `projects/{project_number_or_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// Response for ListEnrolledSolutions method. +message ListEnrolledSolutionsResponse { + // Retail API solutions that the project has enrolled. + repeated SolutionType enrolled_solutions = 1; +} + +// Request for +// [ProjectService.GetLoggingConfig][google.cloud.retail.v2alpha.ProjectService.GetLoggingConfig] +// method. +message GetLoggingConfigRequest { + // Required. Full LoggingConfig resource name. Format: + // projects/{project_number}/loggingConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/LoggingConfig" + } + ]; +} + +// Request for +// [ProjectService.UpdateLoggingConfig][google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfig] +// method. +message UpdateLoggingConfigRequest { + // Required. The [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to + // update. + // + // If the caller does not have permission to update the + // [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig], then a + // PERMISSION_DENIED error is returned. + // + // If the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to update + // does not exist, a NOT_FOUND error is returned. + LoggingConfig logging_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] to update. The + // following are the only supported fields: + // + // * [LoggingConfig.default_log_generation_rule][google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule] + // * [LoggingConfig.service_log_generation_rules][google.cloud.retail.v2alpha.LoggingConfig.service_log_generation_rules] + // + // If not set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for +// [ProjectService.GetAlertConfig][google.cloud.retail.v2alpha.ProjectService.GetAlertConfig] +// method. +message GetAlertConfigRequest { + // Required. Full AlertConfig resource name. Format: + // projects/{project_number}/alertConfig + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "retail.googleapis.com/AlertConfig" + } + ]; +} + +// Request for +// [ProjectService.UpdateAlertConfig][google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfig] +// method. +message UpdateAlertConfigRequest { + // Required. The [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to + // update. + // + // If the caller does not have permission to update the + // [AlertConfig][google.cloud.retail.v2alpha.AlertConfig], then a + // PERMISSION_DENIED error is returned. + // + // If the [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to update + // does not exist, a NOT_FOUND error is returned. + AlertConfig alert_config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates which fields in the provided + // [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] to update. If not + // set, all supported fields are updated. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/promotion.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/promotion.proto index b458f4575fd..b02a84e2117 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/promotion.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/promotion.proto @@ -34,7 +34,7 @@ message Promotion { // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is // returned. // - // Google Merchant Center property - // [promotion](https://support.google.com/merchants/answer/7050148). + // Corresponds to Google Merchant Center property + // [promotion_id](https://support.google.com/merchants/answer/7050148). string promotion_id = 1; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto index fed0832394f..bced414d8f6 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/search_service.proto @@ -119,13 +119,13 @@ message SearchRequest { // values. Maximum number of intervals is 40. // // For all numerical facet keys that appear in the list of products from - // the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + // the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are // computed from their distribution weekly. If the model assigns a high // score to a numerical facet key and its intervals are not specified in - // the search request, these percentiles will become the bounds - // for its intervals and will be returned in the response. If the + // the search request, these percentiles become the bounds + // for its intervals and are returned in the response. If the // facet key intervals are specified in the request, then the specified - // intervals will be returned instead. + // intervals are returned instead. repeated Interval intervals = 2; // Only get facet for the given restricted values. For example, when using @@ -158,14 +158,14 @@ message SearchRequest { // Only get facet values that start with the given string prefix. For // example, suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // "categories" facet gives only "Women > Shoe" and "Women > Dress". // Only supported on textual fields. Maximum is 10. repeated string prefixes = 8; // Only get facet values that contains the given strings. For example, // suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // "categories" facet gives only "Women > Shoe" and "Men > Shoe". // Only supported on textual fields. Maximum is 10. repeated string contains = 9; @@ -198,7 +198,7 @@ message SearchRequest { string order_by = 4; // The query that is used to compute facet for the given facet key. - // When provided, it will override the default behavior of facet + // When provided, it overrides the default behavior of facet // computation. The query syntax is the same as a filter expression. See // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] // for detail syntax and limitations. Notice that there is no limitation @@ -208,9 +208,9 @@ message SearchRequest { // // In the response, // [SearchResponse.Facet.values.value][google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.value] - // will be always "1" and + // is always "1" and // [SearchResponse.Facet.values.count][google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.count] - // will be the number of results that match the query. + // is the number of results that match the query. // // For example, you can set a customized facet for "shipToStore", // where @@ -218,7 +218,7 @@ message SearchRequest { // is "customizedShipToStore", and // [FacetKey.query][google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.query] // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - // Then the facet will count the products that are both in stock and ship + // Then the facet counts the products that are both in stock and ship // to store "123". string query = 5; @@ -269,15 +269,15 @@ message SearchRequest { // Enables dynamic position for this facet. If set to true, the position of // this facet among all facets in the response is determined by Google - // Retail Search. It will be ordered together with dynamic facets if dynamic + // Retail Search. It is ordered together with dynamic facets if dynamic // facets is enabled. If set to false, the position of this facet in the - // response will be the same as in the request, and it will be ranked before + // response is the same as in the request, and it is ranked before // the facets with dynamic position enable and all dynamic facets. // // For example, you may always want to have rating facet returned in // the response, but it's not necessarily to always display the rating facet // at the top. In that case, you can set enable_dynamic_position to true so - // that the position of rating facet in response will be determined by + // that the position of rating facet in response is determined by // Google Retail Search. // // Another example, assuming you have the following facets in the request: @@ -288,13 +288,13 @@ message SearchRequest { // // * "brands", enable_dynamic_position = false // - // And also you have a dynamic facets enable, which will generate a facet - // 'gender'. Then the final order of the facets in the response can be + // And also you have a dynamic facets enable, which generates a facet + // "gender". Then, the final order of the facets in the response can be // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", // "rating") depends on how Google Retail Search orders "gender" and - // "rating" facets. However, notice that "price" and "brands" will always be - // ranked at 1st and 2nd position since their enable_dynamic_position are - // false. + // "rating" facets. However, notice that "price" and "brands" are always + // ranked at first and second position because their enable_dynamic_position + // values are false. bool enable_dynamic_position = 4; } @@ -513,7 +513,7 @@ message SearchRequest { // or the name of the legacy placement resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. // This field is used to identify the serving config name and the set - // of models that will be used to make the search. + // of models that are used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; // The branch resource name, such as @@ -579,8 +579,8 @@ message SearchRequest { // The filter syntax consists of an expression language for constructing a // predicate from one or more fields of the products being filtered. Filter - // expression is case-sensitive. See more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + // expression is case-sensitive. For more information, see + // [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string filter = 10; @@ -589,22 +589,21 @@ message SearchRequest { // checking any filters on the search page. // // The filter applied to every search request when quality improvement such as - // query expansion is needed. For example, if a query does not have enough - // results, an expanded query with - // [SearchRequest.canonical_filter][google.cloud.retail.v2alpha.SearchRequest.canonical_filter] - // will be returned as a supplement of the original query. This field is - // strongly recommended to achieve high search quality. + // query expansion is needed. In the case a query does not have a sufficient + // amount of results this filter will be used to determine whether or not to + // enable the query expansion flow. The original filter will still be used for + // the query expanded search. + // This field is strongly recommended to achieve high search quality. // - // See - // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter] - // for more details about filter syntax. + // For more information about filter syntax, see + // [SearchRequest.filter][google.cloud.retail.v2alpha.SearchRequest.filter]. string canonical_filter = 28; // The order in which products are returned. Products can be ordered by // a field in an [Product][google.cloud.retail.v2alpha.Product] object. Leave - // it unset if ordered by relevance. OrderBy expression is case-sensitive. See - // more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#order). + // it unset if ordered by relevance. OrderBy expression is case-sensitive. For + // more information, see + // [Order](https://cloud.google.com/retail/docs/filter-and-order#order). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string order_by = 11; @@ -622,8 +621,8 @@ message SearchRequest { // textual facets can be dynamically generated. DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - // Boost specification to boost certain products. See more details at this - // [user guide](https://cloud.google.com/retail/docs/boosting). + // Boost specification to boost certain products. For more information, see + // [Boost results](https://cloud.google.com/retail/docs/boosting). // // Notice that if both // [ServingConfig.boost_control_ids][google.cloud.retail.v2alpha.ServingConfig.boost_control_ids] @@ -635,8 +634,8 @@ message SearchRequest { BoostSpec boost_spec = 13; // The query expansion specification that specifies the conditions under which - // query expansion will occur. See more details at this [user - // guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + // query expansion occurs. For more information, see [Query + // expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). QueryExpansionSpec query_expansion_spec = 14; // The relevance threshold of the search results. @@ -644,8 +643,8 @@ message SearchRequest { // Defaults to // [RelevanceThreshold.HIGH][google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH], // which means only the most relevant results are shown, and the least number - // of results are returned. See more details at this [user - // guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + // of results are returned. For more information, see [Adjust result + // size](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). RelevanceThreshold relevance_threshold = 15; // The keys to fetch and rollup the matching @@ -773,9 +772,9 @@ message SearchRequest { // key with multiple resources. // * Keys must start with a lowercase letter or international character. // - // See [Google Cloud - // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. + // For more information, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // in the Resource Manager documentation. map labels = 34; // The spell correction specification that specifies the mode under @@ -995,7 +994,8 @@ message SearchResponse { repeated ExperimentInfo experiment_info = 17; } -// Metadata for active A/B testing [Experiments][]. +// Metadata for active A/B testing +// [Experiment][google.cloud.retail.v2alpha.Experiment]. message ExperimentInfo { // Metadata for active serving config A/B tests. message ServingConfigExperiment { @@ -1008,8 +1008,8 @@ message ExperimentInfo { }]; // The fully qualified resource name of the serving config - // [VariantArm.serving_config_id][] responsible for generating the search - // response. For example: + // [Experiment.VariantArm.serving_config_id][google.cloud.retail.v2alpha.Experiment.VariantArm.serving_config_id] + // responsible for generating the search response. For example: // `projects/*/locations/*/catalogs/*/servingConfigs/*`. string experiment_serving_config = 2 [(google.api.resource_reference) = { type: "retail.googleapis.com/ServingConfig" diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto index 10f3121aaec..d8dc6779430 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/serving_config.proto @@ -255,6 +255,10 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string enable_category_filter_level = 16; + // When the flag is enabled, the products in the denylist will not be filtered + // out in the recommendation filtering results. + bool ignore_recs_denylist = 24; + // The specification for personalization spec. // // Can only be set if diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto index 71d9f4d06e7..1b810fbbf55 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2alpha/user_event.proto @@ -37,6 +37,7 @@ message UserEvent { // Required. User event type. Allowed values are: // // * `add-to-cart`: Products being added to cart. + // * `remove-from-cart`: Products being removed from cart. // * `category-page-view`: Special pages such as sale or promotion pages // viewed. // * `detail-page-view`: Products detail page viewed. @@ -274,8 +275,8 @@ message UserEvent { // The entity for customers that may run multiple different entities, domains, // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // It is recommended to set this field to get better per-entity search, - // completion and prediction results. + // We recommend that you set this field to get better per-entity search, + // completion, and prediction results. string entity = 23; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto index f5164dfc97b..c8bca58e65a 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/catalog.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/retail/v2beta/common.proto"; import "google/cloud/retail/v2beta/import_config.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2Beta"; option go_package = "cloud.google.com/go/retail/apiv2beta/retailpb;retailpb"; @@ -87,6 +88,124 @@ message ProductLevelConfig { // Catalog level attribute config for an attribute. For example, if customers // want to enable/disable facet for a specific attribute. message CatalogAttribute { + // Possible options for the facet that corresponds to the current attribute + // config. + message FacetConfig { + // [Facet values][google.cloud.retail.v2beta.SearchResponse.Facet.values] to + // ignore on [facets][google.cloud.retail.v2beta.SearchResponse.Facet] + // during the specified time range for the given + // [SearchResponse.Facet.key][google.cloud.retail.v2beta.SearchResponse.Facet.key] + // attribute. + message IgnoredFacetValues { + // List of facet values to ignore for the following time range. The facet + // values are the same as the attribute values. There is a limit of 10 + // values per instance of IgnoredFacetValues. Each value can have at most + // 128 characters. + repeated string values = 1; + + // Time range for the current list of facet values to ignore. + // If multiple time ranges are specified for an facet value for the + // current attribute, consider all of them. If both are empty, ignore + // always. If start time and end time are set, then start time + // must be before end time. + // If start time is not empty and end time is empty, then will ignore + // these facet values after the start time. + google.protobuf.Timestamp start_time = 2; + + // If start time is empty and end time is not empty, then ignore these + // facet values before end time. + google.protobuf.Timestamp end_time = 3; + } + + // Replaces a set of textual facet values by the same (possibly different) + // merged facet value. Each facet value should appear at most once as a + // value per + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]. This + // feature is available only for textual custom attributes. + message MergedFacetValue { + // All the facet values that are replaces by the same + // [merged_value][google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.merged_value] + // that follows. The maximum number of values per MergedFacetValue is 25. + // Each value can have up to 128 characters. + repeated string values = 1; + + // All the previous values are replaced by this merged facet value. + // This merged_value must be non-empty and can have up to 128 characters. + string merged_value = 2; + } + + // The current facet key (i.e. attribute config) maps into the + // [merged_facet_key][google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.merged_facet_key]. + // A facet key can have at most one child. The current facet key and the + // merged facet key need both to be textual custom attributes or both + // numerical custom attributes (same type). + message MergedFacet { + // The merged facet key should be a valid facet key that is different than + // the facet key of the current catalog attribute. We refer this is + // merged facet key as the child of the current catalog attribute. This + // merged facet key can't be a parent of another facet key (i.e. no + // directed path of length 2). This merged facet key needs to be either a + // textual custom attribute or a numerical custom attribute. + string merged_facet_key = 1; + } + + // Options to rerank based on facet values engaged by the user for the + // current key. That key needs to be a custom textual key and facetable. + // To use this control, you also need to pass all the facet keys engaged by + // the user in the request using the field [SearchRequest.FacetSpec]. In + // particular, if you don't pass the facet keys engaged that you want to + // rerank on, this control won't be effective. Moreover, to obtain better + // results, the facet values that you want to rerank on should be close to + // English (ideally made of words, underscores, and spaces). + message RerankConfig { + // If set to true, then we also rerank the dynamic facets based on the + // facet values engaged by the user for the current attribute key during + // serving. + bool rerank_facet = 1; + + // If empty, rerank on all facet values for the current key. Otherwise, + // will rerank on the facet values from this list only. + repeated string facet_values = 2; + } + + // If you don't set the facet + // [SearchRequest.FacetSpec.FacetKey.intervals][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.intervals] + // in the request to a numerical attribute, then we use the computed + // intervals with rounded bounds obtained from all its product numerical + // attribute values. The computed intervals might not be ideal for some + // attributes. Therefore, we give you the option to overwrite them with the + // facet_intervals field. The maximum of facet intervals per + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] is 40. + // Each interval must have a lower bound or an upper bound. If both bounds + // are provided, then the lower bound must be smaller or equal than the + // upper bound. + repeated Interval facet_intervals = 1; + + // Each instance represents a list of attribute values to ignore as facet + // values for a specific time range. The maximum number of instances per + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] is 25. + repeated IgnoredFacetValues ignored_facet_values = 2; + + // Each instance replaces a list of facet values by a merged facet + // value. If a facet value is not in any list, then it will stay the same. + // To avoid conflicts, only paths of length 1 are accepted. In other words, + // if "dark_blue" merged into "BLUE", then the latter can't merge into + // "blues" because this would create a path of length 2. The maximum number + // of instances of MergedFacetValue per + // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] is 100. + // This feature is available only for textual custom attributes. + repeated MergedFacetValue merged_facet_values = 3; + + // Use this field only if you want to merge a facet key into another facet + // key. + MergedFacet merged_facet = 4; + + // Set this field only if you want to rerank based on facet values engaged + // by the user for the current key. This option is only possible for custom + // facetable textual keys. + RerankConfig rerank_config = 5; + } + // The type of an attribute. enum AttributeType { // The type of the attribute is unknown. @@ -210,7 +329,9 @@ message CatalogAttribute { // are indexed so that it can be filtered, faceted, or boosted in // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. IndexableOption indexable_option = 5; // If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic @@ -232,7 +353,9 @@ message CatalogAttribute { // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], as // there are no text values associated to numerical attributes. // - // Must be specified, otherwise throws INVALID_FORMAT error. + // Must be specified, when + // [AttributesConfig.attribute_config_level][google.cloud.retail.v2beta.AttributesConfig.attribute_config_level] + // is CATALOG_LEVEL_ATTRIBUTE_CONFIG, otherwise throws INVALID_FORMAT error. SearchableOption searchable_option = 7; // When @@ -254,6 +377,9 @@ message CatalogAttribute { // results. If unset, the server behavior defaults to // [RETRIEVABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED]. RetrievableOption retrievable_option = 12; + + // Contains facet options. + FacetConfig facet_config = 13; } // Catalog level attribute config. @@ -343,8 +469,8 @@ message CompletionConfig { // Output only. Name of the LRO corresponding to the latest suggestion terms // list import. // - // Can use [GetOperation][google.longrunning.Operations.GetOperation] API to - // retrieve the latest state of the Long Running Operation. + // Can use [GetOperation][google.longrunning.Operations.GetOperation] API + // method to retrieve the latest state of the Long Running Operation. string last_suggestions_import_operation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -374,10 +500,10 @@ message CompletionConfig { } // Represents a link between a Merchant Center account and a branch. -// Once a link is established, products from the linked merchant center account -// will be streamed to the linked branch. +// After a link is established, products from the linked Merchant Center account +// are streamed to the linked branch. message MerchantCenterLink { - // Required. The linked [Merchant center account + // Required. The linked [Merchant Center account // ID](https://developers.google.com/shopping-content/guides/accountstatuses). // The account must be a standalone account or a sub-account of a MCA. int64 merchant_center_account_id = 1 [(google.api.field_behavior) = REQUIRED]; @@ -387,7 +513,7 @@ message MerchantCenterLink { // empty value will use the currently configured default branch. However, // changing the default branch later on won't change the linked branch here. // - // A single branch ID can only have one linked merchant center account ID. + // A single branch ID can only have one linked Merchant Center account ID. string branch_id = 2; // String representing the destination to import for, all if left empty. @@ -469,8 +595,8 @@ message Catalog { [(google.api.field_behavior) = REQUIRED]; // The Merchant Center linking configuration. - // Once a link is added, the data stream from Merchant Center to Cloud Retail + // After a link is added, the data stream from Merchant Center to Cloud Retail // will be enabled automatically. The requester must have access to the - // merchant center account in order to make changes to this field. + // Merchant Center account in order to make changes to this field. MerchantCenterLinkingConfig merchant_center_linking_config = 6; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto index 09912ca5ac4..b0a522235d8 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/common.proto @@ -124,6 +124,12 @@ message Condition { // Range of time(s) specifying when Condition is active. // Condition true if any time range matches. repeated TimeRange active_time_range = 3; + + // Used to support browse uses cases. + // A list (up to 10 entries) of categories or departments. + // The format should be the same as + // [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; + repeated string page_categories = 4; } // A rule is a condition-action pair @@ -173,17 +179,19 @@ message Rule { } // * Rule Condition: - // - No - // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] - // provided is a global match. - // - 1 or more - // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] - // provided are combined with OR operator. + // - No + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // provided is a global match. + // - 1 or more + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // provided are combined with OR operator. + // // * Action Input: The request query and filter that are applied to the // retrieved products, in addition to any filters already provided with the // SearchRequest. The AND operator is used to combine the query's existing // filters with the filter rule(s). NOTE: May result in 0 results when // filters conflict. + // // * Action Result: Filters the returned objects to be ONLY those that passed // the filter. message FilterAction { @@ -193,9 +201,8 @@ message Rule { // set. // * Filter syntax is identical to // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]. - // See more - // details at the Retail Search - // [user guide](/retail/search/docs/filter-and-order#filter). + // For more + // information, see [Filter](/retail/docs/filter-and-order#filter). // * To filter products with product ID "product_1" or "product_2", and // color // "Red" or "Blue":
@@ -208,7 +215,7 @@ message Rule { // Redirects a shopper to a specific page. // // * Rule Condition: - // - Must specify + // Must specify // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms]. // * Action Input: Request Query // * Action Result: Redirects shopper to provided uri. @@ -290,6 +297,78 @@ message Rule { repeated string ignore_terms = 1; } + // Force returns an attribute/facet in the request around a certain position + // or above. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2beta.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Inputs: attribute name, position + // + // * Action Result: Will force return a facet key around a certain position + // or above if the condition is satisfied. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // is "shoes", the + // [ForceReturnFacetAction.FacetPositionAdjustment.attribute_name][google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.attribute_name] + // is "size" and the + // [ForceReturnFacetAction.FacetPositionAdjustment.position][google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.position] + // is 8. + // + // Two cases: a) The facet key "size" is not already in the top 8 slots, then + // the facet "size" will appear at a position close to 8. b) The facet key + // "size" in among the top 8 positions in the request, then it will stay at + // its current rank. + message ForceReturnFacetAction { + // Each facet position adjustment consists of a single attribute name (i.e. + // facet key) along with a specified position. + message FacetPositionAdjustment { + // The attribute name to force return as a facet. Each attribute name + // should be a valid attribute name, be non-empty and contain at most 80 + // characters long. + string attribute_name = 1; + + // This is the position in the request as explained above. It should be + // strictly positive be at most 100. + int32 position = 2; + } + + // Each instance corresponds to a force return attribute for the given + // condition. There can't be more 3 instances here. + repeated FacetPositionAdjustment facet_position_adjustments = 1; + } + + // Removes an attribute/facet in the request if is present. + // + // * Rule Condition: + // Must specify non-empty + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // (for search only) or + // [Condition.page_categories][google.cloud.retail.v2beta.Condition.page_categories] + // (for browse only), but can't specify both. + // + // * Action Input: attribute name + // + // * Action Result: Will remove the attribute (as a facet) from the request + // if it is present. + // + // Example: Suppose the query is "shoes", the + // [Condition.query_terms][google.cloud.retail.v2beta.Condition.query_terms] + // is "shoes" and the attribute name "size", then facet key "size" will be + // removed from the request (if it is present). + message RemoveFacetAction { + // The attribute names (i.e. facet keys) to remove from the dynamic facets + // (if present in the request). There can't be more 3 attribute names. + // Each attribute name should be a valid attribute name, be non-empty and + // contain at most 80 characters. + repeated string attribute_names = 1; + } + // An action must be provided. oneof action { // A boost action. @@ -316,6 +395,12 @@ message Rule { // Treats a set of terms as synonyms of one another. TwowaySynonymsAction twoway_synonyms_action = 11; + + // Force returns an attribute as a facet in the request. + ForceReturnFacetAction force_return_facet_action = 12; + + // Remove an attribute as a facet in the request (if present). + RemoveFacetAction remove_facet_action = 13; } // Required. The condition that triggers the rule. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto index 3e05448b0d1..ebf7fdb25ed 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/completion_service.proto @@ -151,10 +151,15 @@ message CompleteQueryRequest { // capped by 20. int32 max_suggestions = 5; - // The entity for customers that may run multiple different entities, domains, - // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + // If true, attribute suggestions are enabled and provided in response. + // + // This field is only available for "cloud-retail" dataset. + bool enable_attribute_suggestions = 9; + + // The entity for customers who run multiple entities, domains, sites, or + // regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // If this is set, it should be exactly matched with + // If this is set, it must be an exact match with // [UserEvent.entity][google.cloud.retail.v2beta.UserEvent.entity] to get // per-entity autocomplete results. string entity = 10; @@ -179,8 +184,10 @@ message CompleteQueryResponse { map attributes = 2; } - // Recent search of this user. + // Deprecated: Recent search of this user. message RecentSearchResult { + option deprecated = true; + // The recent search query. string recent_search = 1; } @@ -195,9 +202,9 @@ message CompleteQueryResponse { // attribution of complete model performance. string attribution_token = 2; - // Matched recent searches of this user. The maximum number of recent searches - // is 10. This field is a restricted feature. Contact Retail Search support - // team if you are interested in enabling it. + // Deprecated. Matched recent searches of this user. The maximum number of + // recent searches is 10. This field is a restricted feature. If you want to + // enable it, contact Retail Search support. // // This feature is only available when // [CompleteQueryRequest.visitor_id][google.cloud.retail.v2beta.CompleteQueryRequest.visitor_id] @@ -216,5 +223,5 @@ message CompleteQueryResponse { // // Recent searches are deduplicated. More recent searches will be reserved // when duplication happens. - repeated RecentSearchResult recent_search_results = 3; + repeated RecentSearchResult recent_search_results = 3 [deprecated = true]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto index 591039611ee..f5e67023bcb 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/import_config.proto @@ -196,7 +196,8 @@ message ImportProductsRequest { ImportErrorsConfig errors_config = 3; // Indicates which fields in the provided imported `products` to update. If - // not set, all fields are updated. + // not set, all fields are updated. If provided, only the existing product + // fields are updated. Missing products will not be created. google.protobuf.FieldMask update_mask = 4; // The mode of reconciliation between existing products and the products to be @@ -212,9 +213,14 @@ message ImportProductsRequest { // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has // to be within the same project as // [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent]. - // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - // `pubsub.topics.publish` IAM permission on the topic. + // Make sure that both + // `cloud-retail-customer-data-access@system.gserviceaccount.com` and + // `service-@gcp-sa-retail.iam.gserviceaccount.com` + // have the `pubsub.topics.publish` IAM permission on the topic. + // + // Only supported when + // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode] + // is set to `FULL`. string notification_pubsub_topic = 7; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/model.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/model.proto index 3334fe81b61..e9916f6696b 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/model.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/model.proto @@ -50,6 +50,25 @@ message Model { [(google.api.field_behavior) = OPTIONAL]; } + // Additional configs for the frequently-bought-together model type. + message FrequentlyBoughtTogetherFeaturesConfig { + // Optional. Specifies the context of the model when it is used in predict + // requests. Can only be set for the `frequently-bought-together` type. If + // it isn't specified, it defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2beta.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + ContextProductsType context_products_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Additional model features config. + message ModelFeaturesConfig { + oneof type_dedicated_config { + // Additional configs for frequently-bought-together models. + FrequentlyBoughtTogetherFeaturesConfig frequently_bought_together_config = + 1; + } + } + // The serving state of the model. enum ServingState { // Unspecified serving state. @@ -118,6 +137,22 @@ message Model { DATA_ERROR = 2; } + // Use single or multiple context products for recommendations. + enum ContextProductsType { + // Unspecified default value, should never be explicitly set. + // Defaults to + // [MULTIPLE_CONTEXT_PRODUCTS][google.cloud.retail.v2beta.Model.ContextProductsType.MULTIPLE_CONTEXT_PRODUCTS]. + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0; + + // Use only a single product as context for the recommendation. Typically + // used on pages like add-to-cart or product details. + SINGLE_CONTEXT_PRODUCT = 1; + + // Use one or multiple products as context for the recommendation. Typically + // used on shopping cart pages. + MULTIPLE_CONTEXT_PRODUCTS = 2; + } + // Required. The fully qualified resource name of the model. // // Format: @@ -236,4 +271,8 @@ message Model { // PageOptimizationConfig. repeated ServingConfigList serving_config_lists = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Additional model features config. + ModelFeaturesConfig model_features_config = 22 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto index 0d75f6e8805..31e076625f5 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product.proto @@ -103,24 +103,22 @@ message Product { } oneof expiration { - // The timestamp when this product becomes unavailable for - // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search]. - // Note that this is only applicable to - // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] and - // [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION], - // and ignored for - // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]. In - // general, we suggest the users to delete the stale products explicitly, - // instead of using this field to determine staleness. + // Note that this field is applied in the following ways: // - // If it is set, the [Product][google.cloud.retail.v2beta.Product] is not - // available for - // [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search] - // after [expire_time][google.cloud.retail.v2beta.Product.expire_time]. - // However, the product can still be retrieved by - // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] - // and - // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // * If the [Product][google.cloud.retail.v2beta.Product] is already expired + // when it is uploaded, this product + // is not indexed for search. + // + // * If the [Product][google.cloud.retail.v2beta.Product] is not expired + // when it is uploaded, only the + // [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY]'s and + // [Type.COLLECTION][google.cloud.retail.v2beta.Product.Type.COLLECTION]'s + // expireTime is respected, and + // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT]'s + // expireTime is not used. + // + // In general, we suggest the users to delete the stale + // products explicitly, instead of using this field to determine staleness. // // [expire_time][google.cloud.retail.v2beta.Product.expire_time] must be // later than @@ -263,9 +261,10 @@ message Product { // error is returned. // // At most 250 values are allowed per - // [Product][google.cloud.retail.v2beta.Product]. Empty values are not - // allowed. Each value must be a UTF-8 encoded string with a length limit of - // 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. + // [Product][google.cloud.retail.v2beta.Product] unless overridden through the + // Google Cloud console. Empty values are not allowed. Each value must be a + // UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an + // INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [google_product_category][mc_google_product_category]. Schema.org property @@ -287,9 +286,10 @@ message Product { // The brands of the product. // - // A maximum of 30 brands are allowed. Each brand must be a UTF-8 encoded - // string with a length limit of 1,000 characters. Otherwise, an - // INVALID_ARGUMENT error is returned. + // A maximum of 30 brands are allowed unless overridden through the Google + // Cloud console. Each + // brand must be a UTF-8 encoded string with a length limit of 1,000 + // characters. Otherwise, an INVALID_ARGUMENT error is returned. // // Corresponding properties: Google Merchant Center property // [brand](https://support.google.com/merchants/answer/6324351). Schema.org diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto index a569ef378b5..77b59b5d48f 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/product_service.proto @@ -23,6 +23,7 @@ import "google/api/resource.proto"; import "google/cloud/retail/v2beta/common.proto"; import "google/cloud/retail/v2beta/import_config.proto"; import "google/cloud/retail/v2beta/product.proto"; +import "google/cloud/retail/v2beta/purge_config.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -86,6 +87,35 @@ service ProductService { option (google.api.method_signature) = "name"; } + // Permanently deletes all selected + // [Product][google.cloud.retail.v2beta.Product]s under a branch. + // + // This process is asynchronous. If the request is valid, the removal will be + // enqueued and processed offline. Depending on the number of + // [Product][google.cloud.retail.v2beta.Product]s, this operation could take + // hours to complete. Before the operation completes, some + // [Product][google.cloud.retail.v2beta.Product]s may still be returned by + // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] + // or + // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + // + // Depending on the number of [Product][google.cloud.retail.v2beta.Product]s, + // this operation could take hours to complete. To get a sample of + // [Product][google.cloud.retail.v2beta.Product]s that would be deleted, set + // [PurgeProductsRequest.force][google.cloud.retail.v2beta.PurgeProductsRequest.force] + // to false. + rpc PurgeProducts(PurgeProductsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.PurgeProductsResponse" + metadata_type: "google.cloud.retail.v2beta.PurgeProductsMetadata" + }; + } + // Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. // // Request processing may be synchronous. @@ -166,10 +196,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] - // method instead of - // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces]. + // method instead of the + // [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces] + // method. // [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. @@ -208,10 +239,11 @@ service ProductService { }; } - // It is recommended to use the + // We recommend that you use the // [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] - // method instead of - // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. + // method instead of the + // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces] + // method. // [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] // achieves the same results but provides more fine-grained control over // ingesting local inventory data. diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto index 2950797704e..ebd30a2845b 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/promotion.proto @@ -34,7 +34,7 @@ message Promotion { // id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is // returned. // - // Google Merchant Center property - // [promotion](https://support.google.com/merchants/answer/7050148). + // Corresponds to Google Merchant Center property + // [promotion_id](https://support.google.com/merchants/answer/7050148). string promotion_id = 1; } diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto index 5c32819541d..037e3aed589 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/purge_config.proto @@ -18,6 +18,7 @@ package google.cloud.retail.v2beta; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Retail.V2Beta"; option go_package = "cloud.google.com/go/retail/apiv2beta/retailpb;retailpb"; @@ -32,6 +33,96 @@ option ruby_package = "Google::Cloud::Retail::V2beta"; // This will be returned by the google.longrunning.Operation.metadata field. message PurgeMetadata {} +// Metadata related to the progress of the PurgeProducts operation. +// This will be returned by the google.longrunning.Operation.metadata field. +message PurgeProductsMetadata { + // Operation create time. + google.protobuf.Timestamp create_time = 1; + + // Operation last update time. If the operation is done, this is also the + // finish time. + google.protobuf.Timestamp update_time = 2; + + // Count of entries that were deleted successfully. + int64 success_count = 3; + + // Count of entries that encountered errors while processing. + int64 failure_count = 4; +} + +// Request message for PurgeProducts method. +message PurgeProductsRequest { + // Required. The resource name of the branch under which the products are + // created. The format is + // `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "retail.googleapis.com/Branch" } + ]; + + // Required. The filter string to specify the products to be deleted with a + // length limit of 5,000 characters. + // + // Empty string filter is not allowed. "*" implies delete all items in a + // branch. + // + // The eligible fields for filtering are: + // + // * `availability`: Double quoted + // [Product.availability][google.cloud.retail.v2beta.Product.availability] + // string. + // * `create_time` : in ISO 8601 "zulu" format. + // + // Supported syntax: + // + // * Comparators (">", "<", ">=", "<=", "="). + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" + // * availability = "IN_STOCK" + // + // * Conjunctions ("AND") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + // + // * Disjunctions ("OR") + // Examples: + // * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + // + // * Can support nested queries. + // Examples: + // * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + // OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + // + // * Filter Limits: + // * Filter should not contain more than 6 conditions. + // * Max nesting depth should not exceed 2 levels. + // + // Examples queries: + // * Delete back order products created before a timestamp. + // create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Actually perform the purge. + // If `force` is set to false, the method will return the expected purge count + // without deleting any products. + bool force = 3; +} + +// Response of the PurgeProductsRequest. If the long running operation is +// successfully done, then this message is returned by the +// google.longrunning.Operations.response field. +message PurgeProductsResponse { + // The total count of products purged as a result of the operation. + int64 purge_count = 1; + + // A sample of the product names that will be deleted. + // Only populated if `force` is set to false. A max of 100 names will be + // returned and the names are chosen at random. + repeated string purge_sample = 2 [ + (google.api.resource_reference) = { type: "retail.googleapis.com/Product" } + ]; +} + // Request message for PurgeUserEvents method. message PurgeUserEventsRequest { // Required. The resource name of the catalog under which the events are diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto index bd5d6673728..5768df56df2 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/search_service.proto @@ -119,13 +119,13 @@ message SearchRequest { // values. Maximum number of intervals is 40. // // For all numerical facet keys that appear in the list of products from - // the catalog, the percentiles 0, 10, 30, 50, 70, 90 and 100 are + // the catalog, the percentiles 0, 10, 30, 50, 70, 90, and 100 are // computed from their distribution weekly. If the model assigns a high // score to a numerical facet key and its intervals are not specified in - // the search request, these percentiles will become the bounds - // for its intervals and will be returned in the response. If the + // the search request, these percentiles become the bounds + // for its intervals and are returned in the response. If the // facet key intervals are specified in the request, then the specified - // intervals will be returned instead. + // intervals are returned instead. repeated Interval intervals = 2; // Only get facet for the given restricted values. For example, when using @@ -158,14 +158,14 @@ message SearchRequest { // Only get facet values that start with the given string prefix. For // example, suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "prefixes" to "Women", the - // "categories" facet will give only "Women > Shoe" and "Women > Dress". + // "categories" facet gives only "Women > Shoe" and "Women > Dress". // Only supported on textual fields. Maximum is 10. repeated string prefixes = 8; // Only get facet values that contains the given strings. For example, // suppose "categories" has three values "Women > Shoe", // "Women > Dress" and "Men > Shoe". If set "contains" to "Shoe", the - // "categories" facet will give only "Women > Shoe" and "Men > Shoe". + // "categories" facet gives only "Women > Shoe" and "Men > Shoe". // Only supported on textual fields. Maximum is 10. repeated string contains = 9; @@ -198,7 +198,7 @@ message SearchRequest { string order_by = 4; // The query that is used to compute facet for the given facet key. - // When provided, it will override the default behavior of facet + // When provided, it overrides the default behavior of facet // computation. The query syntax is the same as a filter expression. See // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] // for detail syntax and limitations. Notice that there is no limitation @@ -208,9 +208,9 @@ message SearchRequest { // // In the response, // [SearchResponse.Facet.values.value][google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.value] - // will be always "1" and + // is always "1" and // [SearchResponse.Facet.values.count][google.cloud.retail.v2beta.SearchResponse.Facet.FacetValue.count] - // will be the number of results that match the query. + // is the number of results that match the query. // // For example, you can set a customized facet for "shipToStore", // where @@ -218,7 +218,7 @@ message SearchRequest { // is "customizedShipToStore", and // [FacetKey.query][google.cloud.retail.v2beta.SearchRequest.FacetSpec.FacetKey.query] // is "availability: ANY(\"IN_STOCK\") AND shipToStore: ANY(\"123\")". - // Then the facet will count the products that are both in stock and ship + // Then the facet counts the products that are both in stock and ship // to store "123". string query = 5; @@ -269,15 +269,15 @@ message SearchRequest { // Enables dynamic position for this facet. If set to true, the position of // this facet among all facets in the response is determined by Google - // Retail Search. It will be ordered together with dynamic facets if dynamic + // Retail Search. It is ordered together with dynamic facets if dynamic // facets is enabled. If set to false, the position of this facet in the - // response will be the same as in the request, and it will be ranked before + // response is the same as in the request, and it is ranked before // the facets with dynamic position enable and all dynamic facets. // // For example, you may always want to have rating facet returned in // the response, but it's not necessarily to always display the rating facet // at the top. In that case, you can set enable_dynamic_position to true so - // that the position of rating facet in response will be determined by + // that the position of rating facet in response is determined by // Google Retail Search. // // Another example, assuming you have the following facets in the request: @@ -288,13 +288,13 @@ message SearchRequest { // // * "brands", enable_dynamic_position = false // - // And also you have a dynamic facets enable, which will generate a facet - // 'gender'. Then the final order of the facets in the response can be + // And also you have a dynamic facets enable, which generates a facet + // "gender". Then, the final order of the facets in the response can be // ("price", "brands", "rating", "gender") or ("price", "brands", "gender", // "rating") depends on how Google Retail Search orders "gender" and - // "rating" facets. However, notice that "price" and "brands" will always be - // ranked at 1st and 2nd position since their enable_dynamic_position are - // false. + // "rating" facets. However, notice that "price" and "brands" are always + // ranked at first and second position because their enable_dynamic_position + // values are false. bool enable_dynamic_position = 4; } @@ -492,7 +492,7 @@ message SearchRequest { // or the name of the legacy placement resource, such as // `projects/*/locations/global/catalogs/default_catalog/placements/default_search`. // This field is used to identify the serving config name and the set - // of models that will be used to make the search. + // of models that are used to make the search. string placement = 1 [(google.api.field_behavior) = REQUIRED]; // The branch resource name, such as @@ -557,8 +557,8 @@ message SearchRequest { // The filter syntax consists of an expression language for constructing a // predicate from one or more fields of the products being filtered. Filter - // expression is case-sensitive. See more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + // expression is case-sensitive. For more information, see + // [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string filter = 10; @@ -567,21 +567,21 @@ message SearchRequest { // checking any filters on the search page. // // The filter applied to every search request when quality improvement such as - // query expansion is needed. For example, if a query does not have enough - // results, an expanded query with - // [SearchRequest.canonical_filter][google.cloud.retail.v2beta.SearchRequest.canonical_filter] - // will be returned as a supplement of the original query. This field is - // strongly recommended to achieve high search quality. + // query expansion is needed. In the case a query does not have a sufficient + // amount of results this filter will be used to determine whether or not to + // enable the query expansion flow. The original filter will still be used for + // the query expanded search. + // This field is strongly recommended to achieve high search quality. // - // See [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter] - // for more details about filter syntax. + // For more information about filter syntax, see + // [SearchRequest.filter][google.cloud.retail.v2beta.SearchRequest.filter]. string canonical_filter = 28; // The order in which products are returned. Products can be ordered by // a field in an [Product][google.cloud.retail.v2beta.Product] object. Leave - // it unset if ordered by relevance. OrderBy expression is case-sensitive. See - // more details at this [user - // guide](https://cloud.google.com/retail/docs/filter-and-order#order). + // it unset if ordered by relevance. OrderBy expression is case-sensitive. For + // more information, see + // [Order](https://cloud.google.com/retail/docs/filter-and-order#order). // // If this field is unrecognizable, an INVALID_ARGUMENT is returned. string order_by = 11; @@ -599,8 +599,8 @@ message SearchRequest { // textual facets can be dynamically generated. DynamicFacetSpec dynamic_facet_spec = 21 [deprecated = true]; - // Boost specification to boost certain products. See more details at this - // [user guide](https://cloud.google.com/retail/docs/boosting). + // Boost specification to boost certain products. For more information, see + // [Boost results](https://cloud.google.com/retail/docs/boosting). // // Notice that if both // [ServingConfig.boost_control_ids][google.cloud.retail.v2beta.ServingConfig.boost_control_ids] @@ -612,8 +612,8 @@ message SearchRequest { BoostSpec boost_spec = 13; // The query expansion specification that specifies the conditions under which - // query expansion will occur. See more details at this [user - // guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + // query expansion occurs. For more information, see [Query + // expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). QueryExpansionSpec query_expansion_spec = 14; // The keys to fetch and rollup the matching @@ -732,9 +732,9 @@ message SearchRequest { // key with multiple resources. // * Keys must start with a lowercase letter or international character. // - // See [Google Cloud - // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - // for more details. + // For more information, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + // in the Resource Manager documentation. map labels = 34; // The spell correction specification that specifies the mode under @@ -953,7 +953,7 @@ message SearchResponse { repeated ExperimentInfo experiment_info = 17; } -// Metadata for active A/B testing [Experiments][]. +// Metadata for active A/B testing [Experiment][]. message ExperimentInfo { // Metadata for active serving config A/B tests. message ServingConfigExperiment { @@ -966,8 +966,8 @@ message ExperimentInfo { }]; // The fully qualified resource name of the serving config - // [VariantArm.serving_config_id][] responsible for generating the search - // response. For example: + // [Experiment.VariantArm.serving_config_id][] responsible for generating + // the search response. For example: // `projects/*/locations/*/catalogs/*/servingConfigs/*`. string experiment_serving_config = 2 [(google.api.resource_reference) = { type: "retail.googleapis.com/ServingConfig" diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto index ccc70237a30..94d0675d826 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/serving_config.proto @@ -255,6 +255,10 @@ message ServingConfig { // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION]. string enable_category_filter_level = 16; + // When the flag is enabled, the products in the denylist will not be filtered + // out in the recommendation filtering results. + bool ignore_recs_denylist = 24; + // The specification for personalization spec. // // Can only be set if diff --git a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto index e1b52903495..aab2ae31a2d 100644 --- a/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto +++ b/packages/google-cloud-retail/protos/google/cloud/retail/v2beta/user_event.proto @@ -37,6 +37,7 @@ message UserEvent { // Required. User event type. Allowed values are: // // * `add-to-cart`: Products being added to cart. + // * `remove-from-cart`: Products being removed from cart. // * `category-page-view`: Special pages such as sale or promotion pages // viewed. // * `detail-page-view`: Products detail page viewed. @@ -272,8 +273,8 @@ message UserEvent { // The entity for customers that may run multiple different entities, domains, // sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, // `google.com`, `youtube.com`, etc. - // It is recommended to set this field to get better per-entity search, - // completion and prediction results. + // We recommend that you set this field to get better per-entity search, + // completion, and prediction results. string entity = 23; } diff --git a/packages/google-cloud-retail/protos/protos.d.ts b/packages/google-cloud-retail/protos/protos.d.ts index 370a06e7b34..f8253737150 100644 --- a/packages/google-cloud-retail/protos/protos.d.ts +++ b/packages/google-cloud-retail/protos/protos.d.ts @@ -1239,6 +1239,9 @@ export namespace google { /** CatalogAttribute retrievableOption */ retrievableOption?: (google.cloud.retail.v2.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2.CatalogAttribute.RetrievableOption|null); + + /** CatalogAttribute facetConfig */ + facetConfig?: (google.cloud.retail.v2.CatalogAttribute.IFacetConfig|null); } /** Represents a CatalogAttribute. */ @@ -1274,6 +1277,9 @@ export namespace google { /** CatalogAttribute retrievableOption. */ public retrievableOption: (google.cloud.retail.v2.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2.CatalogAttribute.RetrievableOption); + /** CatalogAttribute facetConfig. */ + public facetConfig?: (google.cloud.retail.v2.CatalogAttribute.IFacetConfig|null); + /** * Creates a new CatalogAttribute instance using the specified properties. * @param [properties] Properties to set @@ -1354,6 +1360,542 @@ export namespace google { namespace CatalogAttribute { + /** Properties of a FacetConfig. */ + interface IFacetConfig { + + /** FacetConfig facetIntervals */ + facetIntervals?: (google.cloud.retail.v2.IInterval[]|null); + + /** FacetConfig ignoredFacetValues */ + ignoredFacetValues?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]|null); + + /** FacetConfig mergedFacetValues */ + mergedFacetValues?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue[]|null); + + /** FacetConfig mergedFacet */ + mergedFacet?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig */ + rerankConfig?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig|null); + } + + /** Represents a FacetConfig. */ + class FacetConfig implements IFacetConfig { + + /** + * Constructs a new FacetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.CatalogAttribute.IFacetConfig); + + /** FacetConfig facetIntervals. */ + public facetIntervals: google.cloud.retail.v2.IInterval[]; + + /** FacetConfig ignoredFacetValues. */ + public ignoredFacetValues: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]; + + /** FacetConfig mergedFacetValues. */ + public mergedFacetValues: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue[]; + + /** FacetConfig mergedFacet. */ + public mergedFacet?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig. */ + public rerankConfig?: (google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig|null); + + /** + * Creates a new FacetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetConfig instance + */ + public static create(properties?: google.cloud.retail.v2.CatalogAttribute.IFacetConfig): google.cloud.retail.v2.CatalogAttribute.FacetConfig; + + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.CatalogAttribute.FacetConfig; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.CatalogAttribute.FacetConfig; + + /** + * Verifies a FacetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CatalogAttribute.FacetConfig; + + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @param message FacetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FacetConfig { + + /** Properties of an IgnoredFacetValues. */ + interface IIgnoredFacetValues { + + /** IgnoredFacetValues values */ + values?: (string[]|null); + + /** IgnoredFacetValues startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an IgnoredFacetValues. */ + class IgnoredFacetValues implements IIgnoredFacetValues { + + /** + * Constructs a new IgnoredFacetValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues); + + /** IgnoredFacetValues values. */ + public values: string[]; + + /** IgnoredFacetValues startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoredFacetValues instance + */ + public static create(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues): google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Verifies an IgnoredFacetValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoredFacetValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @param message IgnoredFacetValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IgnoredFacetValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IgnoredFacetValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacetValue. */ + interface IMergedFacetValue { + + /** MergedFacetValue values */ + values?: (string[]|null); + + /** MergedFacetValue mergedValue */ + mergedValue?: (string|null); + } + + /** Represents a MergedFacetValue. */ + class MergedFacetValue implements IMergedFacetValue { + + /** + * Constructs a new MergedFacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue); + + /** MergedFacetValue values. */ + public values: string[]; + + /** MergedFacetValue mergedValue. */ + public mergedValue: string; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacetValue instance + */ + public static create(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Verifies a MergedFacetValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @param message MergedFacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacetValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacet. */ + interface IMergedFacet { + + /** MergedFacet mergedFacetKey */ + mergedFacetKey?: (string|null); + } + + /** Represents a MergedFacet. */ + class MergedFacet implements IMergedFacet { + + /** + * Constructs a new MergedFacet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet); + + /** MergedFacet mergedFacetKey. */ + public mergedFacetKey: string; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacet instance + */ + public static create(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Verifies a MergedFacet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @param message MergedFacet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RerankConfig. */ + interface IRerankConfig { + + /** RerankConfig rerankFacet */ + rerankFacet?: (boolean|null); + + /** RerankConfig facetValues */ + facetValues?: (string[]|null); + } + + /** Represents a RerankConfig. */ + class RerankConfig implements IRerankConfig { + + /** + * Constructs a new RerankConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig); + + /** RerankConfig rerankFacet. */ + public rerankFacet: boolean; + + /** RerankConfig facetValues. */ + public facetValues: string[]; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RerankConfig instance + */ + public static create(properties?: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig): google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Verifies a RerankConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RerankConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @param message RerankConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RerankConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RerankConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** AttributeType enum. */ enum AttributeType { UNKNOWN = 0, @@ -1808,6 +2350,9 @@ export namespace google { /** Condition activeTimeRange */ activeTimeRange?: (google.cloud.retail.v2.Condition.ITimeRange[]|null); + + /** Condition pageCategories */ + pageCategories?: (string[]|null); } /** Represents a Condition. */ @@ -1825,6 +2370,9 @@ export namespace google { /** Condition activeTimeRange. */ public activeTimeRange: google.cloud.retail.v2.Condition.ITimeRange[]; + /** Condition pageCategories. */ + public pageCategories: string[]; + /** * Creates a new Condition instance using the specified properties. * @param [properties] Properties to set @@ -2139,6 +2687,12 @@ export namespace google { /** Rule twowaySynonymsAction */ twowaySynonymsAction?: (google.cloud.retail.v2.Rule.ITwowaySynonymsAction|null); + /** Rule forceReturnFacetAction */ + forceReturnFacetAction?: (google.cloud.retail.v2.Rule.IForceReturnFacetAction|null); + + /** Rule removeFacetAction */ + removeFacetAction?: (google.cloud.retail.v2.Rule.IRemoveFacetAction|null); + /** Rule condition */ condition?: (google.cloud.retail.v2.ICondition|null); } @@ -2176,11 +2730,17 @@ export namespace google { /** Rule twowaySynonymsAction. */ public twowaySynonymsAction?: (google.cloud.retail.v2.Rule.ITwowaySynonymsAction|null); + /** Rule forceReturnFacetAction. */ + public forceReturnFacetAction?: (google.cloud.retail.v2.Rule.IForceReturnFacetAction|null); + + /** Rule removeFacetAction. */ + public removeFacetAction?: (google.cloud.retail.v2.Rule.IRemoveFacetAction|null); + /** Rule condition. */ public condition?: (google.cloud.retail.v2.ICondition|null); /** Rule action. */ - public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"); /** * Creates a new Rule instance using the specified properties. @@ -3079,6 +3639,306 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a ForceReturnFacetAction. */ + interface IForceReturnFacetAction { + + /** ForceReturnFacetAction facetPositionAdjustments */ + facetPositionAdjustments?: (google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]|null); + } + + /** Represents a ForceReturnFacetAction. */ + class ForceReturnFacetAction implements IForceReturnFacetAction { + + /** + * Constructs a new ForceReturnFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.Rule.IForceReturnFacetAction); + + /** ForceReturnFacetAction facetPositionAdjustments. */ + public facetPositionAdjustments: google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]; + + /** + * Creates a new ForceReturnFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceReturnFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2.Rule.IForceReturnFacetAction): google.cloud.retail.v2.Rule.ForceReturnFacetAction; + + /** + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Rule.ForceReturnFacetAction; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Rule.ForceReturnFacetAction; + + /** + * Verifies a ForceReturnFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceReturnFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Rule.ForceReturnFacetAction; + + /** + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. + * @param message ForceReturnFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Rule.ForceReturnFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForceReturnFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceReturnFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ForceReturnFacetAction { + + /** Properties of a FacetPositionAdjustment. */ + interface IFacetPositionAdjustment { + + /** FacetPositionAdjustment attributeName */ + attributeName?: (string|null); + + /** FacetPositionAdjustment position */ + position?: (number|null); + } + + /** Represents a FacetPositionAdjustment. */ + class FacetPositionAdjustment implements IFacetPositionAdjustment { + + /** + * Constructs a new FacetPositionAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment); + + /** FacetPositionAdjustment attributeName. */ + public attributeName: string; + + /** FacetPositionAdjustment position. */ + public position: number; + + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetPositionAdjustment instance + */ + public static create(properties?: google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment): google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Verifies a FacetPositionAdjustment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetPositionAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @param message FacetPositionAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetPositionAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetPositionAdjustment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RemoveFacetAction. */ + interface IRemoveFacetAction { + + /** RemoveFacetAction attributeNames */ + attributeNames?: (string[]|null); + } + + /** Represents a RemoveFacetAction. */ + class RemoveFacetAction implements IRemoveFacetAction { + + /** + * Constructs a new RemoveFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.Rule.IRemoveFacetAction); + + /** RemoveFacetAction attributeNames. */ + public attributeNames: string[]; + + /** + * Creates a new RemoveFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2.Rule.IRemoveFacetAction): google.cloud.retail.v2.Rule.RemoveFacetAction; + + /** + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Rule.RemoveFacetAction; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Rule.RemoveFacetAction; + + /** + * Verifies a RemoveFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Rule.RemoveFacetAction; + + /** + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. + * @param message RemoveFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Rule.RemoveFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an Audience. */ @@ -8731,6 +9591,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions */ maxSuggestions?: (number|null); + /** CompleteQueryRequest enableAttributeSuggestions */ + enableAttributeSuggestions?: (boolean|null); + /** CompleteQueryRequest entity */ entity?: (string|null); } @@ -8765,6 +9628,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions. */ public maxSuggestions: number; + /** CompleteQueryRequest enableAttributeSuggestions. */ + public enableAttributeSuggestions: boolean; + /** CompleteQueryRequest entity. */ public entity: string; @@ -10085,6 +10951,9 @@ export namespace google { /** Model servingConfigLists */ servingConfigLists?: (google.cloud.retail.v2.Model.IServingConfigList[]|null); + + /** Model modelFeaturesConfig */ + modelFeaturesConfig?: (google.cloud.retail.v2.Model.IModelFeaturesConfig|null); } /** Represents a Model. */ @@ -10138,6 +11007,9 @@ export namespace google { /** Model servingConfigLists. */ public servingConfigLists: google.cloud.retail.v2.Model.IServingConfigList[]; + /** Model modelFeaturesConfig. */ + public modelFeaturesConfig?: (google.cloud.retail.v2.Model.IModelFeaturesConfig|null); + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -10315,6 +11187,203 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a FrequentlyBoughtTogetherFeaturesConfig. */ + interface IFrequentlyBoughtTogetherFeaturesConfig { + + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType */ + contextProductsType?: (google.cloud.retail.v2.Model.ContextProductsType|keyof typeof google.cloud.retail.v2.Model.ContextProductsType|null); + } + + /** Represents a FrequentlyBoughtTogetherFeaturesConfig. */ + class FrequentlyBoughtTogetherFeaturesConfig implements IFrequentlyBoughtTogetherFeaturesConfig { + + /** + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig); + + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType. */ + public contextProductsType: (google.cloud.retail.v2.Model.ContextProductsType|keyof typeof google.cloud.retail.v2.Model.ContextProductsType); + + /** + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FrequentlyBoughtTogetherFeaturesConfig instance + */ + public static create(properties?: google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig): google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FrequentlyBoughtTogetherFeaturesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @param message FrequentlyBoughtTogetherFeaturesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelFeaturesConfig. */ + interface IModelFeaturesConfig { + + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig */ + frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); + } + + /** Represents a ModelFeaturesConfig. */ + class ModelFeaturesConfig implements IModelFeaturesConfig { + + /** + * Constructs a new ModelFeaturesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.Model.IModelFeaturesConfig); + + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig. */ + public frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); + + /** ModelFeaturesConfig typeDedicatedConfig. */ + public typeDedicatedConfig?: "frequentlyBoughtTogetherConfig"; + + /** + * Creates a new ModelFeaturesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelFeaturesConfig instance + */ + public static create(properties?: google.cloud.retail.v2.Model.IModelFeaturesConfig): google.cloud.retail.v2.Model.ModelFeaturesConfig; + + /** + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Model.ModelFeaturesConfig; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Model.ModelFeaturesConfig; + + /** + * Verifies a ModelFeaturesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelFeaturesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Model.ModelFeaturesConfig; + + /** + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. + * @param message ModelFeaturesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.Model.ModelFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelFeaturesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelFeaturesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** ServingState enum. */ enum ServingState { SERVING_STATE_UNSPECIFIED = 0, @@ -10344,6 +11413,13 @@ export namespace google { DATA_OK = 1, DATA_ERROR = 2 } + + /** ContextProductsType enum. */ + enum ContextProductsType { + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0, + SINGLE_CONTEXT_PRODUCT = 1, + MULTIPLE_CONTEXT_PRODUCTS = 2 + } } /** Represents a ModelService */ @@ -12227,6 +13303,20 @@ export namespace google { */ public deleteProduct(request: google.cloud.retail.v2.IDeleteProductRequest): Promise; + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public purgeProducts(request: google.cloud.retail.v2.IPurgeProductsRequest, callback: google.cloud.retail.v2.ProductService.PurgeProductsCallback): void; + + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @returns Promise + */ + public purgeProducts(request: google.cloud.retail.v2.IPurgeProductsRequest): Promise; + /** * Calls ImportProducts. * @param request ImportProductsRequest message or plain object @@ -12349,6 +13439,13 @@ export namespace google { */ type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService|purgeProducts}. + * @param error Error, if any + * @param [response] Operation + */ + type PurgeProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.retail.v2.ProductService|importProducts}. * @param error Error, if any @@ -14622,6 +15719,333 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PurgeProductsMetadata. */ + interface IPurgeProductsMetadata { + + /** PurgeProductsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** PurgeProductsMetadata failureCount */ + failureCount?: (number|Long|string|null); + } + + /** Represents a PurgeProductsMetadata. */ + class PurgeProductsMetadata implements IPurgeProductsMetadata { + + /** + * Constructs a new PurgeProductsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeProductsMetadata); + + /** PurgeProductsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount. */ + public successCount: (number|Long|string); + + /** PurgeProductsMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** + * Creates a new PurgeProductsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsMetadata instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeProductsMetadata): google.cloud.retail.v2.PurgeProductsMetadata; + + /** + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.PurgeProductsMetadata; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.PurgeProductsMetadata; + + /** + * Verifies a PurgeProductsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeProductsMetadata; + + /** + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * @param message PurgeProductsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeProductsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeProductsRequest. */ + interface IPurgeProductsRequest { + + /** PurgeProductsRequest parent */ + parent?: (string|null); + + /** PurgeProductsRequest filter */ + filter?: (string|null); + + /** PurgeProductsRequest force */ + force?: (boolean|null); + } + + /** Represents a PurgeProductsRequest. */ + class PurgeProductsRequest implements IPurgeProductsRequest { + + /** + * Constructs a new PurgeProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeProductsRequest); + + /** PurgeProductsRequest parent. */ + public parent: string; + + /** PurgeProductsRequest filter. */ + public filter: string; + + /** PurgeProductsRequest force. */ + public force: boolean; + + /** + * Creates a new PurgeProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsRequest instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeProductsRequest): google.cloud.retail.v2.PurgeProductsRequest; + + /** + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.PurgeProductsRequest; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.PurgeProductsRequest; + + /** + * Verifies a PurgeProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeProductsRequest; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @param message PurgeProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeProductsResponse. */ + interface IPurgeProductsResponse { + + /** PurgeProductsResponse purgeCount */ + purgeCount?: (number|Long|string|null); + + /** PurgeProductsResponse purgeSample */ + purgeSample?: (string[]|null); + } + + /** Represents a PurgeProductsResponse. */ + class PurgeProductsResponse implements IPurgeProductsResponse { + + /** + * Constructs a new PurgeProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2.IPurgeProductsResponse); + + /** PurgeProductsResponse purgeCount. */ + public purgeCount: (number|Long|string); + + /** PurgeProductsResponse purgeSample. */ + public purgeSample: string[]; + + /** + * Creates a new PurgeProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsResponse instance + */ + public static create(properties?: google.cloud.retail.v2.IPurgeProductsResponse): google.cloud.retail.v2.PurgeProductsResponse; + + /** + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.PurgeProductsResponse; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.PurgeProductsResponse; + + /** + * Verifies a PurgeProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.PurgeProductsResponse; + + /** + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * @param message PurgeProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2.PurgeProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PurgeUserEventsRequest. */ interface IPurgeUserEventsRequest { @@ -16910,6 +18334,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel */ enableCategoryFilterLevel?: (string|null); + /** ServingConfig ignoreRecsDenylist */ + ignoreRecsDenylist?: (boolean|null); + /** ServingConfig personalizationSpec */ personalizationSpec?: (google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null); @@ -16977,6 +18404,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel. */ public enableCategoryFilterLevel: string; + /** ServingConfig ignoreRecsDenylist. */ + public ignoreRecsDenylist: boolean; + /** ServingConfig personalizationSpec. */ public personalizationSpec?: (google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null); @@ -20041,591 +21471,5153 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ProductLevelConfig. */ - interface IProductLevelConfig { + /** BranchView enum. */ + enum BranchView { + BRANCH_VIEW_UNSPECIFIED = 0, + BRANCH_VIEW_BASIC = 1, + BRANCH_VIEW_FULL = 2 + } - /** ProductLevelConfig ingestionProductType */ - ingestionProductType?: (string|null); + /** Properties of a Branch. */ + interface IBranch { - /** ProductLevelConfig merchantCenterProductIdField */ - merchantCenterProductIdField?: (string|null); + /** Branch name */ + name?: (string|null); + + /** Branch displayName */ + displayName?: (string|null); + + /** Branch isDefault */ + isDefault?: (boolean|null); + + /** Branch lastProductImportTime */ + lastProductImportTime?: (google.protobuf.ITimestamp|null); + + /** Branch productCountStats */ + productCountStats?: (google.cloud.retail.v2alpha.Branch.IProductCountStatistic[]|null); + + /** Branch qualityMetrics */ + qualityMetrics?: (google.cloud.retail.v2alpha.Branch.IQualityMetric[]|null); } - /** Represents a ProductLevelConfig. */ - class ProductLevelConfig implements IProductLevelConfig { + /** Represents a Branch. */ + class Branch implements IBranch { /** - * Constructs a new ProductLevelConfig. + * Constructs a new Branch. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductLevelConfig); + constructor(properties?: google.cloud.retail.v2alpha.IBranch); - /** ProductLevelConfig ingestionProductType. */ - public ingestionProductType: string; + /** Branch name. */ + public name: string; - /** ProductLevelConfig merchantCenterProductIdField. */ - public merchantCenterProductIdField: string; + /** Branch displayName. */ + public displayName: string; + + /** Branch isDefault. */ + public isDefault: boolean; + + /** Branch lastProductImportTime. */ + public lastProductImportTime?: (google.protobuf.ITimestamp|null); + + /** Branch productCountStats. */ + public productCountStats: google.cloud.retail.v2alpha.Branch.IProductCountStatistic[]; + + /** Branch qualityMetrics. */ + public qualityMetrics: google.cloud.retail.v2alpha.Branch.IQualityMetric[]; /** - * Creates a new ProductLevelConfig instance using the specified properties. + * Creates a new Branch instance using the specified properties. * @param [properties] Properties to set - * @returns ProductLevelConfig instance + * @returns Branch instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductLevelConfig): google.cloud.retail.v2alpha.ProductLevelConfig; + public static create(properties?: google.cloud.retail.v2alpha.IBranch): google.cloud.retail.v2alpha.Branch; /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified Branch message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.verify|verify} messages. + * @param message Branch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IBranch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. - * @param message ProductLevelConfig message or plain object to encode + * Encodes the specified Branch message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.verify|verify} messages. + * @param message Branch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBranch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. + * Decodes a Branch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductLevelConfig + * @returns Branch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductLevelConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Branch; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * Decodes a Branch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductLevelConfig + * @returns Branch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductLevelConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Branch; /** - * Verifies a ProductLevelConfig message. + * Verifies a Branch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Branch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductLevelConfig + * @returns Branch */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductLevelConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Branch; /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. - * @param message ProductLevelConfig + * Creates a plain object from a Branch message. Also converts values to other types if specified. + * @param message Branch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Branch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductLevelConfig to JSON. + * Converts this Branch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ProductLevelConfig + * Gets the default type url for Branch * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CatalogAttribute. */ - interface ICatalogAttribute { + namespace Branch { - /** CatalogAttribute key */ - key?: (string|null); + /** Properties of a ProductCountStatistic. */ + interface IProductCountStatistic { - /** CatalogAttribute inUse */ - inUse?: (boolean|null); + /** ProductCountStatistic scope */ + scope?: (google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope|keyof typeof google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope|null); - /** CatalogAttribute type */ - type?: (google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|null); + /** ProductCountStatistic counts */ + counts?: ({ [k: string]: (number|Long|string) }|null); + } - /** CatalogAttribute indexableOption */ - indexableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|null); + /** Represents a ProductCountStatistic. */ + class ProductCountStatistic implements IProductCountStatistic { - /** CatalogAttribute dynamicFacetableOption */ - dynamicFacetableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|null); + /** + * Constructs a new ProductCountStatistic. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Branch.IProductCountStatistic); - /** CatalogAttribute searchableOption */ - searchableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|null); + /** ProductCountStatistic scope. */ + public scope: (google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope|keyof typeof google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope); - /** CatalogAttribute recommendationsFilteringOption */ - recommendationsFilteringOption?: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption|null); + /** ProductCountStatistic counts. */ + public counts: { [k: string]: (number|Long|string) }; - /** CatalogAttribute exactSearchableOption */ - exactSearchableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null); + /** + * Creates a new ProductCountStatistic instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductCountStatistic instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Branch.IProductCountStatistic): google.cloud.retail.v2alpha.Branch.ProductCountStatistic; - /** CatalogAttribute retrievableOption */ - retrievableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null); + /** + * Encodes the specified ProductCountStatistic message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.ProductCountStatistic.verify|verify} messages. + * @param message ProductCountStatistic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Branch.IProductCountStatistic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductCountStatistic message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.ProductCountStatistic.verify|verify} messages. + * @param message ProductCountStatistic message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Branch.IProductCountStatistic, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductCountStatistic message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductCountStatistic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Branch.ProductCountStatistic; + + /** + * Decodes a ProductCountStatistic message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductCountStatistic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Branch.ProductCountStatistic; + + /** + * Verifies a ProductCountStatistic message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductCountStatistic message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductCountStatistic + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Branch.ProductCountStatistic; + + /** + * Creates a plain object from a ProductCountStatistic message. Also converts values to other types if specified. + * @param message ProductCountStatistic + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Branch.ProductCountStatistic, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductCountStatistic to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProductCountStatistic + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProductCountStatistic { + + /** ProductCountScope enum. */ + enum ProductCountScope { + PRODUCT_COUNT_SCOPE_UNSPECIFIED = 0, + ALL_PRODUCTS = 1, + LAST_24_HOUR_UPDATE = 2 + } + } + + /** Properties of a QualityMetric. */ + interface IQualityMetric { + + /** QualityMetric requirementKey */ + requirementKey?: (string|null); + + /** QualityMetric qualifiedProductCount */ + qualifiedProductCount?: (number|null); + + /** QualityMetric unqualifiedProductCount */ + unqualifiedProductCount?: (number|null); + + /** QualityMetric suggestedQualityPercentThreshold */ + suggestedQualityPercentThreshold?: (number|null); + + /** QualityMetric unqualifiedSampleProducts */ + unqualifiedSampleProducts?: (google.cloud.retail.v2alpha.IProduct[]|null); + } + + /** Represents a QualityMetric. */ + class QualityMetric implements IQualityMetric { + + /** + * Constructs a new QualityMetric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Branch.IQualityMetric); + + /** QualityMetric requirementKey. */ + public requirementKey: string; + + /** QualityMetric qualifiedProductCount. */ + public qualifiedProductCount: number; + + /** QualityMetric unqualifiedProductCount. */ + public unqualifiedProductCount: number; + + /** QualityMetric suggestedQualityPercentThreshold. */ + public suggestedQualityPercentThreshold: number; + + /** QualityMetric unqualifiedSampleProducts. */ + public unqualifiedSampleProducts: google.cloud.retail.v2alpha.IProduct[]; + + /** + * Creates a new QualityMetric instance using the specified properties. + * @param [properties] Properties to set + * @returns QualityMetric instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Branch.IQualityMetric): google.cloud.retail.v2alpha.Branch.QualityMetric; + + /** + * Encodes the specified QualityMetric message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.QualityMetric.verify|verify} messages. + * @param message QualityMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Branch.IQualityMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QualityMetric message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.QualityMetric.verify|verify} messages. + * @param message QualityMetric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Branch.IQualityMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QualityMetric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QualityMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Branch.QualityMetric; + + /** + * Decodes a QualityMetric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QualityMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Branch.QualityMetric; + + /** + * Verifies a QualityMetric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QualityMetric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QualityMetric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Branch.QualityMetric; + + /** + * Creates a plain object from a QualityMetric message. Also converts values to other types if specified. + * @param message QualityMetric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Branch.QualityMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QualityMetric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QualityMetric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a CatalogAttribute. */ - class CatalogAttribute implements ICatalogAttribute { + /** Properties of a Product. */ + interface IProduct { + + /** Product expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Product ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** Product name */ + name?: (string|null); + + /** Product id */ + id?: (string|null); + + /** Product type */ + type?: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type|null); + + /** Product primaryProductId */ + primaryProductId?: (string|null); + + /** Product collectionMemberIds */ + collectionMemberIds?: (string[]|null); + + /** Product gtin */ + gtin?: (string|null); + + /** Product categories */ + categories?: (string[]|null); + + /** Product title */ + title?: (string|null); + + /** Product brands */ + brands?: (string[]|null); + + /** Product description */ + description?: (string|null); + + /** Product languageCode */ + languageCode?: (string|null); + + /** Product attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + + /** Product tags */ + tags?: (string[]|null); + + /** Product priceInfo */ + priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + + /** Product rating */ + rating?: (google.cloud.retail.v2alpha.IRating|null); + + /** Product availableTime */ + availableTime?: (google.protobuf.ITimestamp|null); + + /** Product availability */ + availability?: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability|null); + + /** Product availableQuantity */ + availableQuantity?: (google.protobuf.IInt32Value|null); + + /** Product fulfillmentInfo */ + fulfillmentInfo?: (google.cloud.retail.v2alpha.IFulfillmentInfo[]|null); + + /** Product uri */ + uri?: (string|null); + + /** Product images */ + images?: (google.cloud.retail.v2alpha.IImage[]|null); + + /** Product audience */ + audience?: (google.cloud.retail.v2alpha.IAudience|null); + + /** Product colorInfo */ + colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); + + /** Product sizes */ + sizes?: (string[]|null); + + /** Product materials */ + materials?: (string[]|null); + + /** Product patterns */ + patterns?: (string[]|null); + + /** Product conditions */ + conditions?: (string[]|null); + + /** Product promotions */ + promotions?: (google.cloud.retail.v2alpha.IPromotion[]|null); + + /** Product publishTime */ + publishTime?: (google.protobuf.ITimestamp|null); + + /** Product retrievableFields */ + retrievableFields?: (google.protobuf.IFieldMask|null); + + /** Product variants */ + variants?: (google.cloud.retail.v2alpha.IProduct[]|null); + + /** Product localInventories */ + localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); + } + + /** Represents a Product. */ + class Product implements IProduct { /** - * Constructs a new CatalogAttribute. + * Constructs a new Product. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICatalogAttribute); + constructor(properties?: google.cloud.retail.v2alpha.IProduct); - /** CatalogAttribute key. */ - public key: string; + /** Product expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); - /** CatalogAttribute inUse. */ - public inUse: boolean; + /** Product ttl. */ + public ttl?: (google.protobuf.IDuration|null); - /** CatalogAttribute type. */ - public type: (google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.AttributeType); + /** Product name. */ + public name: string; - /** CatalogAttribute indexableOption. */ - public indexableOption: (google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption); + /** Product id. */ + public id: string; - /** CatalogAttribute dynamicFacetableOption. */ - public dynamicFacetableOption: (google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption); + /** Product type. */ + public type: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type); - /** CatalogAttribute searchableOption. */ - public searchableOption: (google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption); + /** Product primaryProductId. */ + public primaryProductId: string; - /** CatalogAttribute recommendationsFilteringOption. */ - public recommendationsFilteringOption: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption); + /** Product collectionMemberIds. */ + public collectionMemberIds: string[]; - /** CatalogAttribute exactSearchableOption. */ - public exactSearchableOption: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption); + /** Product gtin. */ + public gtin: string; - /** CatalogAttribute retrievableOption. */ - public retrievableOption: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption); + /** Product categories. */ + public categories: string[]; + + /** Product title. */ + public title: string; + + /** Product brands. */ + public brands: string[]; + + /** Product description. */ + public description: string; + + /** Product languageCode. */ + public languageCode: string; + + /** Product attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + + /** Product tags. */ + public tags: string[]; + + /** Product priceInfo. */ + public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + + /** Product rating. */ + public rating?: (google.cloud.retail.v2alpha.IRating|null); + + /** Product availableTime. */ + public availableTime?: (google.protobuf.ITimestamp|null); + + /** Product availability. */ + public availability: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability); + + /** Product availableQuantity. */ + public availableQuantity?: (google.protobuf.IInt32Value|null); + + /** Product fulfillmentInfo. */ + public fulfillmentInfo: google.cloud.retail.v2alpha.IFulfillmentInfo[]; + + /** Product uri. */ + public uri: string; + + /** Product images. */ + public images: google.cloud.retail.v2alpha.IImage[]; + + /** Product audience. */ + public audience?: (google.cloud.retail.v2alpha.IAudience|null); + + /** Product colorInfo. */ + public colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); + + /** Product sizes. */ + public sizes: string[]; + + /** Product materials. */ + public materials: string[]; + + /** Product patterns. */ + public patterns: string[]; + + /** Product conditions. */ + public conditions: string[]; + + /** Product promotions. */ + public promotions: google.cloud.retail.v2alpha.IPromotion[]; + + /** Product publishTime. */ + public publishTime?: (google.protobuf.ITimestamp|null); + + /** Product retrievableFields. */ + public retrievableFields?: (google.protobuf.IFieldMask|null); + + /** Product variants. */ + public variants: google.cloud.retail.v2alpha.IProduct[]; + + /** Product localInventories. */ + public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; + + /** Product expiration. */ + public expiration?: ("expireTime"|"ttl"); /** - * Creates a new CatalogAttribute instance using the specified properties. + * Creates a new Product instance using the specified properties. * @param [properties] Properties to set - * @returns CatalogAttribute instance + * @returns Product instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICatalogAttribute): google.cloud.retail.v2alpha.CatalogAttribute; + public static create(properties?: google.cloud.retail.v2alpha.IProduct): google.cloud.retail.v2alpha.Product; /** - * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. - * @param message CatalogAttribute message or plain object to encode + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. - * @param message CatalogAttribute message or plain object to encode + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CatalogAttribute message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CatalogAttribute + * @returns Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Product; /** - * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CatalogAttribute + * @returns Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Product; /** - * Verifies a CatalogAttribute message. + * Verifies a Product message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CatalogAttribute + * @returns Product */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Product; /** - * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. - * @param message CatalogAttribute + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CatalogAttribute to JSON. + * Converts this Product to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CatalogAttribute + * Gets the default type url for Product * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CatalogAttribute { + namespace Product { - /** AttributeType enum. */ - enum AttributeType { - UNKNOWN = 0, - TEXTUAL = 1, - NUMERICAL = 2 + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRIMARY = 1, + VARIANT = 2, + COLLECTION = 3 } - /** IndexableOption enum. */ - enum IndexableOption { - INDEXABLE_OPTION_UNSPECIFIED = 0, - INDEXABLE_ENABLED = 1, - INDEXABLE_DISABLED = 2 + /** Availability enum. */ + enum Availability { + AVAILABILITY_UNSPECIFIED = 0, + IN_STOCK = 1, + OUT_OF_STOCK = 2, + PREORDER = 3, + BACKORDER = 4 } + } - /** DynamicFacetableOption enum. */ - enum DynamicFacetableOption { - DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0, - DYNAMIC_FACETABLE_ENABLED = 1, - DYNAMIC_FACETABLE_DISABLED = 2 - } + /** AttributeConfigLevel enum. */ + enum AttributeConfigLevel { + ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0, + PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1, + CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2 + } - /** SearchableOption enum. */ - enum SearchableOption { - SEARCHABLE_OPTION_UNSPECIFIED = 0, - SEARCHABLE_ENABLED = 1, - SEARCHABLE_DISABLED = 2 - } + /** SolutionType enum. */ + enum SolutionType { + SOLUTION_TYPE_UNSPECIFIED = 0, + SOLUTION_TYPE_RECOMMENDATION = 1, + SOLUTION_TYPE_SEARCH = 2 + } - /** ExactSearchableOption enum. */ - enum ExactSearchableOption { - EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0, - EXACT_SEARCHABLE_ENABLED = 1, - EXACT_SEARCHABLE_DISABLED = 2 - } + /** RecommendationsFilteringOption enum. */ + enum RecommendationsFilteringOption { + RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0, + RECOMMENDATIONS_FILTERING_DISABLED = 1, + RECOMMENDATIONS_FILTERING_ENABLED = 3 + } - /** RetrievableOption enum. */ - enum RetrievableOption { - RETRIEVABLE_OPTION_UNSPECIFIED = 0, - RETRIEVABLE_ENABLED = 1, - RETRIEVABLE_DISABLED = 2 - } + /** SearchSolutionUseCase enum. */ + enum SearchSolutionUseCase { + SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0, + SEARCH_SOLUTION_USE_CASE_SEARCH = 1, + SEARCH_SOLUTION_USE_CASE_BROWSE = 2 } - /** Properties of an AttributesConfig. */ - interface IAttributesConfig { + /** Properties of a Condition. */ + interface ICondition { - /** AttributesConfig name */ - name?: (string|null); + /** Condition queryTerms */ + queryTerms?: (google.cloud.retail.v2alpha.Condition.IQueryTerm[]|null); - /** AttributesConfig catalogAttributes */ - catalogAttributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICatalogAttribute }|null); + /** Condition activeTimeRange */ + activeTimeRange?: (google.cloud.retail.v2alpha.Condition.ITimeRange[]|null); - /** AttributesConfig attributeConfigLevel */ - attributeConfigLevel?: (google.cloud.retail.v2alpha.AttributeConfigLevel|keyof typeof google.cloud.retail.v2alpha.AttributeConfigLevel|null); + /** Condition pageCategories */ + pageCategories?: (string[]|null); } - /** Represents an AttributesConfig. */ - class AttributesConfig implements IAttributesConfig { + /** Represents a Condition. */ + class Condition implements ICondition { /** - * Constructs a new AttributesConfig. + * Constructs a new Condition. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAttributesConfig); + constructor(properties?: google.cloud.retail.v2alpha.ICondition); - /** AttributesConfig name. */ - public name: string; + /** Condition queryTerms. */ + public queryTerms: google.cloud.retail.v2alpha.Condition.IQueryTerm[]; - /** AttributesConfig catalogAttributes. */ - public catalogAttributes: { [k: string]: google.cloud.retail.v2alpha.ICatalogAttribute }; + /** Condition activeTimeRange. */ + public activeTimeRange: google.cloud.retail.v2alpha.Condition.ITimeRange[]; - /** AttributesConfig attributeConfigLevel. */ - public attributeConfigLevel: (google.cloud.retail.v2alpha.AttributeConfigLevel|keyof typeof google.cloud.retail.v2alpha.AttributeConfigLevel); + /** Condition pageCategories. */ + public pageCategories: string[]; /** - * Creates a new AttributesConfig instance using the specified properties. + * Creates a new Condition instance using the specified properties. * @param [properties] Properties to set - * @returns AttributesConfig instance + * @returns Condition instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAttributesConfig): google.cloud.retail.v2alpha.AttributesConfig; + public static create(properties?: google.cloud.retail.v2alpha.ICondition): google.cloud.retail.v2alpha.Condition; /** - * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. - * @param message AttributesConfig message or plain object to encode + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. - * @param message AttributesConfig message or plain object to encode + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AttributesConfig message from the specified reader or buffer. + * Decodes a Condition message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AttributesConfig + * @returns Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AttributesConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Condition; /** - * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. + * Decodes a Condition message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AttributesConfig + * @returns Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AttributesConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Condition; /** - * Verifies an AttributesConfig message. + * Verifies a Condition message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Condition message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AttributesConfig + * @returns Condition */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AttributesConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition; /** - * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. - * @param message AttributesConfig + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AttributesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AttributesConfig to JSON. + * Converts this Condition to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AttributesConfig + * Gets the default type url for Condition * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CompletionConfig. */ - interface ICompletionConfig { + namespace Condition { - /** CompletionConfig name */ - name?: (string|null); + /** Properties of a QueryTerm. */ + interface IQueryTerm { - /** CompletionConfig matchingOrder */ - matchingOrder?: (string|null); + /** QueryTerm value */ + value?: (string|null); - /** CompletionConfig maxSuggestions */ - maxSuggestions?: (number|null); + /** QueryTerm fullMatch */ + fullMatch?: (boolean|null); + } - /** CompletionConfig minPrefixLength */ - minPrefixLength?: (number|null); + /** Represents a QueryTerm. */ + class QueryTerm implements IQueryTerm { - /** CompletionConfig autoLearning */ - autoLearning?: (boolean|null); + /** + * Constructs a new QueryTerm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm); - /** CompletionConfig suggestionsInputConfig */ - suggestionsInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** QueryTerm value. */ + public value: string; - /** CompletionConfig lastSuggestionsImportOperation */ - lastSuggestionsImportOperation?: (string|null); + /** QueryTerm fullMatch. */ + public fullMatch: boolean; - /** CompletionConfig denylistInputConfig */ - denylistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** + * Creates a new QueryTerm instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryTerm instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm): google.cloud.retail.v2alpha.Condition.QueryTerm; - /** CompletionConfig lastDenylistImportOperation */ - lastDenylistImportOperation?: (string|null); + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; - /** CompletionConfig allowlistInputConfig */ - allowlistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @param message QueryTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; - /** CompletionConfig lastAllowlistImportOperation */ - lastAllowlistImportOperation?: (string|null); + /** + * Decodes a QueryTerm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Condition.QueryTerm; + + /** + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Condition.QueryTerm; + + /** + * Verifies a QueryTerm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryTerm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.QueryTerm; + + /** + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * @param message QueryTerm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryTerm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryTerm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeRange. */ + interface ITimeRange { + + /** TimeRange startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeRange. */ + class TimeRange implements ITimeRange { + + /** + * Constructs a new TimeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange); + + /** TimeRange startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeRange endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeRange instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @param message TimeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Verifies a TimeRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.TimeRange; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @param message TimeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a CompletionConfig. */ - class CompletionConfig implements ICompletionConfig { + /** Properties of a Rule. */ + interface IRule { + + /** Rule boostAction */ + boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); + + /** Rule redirectAction */ + redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); + + /** Rule onewaySynonymsAction */ + onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + + /** Rule doNotAssociateAction */ + doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + + /** Rule replacementAction */ + replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + + /** Rule ignoreAction */ + ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + + /** Rule filterAction */ + filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + + /** Rule twowaySynonymsAction */ + twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + + /** Rule forceReturnFacetAction */ + forceReturnFacetAction?: (google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction|null); + + /** Rule removeFacetAction */ + removeFacetAction?: (google.cloud.retail.v2alpha.Rule.IRemoveFacetAction|null); + + /** Rule condition */ + condition?: (google.cloud.retail.v2alpha.ICondition|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { /** - * Constructs a new CompletionConfig. + * Constructs a new Rule. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompletionConfig); + constructor(properties?: google.cloud.retail.v2alpha.IRule); - /** CompletionConfig name. */ - public name: string; + /** Rule boostAction. */ + public boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); - /** CompletionConfig matchingOrder. */ - public matchingOrder: string; + /** Rule redirectAction. */ + public redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); - /** CompletionConfig maxSuggestions. */ - public maxSuggestions: number; + /** Rule onewaySynonymsAction. */ + public onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); - /** CompletionConfig minPrefixLength. */ - public minPrefixLength: number; + /** Rule doNotAssociateAction. */ + public doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); - /** CompletionConfig autoLearning. */ - public autoLearning: boolean; + /** Rule replacementAction. */ + public replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); - /** CompletionConfig suggestionsInputConfig. */ - public suggestionsInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** Rule ignoreAction. */ + public ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); - /** CompletionConfig lastSuggestionsImportOperation. */ - public lastSuggestionsImportOperation: string; + /** Rule filterAction. */ + public filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); - /** CompletionConfig denylistInputConfig. */ - public denylistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** Rule twowaySynonymsAction. */ + public twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); - /** CompletionConfig lastDenylistImportOperation. */ - public lastDenylistImportOperation: string; + /** Rule forceReturnFacetAction. */ + public forceReturnFacetAction?: (google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction|null); - /** CompletionConfig allowlistInputConfig. */ - public allowlistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** Rule removeFacetAction. */ + public removeFacetAction?: (google.cloud.retail.v2alpha.Rule.IRemoveFacetAction|null); - /** CompletionConfig lastAllowlistImportOperation. */ - public lastAllowlistImportOperation: string; + /** Rule condition. */ + public condition?: (google.cloud.retail.v2alpha.ICondition|null); + + /** Rule action. */ + public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"); /** - * Creates a new CompletionConfig instance using the specified properties. + * Creates a new Rule instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionConfig instance + * @returns Rule instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompletionConfig): google.cloud.retail.v2alpha.CompletionConfig; + public static create(properties?: google.cloud.retail.v2alpha.IRule): google.cloud.retail.v2alpha.Rule; /** - * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. - * @param message CompletionConfig message or plain object to encode + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. - * @param message CompletionConfig message or plain object to encode + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionConfig message from the specified reader or buffer. + * Decodes a Rule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionConfig + * @returns Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule; /** - * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. + * Decodes a Rule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionConfig + * @returns Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule; /** - * Verifies a CompletionConfig message. + * Verifies a Rule message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Rule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionConfig + * @returns Rule */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule; /** - * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. - * @param message CompletionConfig + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompletionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionConfig to JSON. + * Converts this Rule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CompletionConfig + * Gets the default type url for Rule * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MerchantCenterLink. */ - interface IMerchantCenterLink { + namespace Rule { - /** MerchantCenterLink merchantCenterAccountId */ - merchantCenterAccountId?: (number|Long|string|null); + /** Properties of a BoostAction. */ + interface IBoostAction { - /** MerchantCenterLink branchId */ - branchId?: (string|null); + /** BoostAction boost */ + boost?: (number|null); - /** MerchantCenterLink destinations */ - destinations?: (string[]|null); + /** BoostAction productsFilter */ + productsFilter?: (string|null); + } - /** MerchantCenterLink regionCode */ - regionCode?: (string|null); + /** Represents a BoostAction. */ + class BoostAction implements IBoostAction { - /** MerchantCenterLink languageCode */ - languageCode?: (string|null); + /** + * Constructs a new BoostAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction); - /** MerchantCenterLink feeds */ - feeds?: (google.cloud.retail.v2alpha.IMerchantCenterFeedFilter[]|null); - } + /** BoostAction boost. */ + public boost: number; - /** Represents a MerchantCenterLink. */ - class MerchantCenterLink implements IMerchantCenterLink { + /** BoostAction productsFilter. */ + public productsFilter: string; - /** + /** + * Creates a new BoostAction instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @param message BoostAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Verifies a BoostAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.BoostAction; + + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @param message BoostAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoostAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoostAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FilterAction. */ + interface IFilterAction { + + /** FilterAction filter */ + filter?: (string|null); + } + + /** Represents a FilterAction. */ + class FilterAction implements IFilterAction { + + /** + * Constructs a new FilterAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction); + + /** FilterAction filter. */ + public filter: string; + + /** + * Creates a new FilterAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FilterAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @param message FilterAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Verifies a FilterAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FilterAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.FilterAction; + + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @param message FilterAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FilterAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FilterAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RedirectAction. */ + interface IRedirectAction { + + /** RedirectAction redirectUri */ + redirectUri?: (string|null); + } + + /** Represents a RedirectAction. */ + class RedirectAction implements IRedirectAction { + + /** + * Constructs a new RedirectAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction); + + /** RedirectAction redirectUri. */ + public redirectUri: string; + + /** + * Creates a new RedirectAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RedirectAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @param message RedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Verifies a RedirectAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedirectAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.RedirectAction; + + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @param message RedirectAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedirectAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RedirectAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TwowaySynonymsAction. */ + interface ITwowaySynonymsAction { + + /** TwowaySynonymsAction synonyms */ + synonyms?: (string[]|null); + } + + /** Represents a TwowaySynonymsAction. */ + class TwowaySynonymsAction implements ITwowaySynonymsAction { + + /** + * Constructs a new TwowaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction); + + /** TwowaySynonymsAction synonyms. */ + public synonyms: string[]; + + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TwowaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @param message TwowaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Verifies a TwowaySynonymsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TwowaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @param message TwowaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TwowaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TwowaySynonymsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnewaySynonymsAction. */ + interface IOnewaySynonymsAction { + + /** OnewaySynonymsAction queryTerms */ + queryTerms?: (string[]|null); + + /** OnewaySynonymsAction synonyms */ + synonyms?: (string[]|null); + + /** OnewaySynonymsAction onewayTerms */ + onewayTerms?: (string[]|null); + } + + /** Represents an OnewaySynonymsAction. */ + class OnewaySynonymsAction implements IOnewaySynonymsAction { + + /** + * Constructs a new OnewaySynonymsAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction); + + /** OnewaySynonymsAction queryTerms. */ + public queryTerms: string[]; + + /** OnewaySynonymsAction synonyms. */ + public synonyms: string[]; + + /** OnewaySynonymsAction onewayTerms. */ + public onewayTerms: string[]; + + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OnewaySynonymsAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * @param message OnewaySynonymsAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnewaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Verifies an OnewaySynonymsAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnewaySynonymsAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + + /** + * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * @param message OnewaySynonymsAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnewaySynonymsAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnewaySynonymsAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoNotAssociateAction. */ + interface IDoNotAssociateAction { + + /** DoNotAssociateAction queryTerms */ + queryTerms?: (string[]|null); + + /** DoNotAssociateAction doNotAssociateTerms */ + doNotAssociateTerms?: (string[]|null); + + /** DoNotAssociateAction terms */ + terms?: (string[]|null); + } + + /** Represents a DoNotAssociateAction. */ + class DoNotAssociateAction implements IDoNotAssociateAction { + + /** + * Constructs a new DoNotAssociateAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction); + + /** DoNotAssociateAction queryTerms. */ + public queryTerms: string[]; + + /** DoNotAssociateAction doNotAssociateTerms. */ + public doNotAssociateTerms: string[]; + + /** DoNotAssociateAction terms. */ + public terms: string[]; + + /** + * Creates a new DoNotAssociateAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DoNotAssociateAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. + * @param message DoNotAssociateAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoNotAssociateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoNotAssociateAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Verifies a DoNotAssociateAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoNotAssociateAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + + /** + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. + * @param message DoNotAssociateAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoNotAssociateAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoNotAssociateAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplacementAction. */ + interface IReplacementAction { + + /** ReplacementAction queryTerms */ + queryTerms?: (string[]|null); + + /** ReplacementAction replacementTerm */ + replacementTerm?: (string|null); + + /** ReplacementAction term */ + term?: (string|null); + } + + /** Represents a ReplacementAction. */ + class ReplacementAction implements IReplacementAction { + + /** + * Constructs a new ReplacementAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction); + + /** ReplacementAction queryTerms. */ + public queryTerms: string[]; + + /** ReplacementAction replacementTerm. */ + public replacementTerm: string; + + /** ReplacementAction term. */ + public term: string; + + /** + * Creates a new ReplacementAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplacementAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. + * @param message ReplacementAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplacementAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Verifies a ReplacementAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplacementAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ReplacementAction; + + /** + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. + * @param message ReplacementAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplacementAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplacementAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IgnoreAction. */ + interface IIgnoreAction { + + /** IgnoreAction ignoreTerms */ + ignoreTerms?: (string[]|null); + } + + /** Represents an IgnoreAction. */ + class IgnoreAction implements IIgnoreAction { + + /** + * Constructs a new IgnoreAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction); + + /** IgnoreAction ignoreTerms. */ + public ignoreTerms: string[]; + + /** + * Creates a new IgnoreAction instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoreAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. + * @param message IgnoreAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoreAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Verifies an IgnoreAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoreAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.IgnoreAction; + + /** + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. + * @param message IgnoreAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IgnoreAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IgnoreAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForceReturnFacetAction. */ + interface IForceReturnFacetAction { + + /** ForceReturnFacetAction facetPositionAdjustments */ + facetPositionAdjustments?: (google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]|null); + } + + /** Represents a ForceReturnFacetAction. */ + class ForceReturnFacetAction implements IForceReturnFacetAction { + + /** + * Constructs a new ForceReturnFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction); + + /** ForceReturnFacetAction facetPositionAdjustments. */ + public facetPositionAdjustments: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]; + + /** + * Creates a new ForceReturnFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceReturnFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction; + + /** + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction; + + /** + * Verifies a ForceReturnFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceReturnFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction; + + /** + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. + * @param message ForceReturnFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForceReturnFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceReturnFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ForceReturnFacetAction { + + /** Properties of a FacetPositionAdjustment. */ + interface IFacetPositionAdjustment { + + /** FacetPositionAdjustment attributeName */ + attributeName?: (string|null); + + /** FacetPositionAdjustment position */ + position?: (number|null); + } + + /** Represents a FacetPositionAdjustment. */ + class FacetPositionAdjustment implements IFacetPositionAdjustment { + + /** + * Constructs a new FacetPositionAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment); + + /** FacetPositionAdjustment attributeName. */ + public attributeName: string; + + /** FacetPositionAdjustment position. */ + public position: number; + + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetPositionAdjustment instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Verifies a FacetPositionAdjustment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetPositionAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @param message FacetPositionAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetPositionAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetPositionAdjustment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RemoveFacetAction. */ + interface IRemoveFacetAction { + + /** RemoveFacetAction attributeNames */ + attributeNames?: (string[]|null); + } + + /** Represents a RemoveFacetAction. */ + class RemoveFacetAction implements IRemoveFacetAction { + + /** + * Constructs a new RemoveFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Rule.IRemoveFacetAction); + + /** RemoveFacetAction attributeNames. */ + public attributeNames: string[]; + + /** + * Creates a new RemoveFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Rule.IRemoveFacetAction): google.cloud.retail.v2alpha.Rule.RemoveFacetAction; + + /** + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.RemoveFacetAction; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.RemoveFacetAction; + + /** + * Verifies a RemoveFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.RemoveFacetAction; + + /** + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. + * @param message RemoveFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rule.RemoveFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Audience. */ + interface IAudience { + + /** Audience genders */ + genders?: (string[]|null); + + /** Audience ageGroups */ + ageGroups?: (string[]|null); + } + + /** Represents an Audience. */ + class Audience implements IAudience { + + /** + * Constructs a new Audience. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IAudience); + + /** Audience genders. */ + public genders: string[]; + + /** Audience ageGroups. */ + public ageGroups: string[]; + + /** + * Creates a new Audience instance using the specified properties. + * @param [properties] Properties to set + * @returns Audience instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IAudience): google.cloud.retail.v2alpha.Audience; + + /** + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @param message Audience message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Audience message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Audience + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Audience; + + /** + * Decodes an Audience message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Audience + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Audience; + + /** + * Verifies an Audience message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Audience message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Audience + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Audience; + + /** + * Creates a plain object from an Audience message. Also converts values to other types if specified. + * @param message Audience + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Audience to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Audience + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColorInfo. */ + interface IColorInfo { + + /** ColorInfo colorFamilies */ + colorFamilies?: (string[]|null); + + /** ColorInfo colors */ + colors?: (string[]|null); + } + + /** Represents a ColorInfo. */ + class ColorInfo implements IColorInfo { + + /** + * Constructs a new ColorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IColorInfo); + + /** ColorInfo colorFamilies. */ + public colorFamilies: string[]; + + /** ColorInfo colors. */ + public colors: string[]; + + /** + * Creates a new ColorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ColorInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IColorInfo): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. + * @param message ColorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Verifies a ColorInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColorInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ColorInfo; + + /** + * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. + * @param message ColorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute text */ + text?: (string[]|null); + + /** CustomAttribute numbers */ + numbers?: (number[]|null); + + /** CustomAttribute searchable */ + searchable?: (boolean|null); + + /** CustomAttribute indexable */ + indexable?: (boolean|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICustomAttribute); + + /** CustomAttribute text. */ + public text: string[]; + + /** CustomAttribute numbers. */ + public numbers: number[]; + + /** CustomAttribute searchable. */ + public searchable?: (boolean|null); + + /** CustomAttribute indexable. */ + public indexable?: (boolean|null); + + /** CustomAttribute _searchable. */ + public _searchable?: "searchable"; + + /** CustomAttribute _indexable. */ + public _indexable?: "indexable"; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICustomAttribute): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Verifies a CustomAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FulfillmentInfo. */ + interface IFulfillmentInfo { + + /** FulfillmentInfo type */ + type?: (string|null); + + /** FulfillmentInfo placeIds */ + placeIds?: (string[]|null); + } + + /** Represents a FulfillmentInfo. */ + class FulfillmentInfo implements IFulfillmentInfo { + + /** + * Constructs a new FulfillmentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo); + + /** FulfillmentInfo type. */ + public type: string; + + /** FulfillmentInfo placeIds. */ + public placeIds: string[]; + + /** + * Creates a new FulfillmentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FulfillmentInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. + * @param message FulfillmentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FulfillmentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Verifies a FulfillmentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FulfillmentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.FulfillmentInfo; + + /** + * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. + * @param message FulfillmentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FulfillmentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FulfillmentInfo + * @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 uri */ + uri?: (string|null); + + /** Image height */ + height?: (number|null); + + /** Image width */ + width?: (number|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IImage); + + /** Image uri. */ + public uri: string; + + /** Image height. */ + public height: number; + + /** Image width. */ + public width: number; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IImage): google.cloud.retail.v2alpha.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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 an Interval. */ + interface IInterval { + + /** Interval minimum */ + minimum?: (number|null); + + /** Interval exclusiveMinimum */ + exclusiveMinimum?: (number|null); + + /** Interval maximum */ + maximum?: (number|null); + + /** Interval exclusiveMaximum */ + exclusiveMaximum?: (number|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IInterval); + + /** Interval minimum. */ + public minimum?: (number|null); + + /** Interval exclusiveMinimum. */ + public exclusiveMinimum?: (number|null); + + /** Interval maximum. */ + public maximum?: (number|null); + + /** Interval exclusiveMaximum. */ + public exclusiveMaximum?: (number|null); + + /** Interval min. */ + public min?: ("minimum"|"exclusiveMinimum"); + + /** Interval max. */ + public max?: ("maximum"|"exclusiveMaximum"); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IInterval): google.cloud.retail.v2alpha.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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; + } + + /** Properties of a PriceInfo. */ + interface IPriceInfo { + + /** PriceInfo currencyCode */ + currencyCode?: (string|null); + + /** PriceInfo price */ + price?: (number|null); + + /** PriceInfo originalPrice */ + originalPrice?: (number|null); + + /** PriceInfo cost */ + cost?: (number|null); + + /** PriceInfo priceEffectiveTime */ + priceEffectiveTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceExpireTime */ + priceExpireTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceRange */ + priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + } + + /** Represents a PriceInfo. */ + class PriceInfo implements IPriceInfo { + + /** + * Constructs a new PriceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPriceInfo); + + /** PriceInfo currencyCode. */ + public currencyCode: string; + + /** PriceInfo price. */ + public price: number; + + /** PriceInfo originalPrice. */ + public originalPrice: number; + + /** PriceInfo cost. */ + public cost: number; + + /** PriceInfo priceEffectiveTime. */ + public priceEffectiveTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceExpireTime. */ + public priceExpireTime?: (google.protobuf.ITimestamp|null); + + /** PriceInfo priceRange. */ + public priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + + /** + * Creates a new PriceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPriceInfo): google.cloud.retail.v2alpha.PriceInfo; + + /** + * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. + * @param message PriceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PriceInfo; + + /** + * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PriceInfo; + + /** + * Verifies a PriceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo; + + /** + * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. + * @param message PriceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PriceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PriceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PriceInfo { + + /** Properties of a PriceRange. */ + interface IPriceRange { + + /** PriceRange price */ + price?: (google.cloud.retail.v2alpha.IInterval|null); + + /** PriceRange originalPrice */ + originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); + } + + /** Represents a PriceRange. */ + class PriceRange implements IPriceRange { + + /** + * Constructs a new PriceRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange); + + /** PriceRange price. */ + public price?: (google.cloud.retail.v2alpha.IInterval|null); + + /** PriceRange originalPrice. */ + public originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); + + /** + * Creates a new PriceRange instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceRange instance + */ + public static create(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + + /** + * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. + * @param message PriceRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + + /** + * Decodes a PriceRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + + /** + * Verifies a PriceRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo.PriceRange; + + /** + * Creates a plain object from a PriceRange message. Also converts values to other types if specified. + * @param message PriceRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PriceRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PriceRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Rating. */ + interface IRating { + + /** Rating ratingCount */ + ratingCount?: (number|null); + + /** Rating averageRating */ + averageRating?: (number|null); + + /** Rating ratingHistogram */ + ratingHistogram?: (number[]|null); + } + + /** Represents a Rating. */ + class Rating implements IRating { + + /** + * Constructs a new Rating. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IRating); + + /** Rating ratingCount. */ + public ratingCount: number; + + /** Rating averageRating. */ + public averageRating: number; + + /** Rating ratingHistogram. */ + public ratingHistogram: number[]; + + /** + * Creates a new Rating instance using the specified properties. + * @param [properties] Properties to set + * @returns Rating instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IRating): google.cloud.retail.v2alpha.Rating; + + /** + * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. + * @param message Rating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rating message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rating; + + /** + * Decodes a Rating message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rating; + + /** + * Verifies a Rating message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rating message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rating + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rating; + + /** + * Creates a plain object from a Rating message. Also converts values to other types if specified. + * @param message Rating + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rating to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rating + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UserInfo. */ + interface IUserInfo { + + /** UserInfo userId */ + userId?: (string|null); + + /** UserInfo ipAddress */ + ipAddress?: (string|null); + + /** UserInfo userAgent */ + userAgent?: (string|null); + + /** UserInfo directUserRequest */ + directUserRequest?: (boolean|null); + } + + /** Represents a UserInfo. */ + class UserInfo implements IUserInfo { + + /** + * Constructs a new UserInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IUserInfo); + + /** UserInfo userId. */ + public userId: string; + + /** UserInfo ipAddress. */ + public ipAddress: string; + + /** UserInfo userAgent. */ + public userAgent: string; + + /** UserInfo directUserRequest. */ + public directUserRequest: boolean; + + /** + * Creates a new UserInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns UserInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUserInfo): google.cloud.retail.v2alpha.UserInfo; + + /** + * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. + * @param message UserInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserInfo; + + /** + * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserInfo; + + /** + * Verifies a UserInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserInfo; + + /** + * Creates a plain object from a UserInfo message. Also converts values to other types if specified. + * @param message UserInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocalInventory. */ + interface ILocalInventory { + + /** LocalInventory placeId */ + placeId?: (string|null); + + /** LocalInventory priceInfo */ + priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + + /** LocalInventory attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + + /** LocalInventory fulfillmentTypes */ + fulfillmentTypes?: (string[]|null); + } + + /** Represents a LocalInventory. */ + class LocalInventory implements ILocalInventory { + + /** + * Constructs a new LocalInventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ILocalInventory); + + /** LocalInventory placeId. */ + public placeId: string; + + /** LocalInventory priceInfo. */ + public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + + /** LocalInventory attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + + /** LocalInventory fulfillmentTypes. */ + public fulfillmentTypes: string[]; + + /** + * Creates a new LocalInventory instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalInventory instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ILocalInventory): google.cloud.retail.v2alpha.LocalInventory; + + /** + * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. + * @param message LocalInventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalInventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalInventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LocalInventory; + + /** + * Decodes a LocalInventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalInventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LocalInventory; + + /** + * Verifies a LocalInventory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalInventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LocalInventory; + + /** + * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. + * @param message LocalInventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalInventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalInventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Promotion. */ + interface IPromotion { + + /** Promotion promotionId */ + promotionId?: (string|null); + } + + /** Represents a Promotion. */ + class Promotion implements IPromotion { + + /** + * Constructs a new Promotion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPromotion); + + /** Promotion promotionId. */ + public promotionId: string; + + /** + * Creates a new Promotion instance using the specified properties. + * @param [properties] Properties to set + * @returns Promotion instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPromotion): google.cloud.retail.v2alpha.Promotion; + + /** + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * @param message Promotion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Promotion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Promotion; + + /** + * Decodes a Promotion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Promotion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Promotion; + + /** + * Verifies a Promotion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Promotion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Promotion; + + /** + * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * @param message Promotion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Promotion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Promotion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BranchService */ + class BranchService extends $protobuf.rpc.Service { + + /** + * Constructs a new BranchService 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 BranchService 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): BranchService; + + /** + * Calls ListBranches. + * @param request ListBranchesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBranchesResponse + */ + public listBranches(request: google.cloud.retail.v2alpha.IListBranchesRequest, callback: google.cloud.retail.v2alpha.BranchService.ListBranchesCallback): void; + + /** + * Calls ListBranches. + * @param request ListBranchesRequest message or plain object + * @returns Promise + */ + public listBranches(request: google.cloud.retail.v2alpha.IListBranchesRequest): Promise; + + /** + * Calls GetBranch. + * @param request GetBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Branch + */ + public getBranch(request: google.cloud.retail.v2alpha.IGetBranchRequest, callback: google.cloud.retail.v2alpha.BranchService.GetBranchCallback): void; + + /** + * Calls GetBranch. + * @param request GetBranchRequest message or plain object + * @returns Promise + */ + public getBranch(request: google.cloud.retail.v2alpha.IGetBranchRequest): Promise; + } + + namespace BranchService { + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.BranchService|listBranches}. + * @param error Error, if any + * @param [response] ListBranchesResponse + */ + type ListBranchesCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListBranchesResponse) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.BranchService|getBranch}. + * @param error Error, if any + * @param [response] Branch + */ + type GetBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Branch) => void; + } + + /** Properties of a ListBranchesRequest. */ + interface IListBranchesRequest { + + /** ListBranchesRequest parent */ + parent?: (string|null); + + /** ListBranchesRequest view */ + view?: (google.cloud.retail.v2alpha.BranchView|keyof typeof google.cloud.retail.v2alpha.BranchView|null); + } + + /** Represents a ListBranchesRequest. */ + class ListBranchesRequest implements IListBranchesRequest { + + /** + * Constructs a new ListBranchesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListBranchesRequest); + + /** ListBranchesRequest parent. */ + public parent: string; + + /** ListBranchesRequest view. */ + public view: (google.cloud.retail.v2alpha.BranchView|keyof typeof google.cloud.retail.v2alpha.BranchView); + + /** + * Creates a new ListBranchesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBranchesRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListBranchesRequest): google.cloud.retail.v2alpha.ListBranchesRequest; + + /** + * Encodes the specified ListBranchesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesRequest.verify|verify} messages. + * @param message ListBranchesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListBranchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBranchesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesRequest.verify|verify} messages. + * @param message ListBranchesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListBranchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBranchesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBranchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListBranchesRequest; + + /** + * Decodes a ListBranchesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBranchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListBranchesRequest; + + /** + * Verifies a ListBranchesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBranchesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBranchesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListBranchesRequest; + + /** + * Creates a plain object from a ListBranchesRequest message. Also converts values to other types if specified. + * @param message ListBranchesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListBranchesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBranchesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBranchesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBranchesResponse. */ + interface IListBranchesResponse { + + /** ListBranchesResponse branches */ + branches?: (google.cloud.retail.v2alpha.IBranch[]|null); + } + + /** Represents a ListBranchesResponse. */ + class ListBranchesResponse implements IListBranchesResponse { + + /** + * Constructs a new ListBranchesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListBranchesResponse); + + /** ListBranchesResponse branches. */ + public branches: google.cloud.retail.v2alpha.IBranch[]; + + /** + * Creates a new ListBranchesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBranchesResponse instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListBranchesResponse): google.cloud.retail.v2alpha.ListBranchesResponse; + + /** + * Encodes the specified ListBranchesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesResponse.verify|verify} messages. + * @param message ListBranchesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListBranchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBranchesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesResponse.verify|verify} messages. + * @param message ListBranchesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListBranchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBranchesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBranchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListBranchesResponse; + + /** + * Decodes a ListBranchesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBranchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListBranchesResponse; + + /** + * Verifies a ListBranchesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBranchesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBranchesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListBranchesResponse; + + /** + * Creates a plain object from a ListBranchesResponse message. Also converts values to other types if specified. + * @param message ListBranchesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListBranchesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBranchesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBranchesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBranchRequest. */ + interface IGetBranchRequest { + + /** GetBranchRequest name */ + name?: (string|null); + + /** GetBranchRequest view */ + view?: (google.cloud.retail.v2alpha.BranchView|keyof typeof google.cloud.retail.v2alpha.BranchView|null); + } + + /** Represents a GetBranchRequest. */ + class GetBranchRequest implements IGetBranchRequest { + + /** + * Constructs a new GetBranchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IGetBranchRequest); + + /** GetBranchRequest name. */ + public name: string; + + /** GetBranchRequest view. */ + public view: (google.cloud.retail.v2alpha.BranchView|keyof typeof google.cloud.retail.v2alpha.BranchView); + + /** + * Creates a new GetBranchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBranchRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IGetBranchRequest): google.cloud.retail.v2alpha.GetBranchRequest; + + /** + * Encodes the specified GetBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetBranchRequest.verify|verify} messages. + * @param message GetBranchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IGetBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetBranchRequest.verify|verify} messages. + * @param message GetBranchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBranchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetBranchRequest; + + /** + * Decodes a GetBranchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBranchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetBranchRequest; + + /** + * Verifies a GetBranchRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBranchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBranchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetBranchRequest; + + /** + * Creates a plain object from a GetBranchRequest message. Also converts values to other types if specified. + * @param message GetBranchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.GetBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBranchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBranchRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProductLevelConfig. */ + interface IProductLevelConfig { + + /** ProductLevelConfig ingestionProductType */ + ingestionProductType?: (string|null); + + /** ProductLevelConfig merchantCenterProductIdField */ + merchantCenterProductIdField?: (string|null); + } + + /** Represents a ProductLevelConfig. */ + class ProductLevelConfig implements IProductLevelConfig { + + /** + * Constructs a new ProductLevelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProductLevelConfig); + + /** ProductLevelConfig ingestionProductType. */ + public ingestionProductType: string; + + /** ProductLevelConfig merchantCenterProductIdField. */ + public merchantCenterProductIdField: string; + + /** + * Creates a new ProductLevelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductLevelConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IProductLevelConfig): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * @param message ProductLevelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductLevelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductLevelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductLevelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Verifies a ProductLevelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductLevelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductLevelConfig; + + /** + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. + * @param message ProductLevelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ProductLevelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProductLevelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProductLevelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CatalogAttribute. */ + interface ICatalogAttribute { + + /** CatalogAttribute key */ + key?: (string|null); + + /** CatalogAttribute inUse */ + inUse?: (boolean|null); + + /** CatalogAttribute type */ + type?: (google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|null); + + /** CatalogAttribute indexableOption */ + indexableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|null); + + /** CatalogAttribute dynamicFacetableOption */ + dynamicFacetableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|null); + + /** CatalogAttribute searchableOption */ + searchableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|null); + + /** CatalogAttribute recommendationsFilteringOption */ + recommendationsFilteringOption?: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption|null); + + /** CatalogAttribute exactSearchableOption */ + exactSearchableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null); + + /** CatalogAttribute retrievableOption */ + retrievableOption?: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null); + + /** CatalogAttribute facetConfig */ + facetConfig?: (google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig|null); + } + + /** Represents a CatalogAttribute. */ + class CatalogAttribute implements ICatalogAttribute { + + /** + * Constructs a new CatalogAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICatalogAttribute); + + /** CatalogAttribute key. */ + public key: string; + + /** CatalogAttribute inUse. */ + public inUse: boolean; + + /** CatalogAttribute type. */ + public type: (google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.AttributeType); + + /** CatalogAttribute indexableOption. */ + public indexableOption: (google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption); + + /** CatalogAttribute dynamicFacetableOption. */ + public dynamicFacetableOption: (google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption); + + /** CatalogAttribute searchableOption. */ + public searchableOption: (google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption); + + /** CatalogAttribute recommendationsFilteringOption. */ + public recommendationsFilteringOption: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption); + + /** CatalogAttribute exactSearchableOption. */ + public exactSearchableOption: (google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption); + + /** CatalogAttribute retrievableOption. */ + public retrievableOption: (google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption); + + /** CatalogAttribute facetConfig. */ + public facetConfig?: (google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig|null); + + /** + * Creates a new CatalogAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CatalogAttribute instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICatalogAttribute): google.cloud.retail.v2alpha.CatalogAttribute; + + /** + * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. + * @param message CatalogAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. + * @param message CatalogAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICatalogAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CatalogAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CatalogAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute; + + /** + * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CatalogAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute; + + /** + * Verifies a CatalogAttribute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CatalogAttribute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute; + + /** + * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. + * @param message CatalogAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CatalogAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CatalogAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CatalogAttribute { + + /** Properties of a FacetConfig. */ + interface IFacetConfig { + + /** FacetConfig facetIntervals */ + facetIntervals?: (google.cloud.retail.v2alpha.IInterval[]|null); + + /** FacetConfig ignoredFacetValues */ + ignoredFacetValues?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]|null); + + /** FacetConfig mergedFacetValues */ + mergedFacetValues?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue[]|null); + + /** FacetConfig mergedFacet */ + mergedFacet?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig */ + rerankConfig?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig|null); + } + + /** Represents a FacetConfig. */ + class FacetConfig implements IFacetConfig { + + /** + * Constructs a new FacetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig); + + /** FacetConfig facetIntervals. */ + public facetIntervals: google.cloud.retail.v2alpha.IInterval[]; + + /** FacetConfig ignoredFacetValues. */ + public ignoredFacetValues: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]; + + /** FacetConfig mergedFacetValues. */ + public mergedFacetValues: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue[]; + + /** FacetConfig mergedFacet. */ + public mergedFacet?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig. */ + public rerankConfig?: (google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig|null); + + /** + * Creates a new FacetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig; + + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig; + + /** + * Verifies a FacetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig; + + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @param message FacetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FacetConfig { + + /** Properties of an IgnoredFacetValues. */ + interface IIgnoredFacetValues { + + /** IgnoredFacetValues values */ + values?: (string[]|null); + + /** IgnoredFacetValues startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an IgnoredFacetValues. */ + class IgnoredFacetValues implements IIgnoredFacetValues { + + /** + * Constructs a new IgnoredFacetValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues); + + /** IgnoredFacetValues values. */ + public values: string[]; + + /** IgnoredFacetValues startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoredFacetValues instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Verifies an IgnoredFacetValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoredFacetValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @param message IgnoredFacetValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IgnoredFacetValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IgnoredFacetValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacetValue. */ + interface IMergedFacetValue { + + /** MergedFacetValue values */ + values?: (string[]|null); + + /** MergedFacetValue mergedValue */ + mergedValue?: (string|null); + } + + /** Represents a MergedFacetValue. */ + class MergedFacetValue implements IMergedFacetValue { + + /** + * Constructs a new MergedFacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue); + + /** MergedFacetValue values. */ + public values: string[]; + + /** MergedFacetValue mergedValue. */ + public mergedValue: string; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacetValue instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Verifies a MergedFacetValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @param message MergedFacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacetValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacet. */ + interface IMergedFacet { + + /** MergedFacet mergedFacetKey */ + mergedFacetKey?: (string|null); + } + + /** Represents a MergedFacet. */ + class MergedFacet implements IMergedFacet { + + /** + * Constructs a new MergedFacet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet); + + /** MergedFacet mergedFacetKey. */ + public mergedFacetKey: string; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacet instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Verifies a MergedFacet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @param message MergedFacet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RerankConfig. */ + interface IRerankConfig { + + /** RerankConfig rerankFacet */ + rerankFacet?: (boolean|null); + + /** RerankConfig facetValues */ + facetValues?: (string[]|null); + } + + /** Represents a RerankConfig. */ + class RerankConfig implements IRerankConfig { + + /** + * Constructs a new RerankConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig); + + /** RerankConfig rerankFacet. */ + public rerankFacet: boolean; + + /** RerankConfig facetValues. */ + public facetValues: string[]; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RerankConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Verifies a RerankConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RerankConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @param message RerankConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RerankConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RerankConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** AttributeType enum. */ + enum AttributeType { + UNKNOWN = 0, + TEXTUAL = 1, + NUMERICAL = 2 + } + + /** IndexableOption enum. */ + enum IndexableOption { + INDEXABLE_OPTION_UNSPECIFIED = 0, + INDEXABLE_ENABLED = 1, + INDEXABLE_DISABLED = 2 + } + + /** DynamicFacetableOption enum. */ + enum DynamicFacetableOption { + DYNAMIC_FACETABLE_OPTION_UNSPECIFIED = 0, + DYNAMIC_FACETABLE_ENABLED = 1, + DYNAMIC_FACETABLE_DISABLED = 2 + } + + /** SearchableOption enum. */ + enum SearchableOption { + SEARCHABLE_OPTION_UNSPECIFIED = 0, + SEARCHABLE_ENABLED = 1, + SEARCHABLE_DISABLED = 2 + } + + /** ExactSearchableOption enum. */ + enum ExactSearchableOption { + EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0, + EXACT_SEARCHABLE_ENABLED = 1, + EXACT_SEARCHABLE_DISABLED = 2 + } + + /** RetrievableOption enum. */ + enum RetrievableOption { + RETRIEVABLE_OPTION_UNSPECIFIED = 0, + RETRIEVABLE_ENABLED = 1, + RETRIEVABLE_DISABLED = 2 + } + } + + /** Properties of an AttributesConfig. */ + interface IAttributesConfig { + + /** AttributesConfig name */ + name?: (string|null); + + /** AttributesConfig catalogAttributes */ + catalogAttributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICatalogAttribute }|null); + + /** AttributesConfig attributeConfigLevel */ + attributeConfigLevel?: (google.cloud.retail.v2alpha.AttributeConfigLevel|keyof typeof google.cloud.retail.v2alpha.AttributeConfigLevel|null); + } + + /** Represents an AttributesConfig. */ + class AttributesConfig implements IAttributesConfig { + + /** + * Constructs a new AttributesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IAttributesConfig); + + /** AttributesConfig name. */ + public name: string; + + /** AttributesConfig catalogAttributes. */ + public catalogAttributes: { [k: string]: google.cloud.retail.v2alpha.ICatalogAttribute }; + + /** AttributesConfig attributeConfigLevel. */ + public attributeConfigLevel: (google.cloud.retail.v2alpha.AttributeConfigLevel|keyof typeof google.cloud.retail.v2alpha.AttributeConfigLevel); + + /** + * Creates a new AttributesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributesConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IAttributesConfig): google.cloud.retail.v2alpha.AttributesConfig; + + /** + * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. + * @param message AttributesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. + * @param message AttributesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAttributesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AttributesConfig; + + /** + * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AttributesConfig; + + /** + * Verifies an AttributesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AttributesConfig; + + /** + * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. + * @param message AttributesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AttributesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CompletionConfig. */ + interface ICompletionConfig { + + /** CompletionConfig name */ + name?: (string|null); + + /** CompletionConfig matchingOrder */ + matchingOrder?: (string|null); + + /** CompletionConfig maxSuggestions */ + maxSuggestions?: (number|null); + + /** CompletionConfig minPrefixLength */ + minPrefixLength?: (number|null); + + /** CompletionConfig autoLearning */ + autoLearning?: (boolean|null); + + /** CompletionConfig suggestionsInputConfig */ + suggestionsInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastSuggestionsImportOperation */ + lastSuggestionsImportOperation?: (string|null); + + /** CompletionConfig denylistInputConfig */ + denylistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastDenylistImportOperation */ + lastDenylistImportOperation?: (string|null); + + /** CompletionConfig allowlistInputConfig */ + allowlistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastAllowlistImportOperation */ + lastAllowlistImportOperation?: (string|null); + } + + /** Represents a CompletionConfig. */ + class CompletionConfig implements ICompletionConfig { + + /** + * Constructs a new CompletionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICompletionConfig); + + /** CompletionConfig name. */ + public name: string; + + /** CompletionConfig matchingOrder. */ + public matchingOrder: string; + + /** CompletionConfig maxSuggestions. */ + public maxSuggestions: number; + + /** CompletionConfig minPrefixLength. */ + public minPrefixLength: number; + + /** CompletionConfig autoLearning. */ + public autoLearning: boolean; + + /** CompletionConfig suggestionsInputConfig. */ + public suggestionsInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastSuggestionsImportOperation. */ + public lastSuggestionsImportOperation: string; + + /** CompletionConfig denylistInputConfig. */ + public denylistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastDenylistImportOperation. */ + public lastDenylistImportOperation: string; + + /** CompletionConfig allowlistInputConfig. */ + public allowlistInputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** CompletionConfig lastAllowlistImportOperation. */ + public lastAllowlistImportOperation: string; + + /** + * Creates a new CompletionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICompletionConfig): google.cloud.retail.v2alpha.CompletionConfig; + + /** + * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. + * @param message CompletionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. + * @param message CompletionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionConfig; + + /** + * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionConfig; + + /** + * Verifies a CompletionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionConfig; + + /** + * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. + * @param message CompletionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompletionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompletionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MerchantCenterLink. */ + interface IMerchantCenterLink { + + /** MerchantCenterLink merchantCenterAccountId */ + merchantCenterAccountId?: (number|Long|string|null); + + /** MerchantCenterLink branchId */ + branchId?: (string|null); + + /** MerchantCenterLink destinations */ + destinations?: (string[]|null); + + /** MerchantCenterLink regionCode */ + regionCode?: (string|null); + + /** MerchantCenterLink languageCode */ + languageCode?: (string|null); + + /** MerchantCenterLink feeds */ + feeds?: (google.cloud.retail.v2alpha.IMerchantCenterFeedFilter[]|null); + } + + /** Represents a MerchantCenterLink. */ + class MerchantCenterLink implements IMerchantCenterLink { + + /** * Constructs a new MerchantCenterLink. * @param [properties] Properties to set */ @@ -21042,5389 +27034,4898 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** AttributeConfigLevel enum. */ - enum AttributeConfigLevel { - ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED = 0, - PRODUCT_LEVEL_ATTRIBUTE_CONFIG = 1, - CATALOG_LEVEL_ATTRIBUTE_CONFIG = 2 - } - - /** SolutionType enum. */ - enum SolutionType { - SOLUTION_TYPE_UNSPECIFIED = 0, - SOLUTION_TYPE_RECOMMENDATION = 1, - SOLUTION_TYPE_SEARCH = 2 - } - - /** RecommendationsFilteringOption enum. */ - enum RecommendationsFilteringOption { - RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED = 0, - RECOMMENDATIONS_FILTERING_DISABLED = 1, - RECOMMENDATIONS_FILTERING_ENABLED = 3 - } - - /** SearchSolutionUseCase enum. */ - enum SearchSolutionUseCase { - SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0, - SEARCH_SOLUTION_USE_CASE_SEARCH = 1, - SEARCH_SOLUTION_USE_CASE_BROWSE = 2 - } - - /** Properties of a Condition. */ - interface ICondition { + /** Properties of a GcsSource. */ + interface IGcsSource { - /** Condition queryTerms */ - queryTerms?: (google.cloud.retail.v2alpha.Condition.IQueryTerm[]|null); + /** GcsSource inputUris */ + inputUris?: (string[]|null); - /** Condition activeTimeRange */ - activeTimeRange?: (google.cloud.retail.v2alpha.Condition.ITimeRange[]|null); + /** GcsSource dataSchema */ + dataSchema?: (string|null); } - /** Represents a Condition. */ - class Condition implements ICondition { + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { /** - * Constructs a new Condition. + * Constructs a new GcsSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICondition); + constructor(properties?: google.cloud.retail.v2alpha.IGcsSource); - /** Condition queryTerms. */ - public queryTerms: google.cloud.retail.v2alpha.Condition.IQueryTerm[]; + /** GcsSource inputUris. */ + public inputUris: string[]; - /** Condition activeTimeRange. */ - public activeTimeRange: google.cloud.retail.v2alpha.Condition.ITimeRange[]; + /** GcsSource dataSchema. */ + public dataSchema: string; /** - * Creates a new Condition instance using the specified properties. + * Creates a new GcsSource instance using the specified properties. * @param [properties] Properties to set - * @returns Condition instance + * @returns GcsSource instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICondition): google.cloud.retail.v2alpha.Condition; + public static create(properties?: google.cloud.retail.v2alpha.IGcsSource): google.cloud.retail.v2alpha.GcsSource; /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Condition message from the specified reader or buffer. + * 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 Condition + * @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.retail.v2alpha.Condition; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GcsSource; /** - * Decodes a Condition message from the specified reader or buffer, length delimited. + * Decodes a GcsSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Condition + * @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.retail.v2alpha.Condition; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GcsSource; /** - * Verifies a Condition message. + * 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 Condition message from a plain object. Also converts values to their respective internal types. + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Condition + * @returns GcsSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GcsSource; /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition + * 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.retail.v2alpha.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Condition to JSON. + * Converts this GcsSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Condition + * 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; } - namespace Condition { - - /** Properties of a QueryTerm. */ - interface IQueryTerm { - - /** QueryTerm value */ - value?: (string|null); - - /** QueryTerm fullMatch */ - fullMatch?: (boolean|null); - } - - /** Represents a QueryTerm. */ - class QueryTerm implements IQueryTerm { - - /** - * Constructs a new QueryTerm. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm); - - /** QueryTerm value. */ - public value: string; - - /** QueryTerm fullMatch. */ - public fullMatch: boolean; - - /** - * Creates a new QueryTerm instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryTerm instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Condition.IQueryTerm): google.cloud.retail.v2alpha.Condition.QueryTerm; - - /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. - * @param message QueryTerm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.IQueryTerm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryTerm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryTerm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Condition.QueryTerm; - - /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryTerm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Condition.QueryTerm; - - /** - * Verifies a QueryTerm message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryTerm - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.QueryTerm; - - /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. - * @param message QueryTerm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Condition.QueryTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryTerm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryTerm - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeRange. */ - interface ITimeRange { - - /** TimeRange startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** TimeRange endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a TimeRange. */ - class TimeRange implements ITimeRange { - - /** - * Constructs a new TimeRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange); - - /** TimeRange startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** TimeRange endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new TimeRange instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeRange instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Condition.ITimeRange): google.cloud.retail.v2alpha.Condition.TimeRange; - - /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. - * @param message TimeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Condition.ITimeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Condition.TimeRange; - - /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Condition.TimeRange; - - /** - * Verifies a TimeRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Condition.TimeRange; - - /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. - * @param message TimeRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Condition.TimeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Rule. */ - interface IRule { - - /** Rule boostAction */ - boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); - - /** Rule redirectAction */ - redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); - - /** Rule onewaySynonymsAction */ - onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { - /** Rule doNotAssociateAction */ - doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + /** BigQuerySource partitionDate */ + partitionDate?: (google.type.IDate|null); - /** Rule replacementAction */ - replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + /** BigQuerySource projectId */ + projectId?: (string|null); - /** Rule ignoreAction */ - ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + /** BigQuerySource datasetId */ + datasetId?: (string|null); - /** Rule filterAction */ - filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + /** BigQuerySource tableId */ + tableId?: (string|null); - /** Rule twowaySynonymsAction */ - twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + /** BigQuerySource gcsStagingDir */ + gcsStagingDir?: (string|null); - /** Rule condition */ - condition?: (google.cloud.retail.v2alpha.ICondition|null); + /** BigQuerySource dataSchema */ + dataSchema?: (string|null); } - /** Represents a Rule. */ - class Rule implements IRule { + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { /** - * Constructs a new Rule. + * Constructs a new BigQuerySource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRule); - - /** Rule boostAction. */ - public boostAction?: (google.cloud.retail.v2alpha.Rule.IBoostAction|null); - - /** Rule redirectAction. */ - public redirectAction?: (google.cloud.retail.v2alpha.Rule.IRedirectAction|null); - - /** Rule onewaySynonymsAction. */ - public onewaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null); + constructor(properties?: google.cloud.retail.v2alpha.IBigQuerySource); - /** Rule doNotAssociateAction. */ - public doNotAssociateAction?: (google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null); + /** BigQuerySource partitionDate. */ + public partitionDate?: (google.type.IDate|null); - /** Rule replacementAction. */ - public replacementAction?: (google.cloud.retail.v2alpha.Rule.IReplacementAction|null); + /** BigQuerySource projectId. */ + public projectId: string; - /** Rule ignoreAction. */ - public ignoreAction?: (google.cloud.retail.v2alpha.Rule.IIgnoreAction|null); + /** BigQuerySource datasetId. */ + public datasetId: string; - /** Rule filterAction. */ - public filterAction?: (google.cloud.retail.v2alpha.Rule.IFilterAction|null); + /** BigQuerySource tableId. */ + public tableId: string; - /** Rule twowaySynonymsAction. */ - public twowaySynonymsAction?: (google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null); + /** BigQuerySource gcsStagingDir. */ + public gcsStagingDir: string; - /** Rule condition. */ - public condition?: (google.cloud.retail.v2alpha.ICondition|null); + /** BigQuerySource dataSchema. */ + public dataSchema: string; - /** Rule action. */ - public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + /** BigQuerySource partition. */ + public partition?: "partitionDate"; /** - * Creates a new Rule instance using the specified properties. + * Creates a new BigQuerySource instance using the specified properties. * @param [properties] Properties to set - * @returns Rule instance + * @returns BigQuerySource instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRule): google.cloud.retail.v2alpha.Rule; + public static create(properties?: google.cloud.retail.v2alpha.IBigQuerySource): google.cloud.retail.v2alpha.BigQuerySource; /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @param message Rule message or plain object to encode + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rule message from the specified reader or buffer. + * 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 Rule + * @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.retail.v2alpha.Rule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BigQuerySource; /** - * Decodes a Rule message from the specified reader or buffer, length delimited. + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rule + * @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.retail.v2alpha.Rule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BigQuerySource; /** - * Verifies a Rule message. + * 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 Rule message from a plain object. Also converts values to their respective internal types. + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rule + * @returns BigQuerySource */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BigQuerySource; /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @param message Rule + * 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.retail.v2alpha.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rule to JSON. + * Converts this BigQuerySource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Rule + * 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; } - namespace Rule { - - /** Properties of a BoostAction. */ - interface IBoostAction { - - /** BoostAction boost */ - boost?: (number|null); - - /** BoostAction productsFilter */ - productsFilter?: (string|null); - } - - /** Represents a BoostAction. */ - class BoostAction implements IBoostAction { - - /** - * Constructs a new BoostAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction); - - /** BoostAction boost. */ - public boost: number; - - /** BoostAction productsFilter. */ - public productsFilter: string; - - /** - * Creates a new BoostAction instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IBoostAction): google.cloud.retail.v2alpha.Rule.BoostAction; - - /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. - * @param message BoostAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IBoostAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoostAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.BoostAction; - - /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.BoostAction; - - /** - * Verifies a BoostAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.BoostAction; - - /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. - * @param message BoostAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.BoostAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoostAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoostAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FilterAction. */ - interface IFilterAction { - - /** FilterAction filter */ - filter?: (string|null); - } - - /** Represents a FilterAction. */ - class FilterAction implements IFilterAction { - - /** - * Constructs a new FilterAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction); - - /** FilterAction filter. */ - public filter: string; - - /** - * Creates a new FilterAction instance using the specified properties. - * @param [properties] Properties to set - * @returns FilterAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IFilterAction): google.cloud.retail.v2alpha.Rule.FilterAction; - - /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. - * @param message FilterAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IFilterAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FilterAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FilterAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.FilterAction; - - /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FilterAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.FilterAction; - - /** - * Verifies a FilterAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FilterAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.FilterAction; - - /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. - * @param message FilterAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.FilterAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FilterAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FilterAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RedirectAction. */ - interface IRedirectAction { - - /** RedirectAction redirectUri */ - redirectUri?: (string|null); - } - - /** Represents a RedirectAction. */ - class RedirectAction implements IRedirectAction { - - /** - * Constructs a new RedirectAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction); - - /** RedirectAction redirectUri. */ - public redirectUri: string; - - /** - * Creates a new RedirectAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RedirectAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IRedirectAction): google.cloud.retail.v2alpha.Rule.RedirectAction; - - /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. - * @param message RedirectAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RedirectAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedirectAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.RedirectAction; - - /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedirectAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.RedirectAction; - - /** - * Verifies a RedirectAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedirectAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.RedirectAction; - - /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. - * @param message RedirectAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.RedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RedirectAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RedirectAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TwowaySynonymsAction. */ - interface ITwowaySynonymsAction { - - /** TwowaySynonymsAction synonyms */ - synonyms?: (string[]|null); - } - - /** Represents a TwowaySynonymsAction. */ - class TwowaySynonymsAction implements ITwowaySynonymsAction { - - /** - * Constructs a new TwowaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction); - - /** TwowaySynonymsAction synonyms. */ - public synonyms: string[]; - - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TwowaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; - - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @param message TwowaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; - - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; - - /** - * Verifies a TwowaySynonymsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TwowaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction; + /** Properties of a ProductInlineSource. */ + interface IProductInlineSource { - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @param message TwowaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ProductInlineSource products */ + products?: (google.cloud.retail.v2alpha.IProduct[]|null); + } - /** - * Converts this TwowaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a ProductInlineSource. */ + class ProductInlineSource implements IProductInlineSource { - /** - * Gets the default type url for TwowaySynonymsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Constructs a new ProductInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IProductInlineSource); - /** Properties of an OnewaySynonymsAction. */ - interface IOnewaySynonymsAction { + /** ProductInlineSource products. */ + public products: google.cloud.retail.v2alpha.IProduct[]; - /** OnewaySynonymsAction queryTerms */ - queryTerms?: (string[]|null); + /** + * Creates a new ProductInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IProductInlineSource): google.cloud.retail.v2alpha.ProductInlineSource; - /** OnewaySynonymsAction synonyms */ - synonyms?: (string[]|null); + /** + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** OnewaySynonymsAction onewayTerms */ - onewayTerms?: (string[]|null); - } + /** + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * @param message ProductInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an OnewaySynonymsAction. */ - class OnewaySynonymsAction implements IOnewaySynonymsAction { + /** + * Decodes a ProductInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInlineSource; - /** - * Constructs a new OnewaySynonymsAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction); + /** + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInlineSource; - /** OnewaySynonymsAction queryTerms. */ - public queryTerms: string[]; + /** + * Verifies a ProductInlineSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** OnewaySynonymsAction synonyms. */ - public synonyms: string[]; + /** + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInlineSource; - /** OnewaySynonymsAction onewayTerms. */ - public onewayTerms: string[]; + /** + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. + * @param message ProductInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new OnewaySynonymsAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OnewaySynonymsAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** + * Converts this ProductInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Gets the default type url for ProductInlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. - * @param message OnewaySynonymsAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a UserEventInlineSource. */ + interface IUserEventInlineSource { - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** UserEventInlineSource userEvents */ + userEvents?: (google.cloud.retail.v2alpha.IUserEvent[]|null); + } - /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OnewaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** Represents a UserEventInlineSource. */ + class UserEventInlineSource implements IUserEventInlineSource { - /** - * Verifies an OnewaySynonymsAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new UserEventInlineSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource); - /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OnewaySynonymsAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction; + /** UserEventInlineSource userEvents. */ + public userEvents: google.cloud.retail.v2alpha.IUserEvent[]; - /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. - * @param message OnewaySynonymsAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new UserEventInlineSource instance using the specified properties. + * @param [properties] Properties to set + * @returns UserEventInlineSource instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource): google.cloud.retail.v2alpha.UserEventInlineSource; - /** - * Converts this OnewaySynonymsAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Gets the default type url for OnewaySynonymsAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @param message UserEventInlineSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a DoNotAssociateAction. */ - interface IDoNotAssociateAction { + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInlineSource; - /** DoNotAssociateAction queryTerms */ - queryTerms?: (string[]|null); + /** + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInlineSource; - /** DoNotAssociateAction doNotAssociateTerms */ - doNotAssociateTerms?: (string[]|null); + /** + * Verifies a UserEventInlineSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DoNotAssociateAction terms */ - terms?: (string[]|null); - } + /** + * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserEventInlineSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInlineSource; - /** Represents a DoNotAssociateAction. */ - class DoNotAssociateAction implements IDoNotAssociateAction { + /** + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * @param message UserEventInlineSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new DoNotAssociateAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction); + /** + * Converts this UserEventInlineSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** DoNotAssociateAction queryTerms. */ - public queryTerms: string[]; + /** + * Gets the default type url for UserEventInlineSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** DoNotAssociateAction doNotAssociateTerms. */ - public doNotAssociateTerms: string[]; + /** Properties of an ImportErrorsConfig. */ + interface IImportErrorsConfig { - /** DoNotAssociateAction terms. */ - public terms: string[]; + /** ImportErrorsConfig gcsPrefix */ + gcsPrefix?: (string|null); + } - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DoNotAssociateAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** Represents an ImportErrorsConfig. */ + class ImportErrorsConfig implements IImportErrorsConfig { - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ImportErrorsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig); - /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @param message DoNotAssociateAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportErrorsConfig gcsPrefix. */ + public gcsPrefix?: (string|null); - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** ImportErrorsConfig destination. */ + public destination?: "gcsPrefix"; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** + * Creates a new ImportErrorsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportErrorsConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig): google.cloud.retail.v2alpha.ImportErrorsConfig; - /** - * Verifies a DoNotAssociateAction message. - * @param message 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 ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoNotAssociateAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.DoNotAssociateAction; + /** + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @param message ImportErrorsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. - * @param message DoNotAssociateAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.DoNotAssociateAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportErrorsConfig; - /** - * Converts this DoNotAssociateAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportErrorsConfig; - /** - * Gets the default type url for DoNotAssociateAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Verifies an ImportErrorsConfig message. + * @param message 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 ReplacementAction. */ - interface IReplacementAction { + /** + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportErrorsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportErrorsConfig; - /** ReplacementAction queryTerms */ - queryTerms?: (string[]|null); + /** + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * @param message ImportErrorsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ReplacementAction replacementTerm */ - replacementTerm?: (string|null); + /** + * Converts this ImportErrorsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ReplacementAction term */ - term?: (string|null); - } + /** + * Gets the default type url for ImportErrorsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Represents a ReplacementAction. */ - class ReplacementAction implements IReplacementAction { + /** Properties of an ImportProductsRequest. */ + interface IImportProductsRequest { - /** - * Constructs a new ReplacementAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction); + /** ImportProductsRequest parent */ + parent?: (string|null); - /** ReplacementAction queryTerms. */ - public queryTerms: string[]; + /** ImportProductsRequest requestId */ + requestId?: (string|null); - /** ReplacementAction replacementTerm. */ - public replacementTerm: string; + /** ImportProductsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); - /** ReplacementAction term. */ - public term: string; + /** ImportProductsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - /** - * Creates a new ReplacementAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplacementAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IReplacementAction): google.cloud.retail.v2alpha.Rule.ReplacementAction; + /** ImportProductsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportProductsRequest reconciliationMode */ + reconciliationMode?: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null); - /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @param message ReplacementAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IReplacementAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImportProductsRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); - /** - * Decodes a ReplacementAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.ReplacementAction; + /** ImportProductsRequest skipDefaultBranchProtection */ + skipDefaultBranchProtection?: (boolean|null); + } - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.ReplacementAction; + /** Represents an ImportProductsRequest. */ + class ImportProductsRequest implements IImportProductsRequest { - /** - * Verifies a ReplacementAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new ImportProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IImportProductsRequest); - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplacementAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.ReplacementAction; + /** ImportProductsRequest parent. */ + public parent: string; - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @param message ReplacementAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.ReplacementAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportProductsRequest requestId. */ + public requestId: string; - /** - * Converts this ReplacementAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** ImportProductsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); - /** - * Gets the default type url for ReplacementAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** ImportProductsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - /** Properties of an IgnoreAction. */ - interface IIgnoreAction { + /** ImportProductsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** IgnoreAction ignoreTerms */ - ignoreTerms?: (string[]|null); - } + /** ImportProductsRequest reconciliationMode. */ + public reconciliationMode: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode); - /** Represents an IgnoreAction. */ - class IgnoreAction implements IIgnoreAction { + /** ImportProductsRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; - /** - * Constructs a new IgnoreAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction); + /** ImportProductsRequest skipDefaultBranchProtection. */ + public skipDefaultBranchProtection: boolean; + + /** + * Creates a new ImportProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProductsRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IImportProductsRequest): google.cloud.retail.v2alpha.ImportProductsRequest; - /** IgnoreAction ignoreTerms. */ - public ignoreTerms: string[]; + /** + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new IgnoreAction instance using the specified properties. - * @param [properties] Properties to set - * @returns IgnoreAction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Rule.IIgnoreAction): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * @param message ImportProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportProductsRequest; - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @param message IgnoreAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Rule.IIgnoreAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsRequest; - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Verifies an ImportProductsRequest message. + * @param message 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 IgnoreAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsRequest; - /** - * Verifies an IgnoreAction message. - * @param message Plain object 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 an ImportProductsRequest message. Also converts values to other types if specified. + * @param message ImportProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IgnoreAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rule.IgnoreAction; + /** + * Converts this ImportProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. - * @param message IgnoreAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Rule.IgnoreAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Gets the default type url for ImportProductsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Converts this IgnoreAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + namespace ImportProductsRequest { - /** - * Gets the default type url for IgnoreAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** ReconciliationMode enum. */ + enum ReconciliationMode { + RECONCILIATION_MODE_UNSPECIFIED = 0, + INCREMENTAL = 1, + FULL = 2 } } - /** Properties of an Audience. */ - interface IAudience { + /** Properties of an ImportUserEventsRequest. */ + interface IImportUserEventsRequest { - /** Audience genders */ - genders?: (string[]|null); + /** ImportUserEventsRequest parent */ + parent?: (string|null); - /** Audience ageGroups */ - ageGroups?: (string[]|null); + /** ImportUserEventsRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + + /** ImportUserEventsRequest errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); } - /** Represents an Audience. */ - class Audience implements IAudience { + /** Represents an ImportUserEventsRequest. */ + class ImportUserEventsRequest implements IImportUserEventsRequest { /** - * Constructs a new Audience. + * Constructs a new ImportUserEventsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAudience); + constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest); - /** Audience genders. */ - public genders: string[]; + /** ImportUserEventsRequest parent. */ + public parent: string; - /** Audience ageGroups. */ - public ageGroups: string[]; + /** ImportUserEventsRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + + /** ImportUserEventsRequest errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); /** - * Creates a new Audience instance using the specified properties. + * Creates a new ImportUserEventsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Audience instance + * @returns ImportUserEventsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAudience): google.cloud.retail.v2alpha.Audience; + public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @param message Audience message or plain object to encode + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. + * @param message ImportUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAudience, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Audience message from the specified reader or buffer. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Audience + * @returns ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Audience; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Decodes an Audience message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Audience + * @returns ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Audience; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Verifies an Audience message. + * Verifies an ImportUserEventsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Audience message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Audience + * @returns ImportUserEventsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Audience; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsRequest; /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. - * @param message Audience + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. + * @param message ImportUserEventsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Audience, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Audience to JSON. + * Converts this ImportUserEventsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Audience + * Gets the default type url for ImportUserEventsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ColorInfo. */ - interface IColorInfo { + /** Properties of an ImportCompletionDataRequest. */ + interface IImportCompletionDataRequest { - /** ColorInfo colorFamilies */ - colorFamilies?: (string[]|null); + /** ImportCompletionDataRequest parent */ + parent?: (string|null); - /** ColorInfo colors */ - colors?: (string[]|null); + /** ImportCompletionDataRequest inputConfig */ + inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** ImportCompletionDataRequest notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); } - /** Represents a ColorInfo. */ - class ColorInfo implements IColorInfo { + /** Represents an ImportCompletionDataRequest. */ + class ImportCompletionDataRequest implements IImportCompletionDataRequest { /** - * Constructs a new ColorInfo. + * Constructs a new ImportCompletionDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IColorInfo); + constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest); - /** ColorInfo colorFamilies. */ - public colorFamilies: string[]; + /** ImportCompletionDataRequest parent. */ + public parent: string; - /** ColorInfo colors. */ - public colors: string[]; + /** ImportCompletionDataRequest inputConfig. */ + public inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + + /** ImportCompletionDataRequest notificationPubsubTopic. */ + public notificationPubsubTopic: string; /** - * Creates a new ColorInfo instance using the specified properties. + * Creates a new ImportCompletionDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ColorInfo instance + * @returns ImportCompletionDataRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IColorInfo): google.cloud.retail.v2alpha.ColorInfo; + public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. - * @param message ColorInfo message or plain object to encode + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. + * @param message ImportCompletionDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ColorInfo message from the specified reader or buffer. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ColorInfo + * @returns ImportCompletionDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ColorInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Decodes a ColorInfo message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ColorInfo + * @returns ImportCompletionDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ColorInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Verifies a ColorInfo message. + * Verifies an ImportCompletionDataRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ColorInfo + * @returns ImportCompletionDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ColorInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataRequest; /** - * Creates a plain object from a ColorInfo message. Also converts values to other types if specified. - * @param message ColorInfo + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. + * @param message ImportCompletionDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ColorInfo to JSON. + * Converts this ImportCompletionDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ColorInfo + * Gets the default type url for ImportCompletionDataRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CustomAttribute. */ - interface ICustomAttribute { - - /** CustomAttribute text */ - text?: (string[]|null); + /** Properties of a ProductInputConfig. */ + interface IProductInputConfig { - /** CustomAttribute numbers */ - numbers?: (number[]|null); + /** ProductInputConfig productInlineSource */ + productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - /** CustomAttribute searchable */ - searchable?: (boolean|null); + /** ProductInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); - /** CustomAttribute indexable */ - indexable?: (boolean|null); + /** ProductInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents a CustomAttribute. */ - class CustomAttribute implements ICustomAttribute { + /** Represents a ProductInputConfig. */ + class ProductInputConfig implements IProductInputConfig { /** - * Constructs a new CustomAttribute. + * Constructs a new ProductInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICustomAttribute); - - /** CustomAttribute text. */ - public text: string[]; - - /** CustomAttribute numbers. */ - public numbers: number[]; + constructor(properties?: google.cloud.retail.v2alpha.IProductInputConfig); - /** CustomAttribute searchable. */ - public searchable?: (boolean|null); + /** ProductInputConfig productInlineSource. */ + public productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - /** CustomAttribute indexable. */ - public indexable?: (boolean|null); + /** ProductInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); - /** CustomAttribute _searchable. */ - public _searchable?: "searchable"; + /** ProductInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); - /** CustomAttribute _indexable. */ - public _indexable?: "indexable"; + /** ProductInputConfig source. */ + public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new CustomAttribute instance using the specified properties. + * Creates a new ProductInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CustomAttribute instance + * @returns ProductInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICustomAttribute): google.cloud.retail.v2alpha.CustomAttribute; + public static create(properties?: google.cloud.retail.v2alpha.IProductInputConfig): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * @param message ProductInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomAttribute message from the specified reader or buffer. + * Decodes a ProductInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomAttribute + * @returns ProductInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CustomAttribute; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomAttribute + * @returns ProductInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CustomAttribute; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Verifies a CustomAttribute message. + * Verifies a ProductInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomAttribute + * @returns ProductInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CustomAttribute; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInputConfig; /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @param message CustomAttribute + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * @param message ProductInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomAttribute to JSON. + * Converts this ProductInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CustomAttribute + * Gets the default type url for ProductInputConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FulfillmentInfo. */ - interface IFulfillmentInfo { + /** Properties of a UserEventInputConfig. */ + interface IUserEventInputConfig { - /** FulfillmentInfo type */ - type?: (string|null); + /** UserEventInputConfig userEventInlineSource */ + userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); - /** FulfillmentInfo placeIds */ - placeIds?: (string[]|null); + /** UserEventInputConfig gcsSource */ + gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + + /** UserEventInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents a FulfillmentInfo. */ - class FulfillmentInfo implements IFulfillmentInfo { + /** Represents a UserEventInputConfig. */ + class UserEventInputConfig implements IUserEventInputConfig { /** - * Constructs a new FulfillmentInfo. + * Constructs a new UserEventInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo); + constructor(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig); - /** FulfillmentInfo type. */ - public type: string; + /** UserEventInputConfig userEventInlineSource. */ + public userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); - /** FulfillmentInfo placeIds. */ - public placeIds: string[]; + /** UserEventInputConfig gcsSource. */ + public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + + /** UserEventInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + + /** UserEventInputConfig source. */ + public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); /** - * Creates a new FulfillmentInfo instance using the specified properties. + * Creates a new UserEventInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns FulfillmentInfo instance + * @returns UserEventInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IFulfillmentInfo): google.cloud.retail.v2alpha.FulfillmentInfo; + public static create(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Encodes the specified FulfillmentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FulfillmentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.FulfillmentInfo.verify|verify} messages. - * @param message FulfillmentInfo message or plain object to encode + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * @param message UserEventInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IFulfillmentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer. + * Decodes a UserEventInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FulfillmentInfo + * @returns UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.FulfillmentInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Decodes a FulfillmentInfo message from the specified reader or buffer, length delimited. + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FulfillmentInfo + * @returns UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.FulfillmentInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Verifies a FulfillmentInfo message. + * Verifies a UserEventInputConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FulfillmentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FulfillmentInfo + * @returns UserEventInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.FulfillmentInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInputConfig; /** - * Creates a plain object from a FulfillmentInfo message. Also converts values to other types if specified. - * @param message FulfillmentInfo + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * @param message UserEventInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.FulfillmentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FulfillmentInfo to JSON. + * Converts this UserEventInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FulfillmentInfo + * Gets the default type url for UserEventInputConfig * @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 uri */ - uri?: (string|null); - - /** Image height */ - height?: (number|null); + /** Properties of a CompletionDataInputConfig. */ + interface ICompletionDataInputConfig { - /** Image width */ - width?: (number|null); + /** CompletionDataInputConfig bigQuerySource */ + bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); } - /** Represents an Image. */ - class Image implements IImage { + /** Represents a CompletionDataInputConfig. */ + class CompletionDataInputConfig implements ICompletionDataInputConfig { /** - * Constructs a new Image. + * Constructs a new CompletionDataInputConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImage); - - /** Image uri. */ - public uri: string; + constructor(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig); - /** Image height. */ - public height: number; + /** CompletionDataInputConfig bigQuerySource. */ + public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); - /** Image width. */ - public width: number; + /** CompletionDataInputConfig source. */ + public source?: "bigQuerySource"; /** - * Creates a new Image instance using the specified properties. + * Creates a new CompletionDataInputConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Image instance + * @returns CompletionDataInputConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImage): google.cloud.retail.v2alpha.Image; + public static create(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Image.verify|verify} messages. - * @param message Image message or plain object to encode + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * @param message CompletionDataInputConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Image message from the specified reader or buffer. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Image + * @returns CompletionDataInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Image; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Decodes an Image message from the specified reader or buffer, length delimited. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Image + * @returns CompletionDataInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Image; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Verifies an Image message. + * Verifies a CompletionDataInputConfig message. * @param message Plain object 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. + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Image + * @returns CompletionDataInputConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Image; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDataInputConfig; /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * @param message CompletionDataInputConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Image to JSON. + * Converts this CompletionDataInputConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Image + * Gets the default type url for CompletionDataInputConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Interval. */ - interface IInterval { + /** Properties of an ImportMetadata. */ + interface IImportMetadata { - /** Interval minimum */ - minimum?: (number|null); + /** ImportMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** Interval exclusiveMinimum */ - exclusiveMinimum?: (number|null); + /** ImportMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** Interval maximum */ - maximum?: (number|null); + /** ImportMetadata successCount */ + successCount?: (number|Long|string|null); - /** Interval exclusiveMaximum */ - exclusiveMaximum?: (number|null); + /** ImportMetadata failureCount */ + failureCount?: (number|Long|string|null); + + /** ImportMetadata requestId */ + requestId?: (string|null); + + /** ImportMetadata notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** ImportMetadata transformedUserEventsMetadata */ + transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); } - /** Represents an Interval. */ - class Interval implements IInterval { + /** Represents an ImportMetadata. */ + class ImportMetadata implements IImportMetadata { /** - * Constructs a new Interval. + * Constructs a new ImportMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IInterval); + constructor(properties?: google.cloud.retail.v2alpha.IImportMetadata); - /** Interval minimum. */ - public minimum?: (number|null); + /** ImportMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** Interval exclusiveMinimum. */ - public exclusiveMinimum?: (number|null); + /** ImportMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** Interval maximum. */ - public maximum?: (number|null); + /** ImportMetadata successCount. */ + public successCount: (number|Long|string); - /** Interval exclusiveMaximum. */ - public exclusiveMaximum?: (number|null); + /** ImportMetadata failureCount. */ + public failureCount: (number|Long|string); - /** Interval min. */ - public min?: ("minimum"|"exclusiveMinimum"); + /** ImportMetadata requestId. */ + public requestId: string; - /** Interval max. */ - public max?: ("maximum"|"exclusiveMaximum"); + /** ImportMetadata notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** ImportMetadata transformedUserEventsMetadata. */ + public transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); /** - * Creates a new Interval instance using the specified properties. + * Creates a new ImportMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns Interval instance + * @returns ImportMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IInterval): google.cloud.retail.v2alpha.Interval; + public static create(properties?: google.cloud.retail.v2alpha.IImportMetadata): google.cloud.retail.v2alpha.ImportMetadata; /** - * Encodes the specified Interval message. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * @param message ImportMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Interval message from the specified reader or buffer. + * Decodes an ImportMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Interval + * @returns ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Interval; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportMetadata; /** - * Decodes an Interval message from the specified reader or buffer, length delimited. + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Interval + * @returns ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Interval; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportMetadata; /** - * Verifies an Interval message. + * Verifies an ImportMetadata message. * @param message Plain object 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. + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Interval + * @returns ImportMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Interval; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportMetadata; /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * @param message ImportMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Interval to JSON. + * Converts this ImportMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Interval + * Gets the default type url for ImportMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PriceInfo. */ - interface IPriceInfo { - - /** PriceInfo currencyCode */ - currencyCode?: (string|null); - - /** PriceInfo price */ - price?: (number|null); - - /** PriceInfo originalPrice */ - originalPrice?: (number|null); - - /** PriceInfo cost */ - cost?: (number|null); - - /** PriceInfo priceEffectiveTime */ - priceEffectiveTime?: (google.protobuf.ITimestamp|null); + /** Properties of a TransformedUserEventsMetadata. */ + interface ITransformedUserEventsMetadata { - /** PriceInfo priceExpireTime */ - priceExpireTime?: (google.protobuf.ITimestamp|null); + /** TransformedUserEventsMetadata sourceEventsCount */ + sourceEventsCount?: (number|Long|string|null); - /** PriceInfo priceRange */ - priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + /** TransformedUserEventsMetadata transformedEventsCount */ + transformedEventsCount?: (number|Long|string|null); } - /** Represents a PriceInfo. */ - class PriceInfo implements IPriceInfo { + /** Represents a TransformedUserEventsMetadata. */ + class TransformedUserEventsMetadata implements ITransformedUserEventsMetadata { /** - * Constructs a new PriceInfo. + * Constructs a new TransformedUserEventsMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPriceInfo); - - /** PriceInfo currencyCode. */ - public currencyCode: string; - - /** PriceInfo price. */ - public price: number; - - /** PriceInfo originalPrice. */ - public originalPrice: number; - - /** PriceInfo cost. */ - public cost: number; - - /** PriceInfo priceEffectiveTime. */ - public priceEffectiveTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata); - /** PriceInfo priceExpireTime. */ - public priceExpireTime?: (google.protobuf.ITimestamp|null); + /** TransformedUserEventsMetadata sourceEventsCount. */ + public sourceEventsCount: (number|Long|string); - /** PriceInfo priceRange. */ - public priceRange?: (google.cloud.retail.v2alpha.PriceInfo.IPriceRange|null); + /** TransformedUserEventsMetadata transformedEventsCount. */ + public transformedEventsCount: (number|Long|string); /** - * Creates a new PriceInfo instance using the specified properties. + * Creates a new TransformedUserEventsMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PriceInfo instance + * @returns TransformedUserEventsMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPriceInfo): google.cloud.retail.v2alpha.PriceInfo; + public static create(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; /** - * Encodes the specified PriceInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @param message TransformedUserEventsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PriceInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.verify|verify} messages. - * @param message PriceInfo message or plain object to encode + * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * @param message TransformedUserEventsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPriceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PriceInfo message from the specified reader or buffer. + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PriceInfo + * @returns TransformedUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PriceInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; /** - * Decodes a PriceInfo message from the specified reader or buffer, length delimited. + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PriceInfo + * @returns TransformedUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PriceInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; /** - * Verifies a PriceInfo message. + * Verifies a TransformedUserEventsMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PriceInfo message from a plain object. Also converts values to their respective internal types. + * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PriceInfo + * @returns TransformedUserEventsMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; /** - * Creates a plain object from a PriceInfo message. Also converts values to other types if specified. - * @param message PriceInfo + * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. + * @param message TransformedUserEventsMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PriceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.TransformedUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PriceInfo to JSON. + * Converts this TransformedUserEventsMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PriceInfo + * Gets the default type url for TransformedUserEventsMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace PriceInfo { - - /** Properties of a PriceRange. */ - interface IPriceRange { - - /** PriceRange price */ - price?: (google.cloud.retail.v2alpha.IInterval|null); - - /** PriceRange originalPrice */ - originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); - } - - /** Represents a PriceRange. */ - class PriceRange implements IPriceRange { - - /** - * Constructs a new PriceRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange); - - /** PriceRange price. */ - public price?: (google.cloud.retail.v2alpha.IInterval|null); - - /** PriceRange originalPrice. */ - public originalPrice?: (google.cloud.retail.v2alpha.IInterval|null); - - /** - * Creates a new PriceRange instance using the specified properties. - * @param [properties] Properties to set - * @returns PriceRange instance - */ - public static create(properties?: google.cloud.retail.v2alpha.PriceInfo.IPriceRange): google.cloud.retail.v2alpha.PriceInfo.PriceRange; - - /** - * Encodes the specified PriceRange message. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PriceRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PriceInfo.PriceRange.verify|verify} messages. - * @param message PriceRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.PriceInfo.IPriceRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PriceRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PriceRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PriceInfo.PriceRange; - - /** - * Decodes a PriceRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PriceRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PriceInfo.PriceRange; - - /** - * Verifies a PriceRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PriceRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PriceRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PriceInfo.PriceRange; - - /** - * Creates a plain object from a PriceRange message. Also converts values to other types if specified. - * @param message PriceRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.PriceInfo.PriceRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PriceRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PriceRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Rating. */ - interface IRating { - - /** Rating ratingCount */ - ratingCount?: (number|null); + /** Properties of an ImportProductsResponse. */ + interface IImportProductsResponse { - /** Rating averageRating */ - averageRating?: (number|null); + /** ImportProductsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** Rating ratingHistogram */ - ratingHistogram?: (number[]|null); + /** ImportProductsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); } - /** Represents a Rating. */ - class Rating implements IRating { + /** Represents an ImportProductsResponse. */ + class ImportProductsResponse implements IImportProductsResponse { /** - * Constructs a new Rating. + * Constructs a new ImportProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRating); - - /** Rating ratingCount. */ - public ratingCount: number; + constructor(properties?: google.cloud.retail.v2alpha.IImportProductsResponse); - /** Rating averageRating. */ - public averageRating: number; + /** ImportProductsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** Rating ratingHistogram. */ - public ratingHistogram: number[]; + /** ImportProductsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); /** - * Creates a new Rating instance using the specified properties. + * Creates a new ImportProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Rating instance + * @returns ImportProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRating): google.cloud.retail.v2alpha.Rating; + public static create(properties?: google.cloud.retail.v2alpha.IImportProductsResponse): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Encodes the specified Rating message. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Rating message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rating.verify|verify} messages. - * @param message Rating message or plain object to encode + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * @param message ImportProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRating, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Rating message from the specified reader or buffer. + * Decodes an ImportProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Rating + * @returns ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Rating; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Decodes a Rating message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Rating + * @returns ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Rating; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Verifies a Rating message. + * Verifies an ImportProductsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Rating message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Rating + * @returns ImportProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Rating; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsResponse; /** - * Creates a plain object from a Rating message. Also converts values to other types if specified. - * @param message Rating + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * @param message ImportProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Rating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Rating to JSON. + * Converts this ImportProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Rating + * Gets the default type url for ImportProductsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a UserInfo. */ - interface IUserInfo { - - /** UserInfo userId */ - userId?: (string|null); + /** Properties of an ImportUserEventsResponse. */ + interface IImportUserEventsResponse { - /** UserInfo ipAddress */ - ipAddress?: (string|null); + /** ImportUserEventsResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); - /** UserInfo userAgent */ - userAgent?: (string|null); + /** ImportUserEventsResponse errorsConfig */ + errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - /** UserInfo directUserRequest */ - directUserRequest?: (boolean|null); + /** ImportUserEventsResponse importSummary */ + importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); } - /** Represents a UserInfo. */ - class UserInfo implements IUserInfo { + /** Represents an ImportUserEventsResponse. */ + class ImportUserEventsResponse implements IImportUserEventsResponse { /** - * Constructs a new UserInfo. + * Constructs a new ImportUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserInfo); - - /** UserInfo userId. */ - public userId: string; + constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse); - /** UserInfo ipAddress. */ - public ipAddress: string; + /** ImportUserEventsResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; - /** UserInfo userAgent. */ - public userAgent: string; + /** ImportUserEventsResponse errorsConfig. */ + public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - /** UserInfo directUserRequest. */ - public directUserRequest: boolean; + /** ImportUserEventsResponse importSummary. */ + public importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); /** - * Creates a new UserInfo instance using the specified properties. + * Creates a new ImportUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UserInfo instance + * @returns ImportUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserInfo): google.cloud.retail.v2alpha.UserInfo; + public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Encodes the specified UserInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserInfo.verify|verify} messages. - * @param message UserInfo message or plain object to encode + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * @param message ImportUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserInfo message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserInfo + * @returns ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Decodes a UserInfo message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserInfo + * @returns ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Verifies a UserInfo message. + * Verifies an ImportUserEventsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserInfo message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserInfo + * @returns ImportUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsResponse; /** - * Creates a plain object from a UserInfo message. Also converts values to other types if specified. - * @param message UserInfo + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * @param message ImportUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserInfo to JSON. + * Converts this ImportUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UserInfo + * Gets the default type url for ImportUserEventsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LocalInventory. */ - interface ILocalInventory { - - /** LocalInventory placeId */ - placeId?: (string|null); - - /** LocalInventory priceInfo */ - priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + /** Properties of a UserEventImportSummary. */ + interface IUserEventImportSummary { - /** LocalInventory attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** UserEventImportSummary joinedEventsCount */ + joinedEventsCount?: (number|Long|string|null); - /** LocalInventory fulfillmentTypes */ - fulfillmentTypes?: (string[]|null); + /** UserEventImportSummary unjoinedEventsCount */ + unjoinedEventsCount?: (number|Long|string|null); } - /** Represents a LocalInventory. */ - class LocalInventory implements ILocalInventory { + /** Represents a UserEventImportSummary. */ + class UserEventImportSummary implements IUserEventImportSummary { /** - * Constructs a new LocalInventory. + * Constructs a new UserEventImportSummary. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ILocalInventory); - - /** LocalInventory placeId. */ - public placeId: string; - - /** LocalInventory priceInfo. */ - public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); + constructor(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary); - /** LocalInventory attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + /** UserEventImportSummary joinedEventsCount. */ + public joinedEventsCount: (number|Long|string); - /** LocalInventory fulfillmentTypes. */ - public fulfillmentTypes: string[]; + /** UserEventImportSummary unjoinedEventsCount. */ + public unjoinedEventsCount: (number|Long|string); /** - * Creates a new LocalInventory instance using the specified properties. + * Creates a new UserEventImportSummary instance using the specified properties. * @param [properties] Properties to set - * @returns LocalInventory instance + * @returns UserEventImportSummary instance */ - public static create(properties?: google.cloud.retail.v2alpha.ILocalInventory): google.cloud.retail.v2alpha.LocalInventory; + public static create(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Encodes the specified LocalInventory message. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. - * @param message LocalInventory message or plain object to encode + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LocalInventory message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LocalInventory.verify|verify} messages. - * @param message LocalInventory message or plain object to encode + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * @param message UserEventImportSummary message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ILocalInventory, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocalInventory message from the specified reader or buffer. + * Decodes a UserEventImportSummary message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocalInventory + * @returns UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LocalInventory; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Decodes a LocalInventory message from the specified reader or buffer, length delimited. + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocalInventory + * @returns UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LocalInventory; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Verifies a LocalInventory message. + * Verifies a UserEventImportSummary message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LocalInventory message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocalInventory + * @returns UserEventImportSummary */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LocalInventory; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventImportSummary; /** - * Creates a plain object from a LocalInventory message. Also converts values to other types if specified. - * @param message LocalInventory + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * @param message UserEventImportSummary * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.LocalInventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocalInventory to JSON. + * Converts this UserEventImportSummary to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LocalInventory + * Gets the default type url for UserEventImportSummary * @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); + /** Properties of an ImportCompletionDataResponse. */ + interface IImportCompletionDataResponse { - /** GcsSource dataSchema */ - dataSchema?: (string|null); + /** ImportCompletionDataResponse errorSamples */ + errorSamples?: (google.rpc.IStatus[]|null); } - /** Represents a GcsSource. */ - class GcsSource implements IGcsSource { + /** Represents an ImportCompletionDataResponse. */ + class ImportCompletionDataResponse implements IImportCompletionDataResponse { /** - * Constructs a new GcsSource. + * Constructs a new ImportCompletionDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGcsSource); - - /** GcsSource inputUris. */ - public inputUris: string[]; + constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse); - /** GcsSource dataSchema. */ - public dataSchema: string; + /** ImportCompletionDataResponse errorSamples. */ + public errorSamples: google.rpc.IStatus[]; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new ImportCompletionDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GcsSource instance + * @returns ImportCompletionDataResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGcsSource): google.cloud.retail.v2alpha.GcsSource; + public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * @param message ImportCompletionDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsSource + * @returns ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GcsSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsSource + * @returns ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GcsSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Verifies a GcsSource message. + * Verifies an ImportCompletionDataResponse message. * @param message Plain object 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. + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsSource + * @returns ImportCompletionDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GcsSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataResponse; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. - * @param message GcsSource + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * @param message ImportCompletionDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsSource to JSON. + * Converts this ImportCompletionDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GcsSource + * Gets the default type url for ImportCompletionDataResponse * @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 { + /** Properties of a UserEvent. */ + interface IUserEvent { - /** BigQuerySource partitionDate */ - partitionDate?: (google.type.IDate|null); + /** UserEvent eventType */ + eventType?: (string|null); - /** BigQuerySource projectId */ - projectId?: (string|null); + /** UserEvent visitorId */ + visitorId?: (string|null); - /** BigQuerySource datasetId */ - datasetId?: (string|null); + /** UserEvent sessionId */ + sessionId?: (string|null); - /** BigQuerySource tableId */ - tableId?: (string|null); + /** UserEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); - /** BigQuerySource gcsStagingDir */ - gcsStagingDir?: (string|null); + /** UserEvent experimentIds */ + experimentIds?: (string[]|null); - /** BigQuerySource dataSchema */ - dataSchema?: (string|null); + /** UserEvent attributionToken */ + attributionToken?: (string|null); + + /** UserEvent productDetails */ + productDetails?: (google.cloud.retail.v2alpha.IProductDetail[]|null); + + /** UserEvent completionDetail */ + completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + + /** UserEvent attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + + /** UserEvent cartId */ + cartId?: (string|null); + + /** UserEvent purchaseTransaction */ + purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + + /** UserEvent searchQuery */ + searchQuery?: (string|null); + + /** UserEvent filter */ + filter?: (string|null); + + /** UserEvent orderBy */ + orderBy?: (string|null); + + /** UserEvent offset */ + offset?: (number|null); + + /** UserEvent pageCategories */ + pageCategories?: (string[]|null); + + /** UserEvent userInfo */ + userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + + /** UserEvent uri */ + uri?: (string|null); + + /** UserEvent referrerUri */ + referrerUri?: (string|null); + + /** UserEvent pageViewId */ + pageViewId?: (string|null); + + /** UserEvent entity */ + entity?: (string|null); } - /** Represents a BigQuerySource. */ - class BigQuerySource implements IBigQuerySource { + /** Represents a UserEvent. */ + class UserEvent implements IUserEvent { /** - * Constructs a new BigQuerySource. + * Constructs a new UserEvent. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IBigQuerySource); + constructor(properties?: google.cloud.retail.v2alpha.IUserEvent); - /** BigQuerySource partitionDate. */ - public partitionDate?: (google.type.IDate|null); + /** UserEvent eventType. */ + public eventType: string; - /** BigQuerySource projectId. */ - public projectId: string; + /** UserEvent visitorId. */ + public visitorId: string; - /** BigQuerySource datasetId. */ - public datasetId: string; + /** UserEvent sessionId. */ + public sessionId: string; - /** BigQuerySource tableId. */ - public tableId: string; + /** UserEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); - /** BigQuerySource gcsStagingDir. */ - public gcsStagingDir: string; + /** UserEvent experimentIds. */ + public experimentIds: string[]; - /** BigQuerySource dataSchema. */ - public dataSchema: string; + /** UserEvent attributionToken. */ + public attributionToken: string; - /** BigQuerySource partition. */ - public partition?: "partitionDate"; + /** UserEvent productDetails. */ + public productDetails: google.cloud.retail.v2alpha.IProductDetail[]; + + /** UserEvent completionDetail. */ + public completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + + /** UserEvent attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + + /** UserEvent cartId. */ + public cartId: string; + + /** UserEvent purchaseTransaction. */ + public purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + + /** UserEvent searchQuery. */ + public searchQuery: string; + + /** UserEvent filter. */ + public filter: string; + + /** UserEvent orderBy. */ + public orderBy: string; + + /** UserEvent offset. */ + public offset: number; + + /** UserEvent pageCategories. */ + public pageCategories: string[]; + + /** UserEvent userInfo. */ + public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + + /** UserEvent uri. */ + public uri: string; + + /** UserEvent referrerUri. */ + public referrerUri: string; + + /** UserEvent pageViewId. */ + public pageViewId: string; + + /** UserEvent entity. */ + public entity: string; /** - * Creates a new BigQuerySource instance using the specified properties. + * Creates a new UserEvent instance using the specified properties. * @param [properties] Properties to set - * @returns BigQuerySource instance + * @returns UserEvent instance */ - public static create(properties?: google.cloud.retail.v2alpha.IBigQuerySource): google.cloud.retail.v2alpha.BigQuerySource; + public static create(properties?: google.cloud.retail.v2alpha.IUserEvent): google.cloud.retail.v2alpha.UserEvent; /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. - * @param message BigQuerySource message or plain object to encode + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * @param message UserEvent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BigQuerySource message from the specified reader or buffer. + * Decodes a UserEvent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BigQuerySource + * @returns UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BigQuerySource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEvent; /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * Decodes a UserEvent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BigQuerySource + * @returns UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BigQuerySource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEvent; /** - * Verifies a BigQuerySource message. + * Verifies a UserEvent message. * @param message Plain object 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. + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BigQuerySource + * @returns UserEvent */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BigQuerySource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEvent; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. - * @param message BigQuerySource + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * @param message UserEvent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BigQuerySource to JSON. + * Converts this UserEvent to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BigQuerySource + * Gets the default type url for UserEvent * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ProductInlineSource. */ - interface IProductInlineSource { + /** Properties of a ProductDetail. */ + interface IProductDetail { - /** ProductInlineSource products */ - products?: (google.cloud.retail.v2alpha.IProduct[]|null); + /** ProductDetail product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** ProductDetail quantity */ + quantity?: (google.protobuf.IInt32Value|null); } - /** Represents a ProductInlineSource. */ - class ProductInlineSource implements IProductInlineSource { + /** Represents a ProductDetail. */ + class ProductDetail implements IProductDetail { /** - * Constructs a new ProductInlineSource. + * Constructs a new ProductDetail. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductInlineSource); + constructor(properties?: google.cloud.retail.v2alpha.IProductDetail); - /** ProductInlineSource products. */ - public products: google.cloud.retail.v2alpha.IProduct[]; + /** ProductDetail product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** ProductDetail quantity. */ + public quantity?: (google.protobuf.IInt32Value|null); /** - * Creates a new ProductInlineSource instance using the specified properties. + * Creates a new ProductDetail instance using the specified properties. * @param [properties] Properties to set - * @returns ProductInlineSource instance + * @returns ProductDetail instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductInlineSource): google.cloud.retail.v2alpha.ProductInlineSource; + public static create(properties?: google.cloud.retail.v2alpha.IProductDetail): google.cloud.retail.v2alpha.ProductDetail; /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. - * @param message ProductInlineSource message or plain object to encode + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * @param message ProductDetail message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductInlineSource message from the specified reader or buffer. + * Decodes a ProductDetail message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductInlineSource + * @returns ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInlineSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductDetail; /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductInlineSource + * @returns ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInlineSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductDetail; /** - * Verifies a ProductInlineSource message. + * Verifies a ProductDetail message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductInlineSource + * @returns ProductDetail */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInlineSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductDetail; /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. - * @param message ProductInlineSource + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * @param message ProductDetail * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductInlineSource to JSON. + * Converts this ProductDetail to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ProductInlineSource + * Gets the default type url for ProductDetail * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a UserEventInlineSource. */ - interface IUserEventInlineSource { + /** Properties of a CompletionDetail. */ + interface ICompletionDetail { - /** UserEventInlineSource userEvents */ - userEvents?: (google.cloud.retail.v2alpha.IUserEvent[]|null); + /** CompletionDetail completionAttributionToken */ + completionAttributionToken?: (string|null); + + /** CompletionDetail selectedSuggestion */ + selectedSuggestion?: (string|null); + + /** CompletionDetail selectedPosition */ + selectedPosition?: (number|null); } - /** Represents a UserEventInlineSource. */ - class UserEventInlineSource implements IUserEventInlineSource { + /** Represents a CompletionDetail. */ + class CompletionDetail implements ICompletionDetail { /** - * Constructs a new UserEventInlineSource. + * Constructs a new CompletionDetail. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource); + constructor(properties?: google.cloud.retail.v2alpha.ICompletionDetail); - /** UserEventInlineSource userEvents. */ - public userEvents: google.cloud.retail.v2alpha.IUserEvent[]; + /** CompletionDetail completionAttributionToken. */ + public completionAttributionToken: string; + + /** CompletionDetail selectedSuggestion. */ + public selectedSuggestion: string; + + /** CompletionDetail selectedPosition. */ + public selectedPosition: number; /** - * Creates a new UserEventInlineSource instance using the specified properties. + * Creates a new CompletionDetail instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventInlineSource instance + * @returns CompletionDetail instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventInlineSource): google.cloud.retail.v2alpha.UserEventInlineSource; + public static create(properties?: google.cloud.retail.v2alpha.ICompletionDetail): google.cloud.retail.v2alpha.CompletionDetail; /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. - * @param message UserEventInlineSource message or plain object to encode + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * @param message CompletionDetail message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInlineSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. + * Decodes a CompletionDetail message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventInlineSource + * @returns CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInlineSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionDetail; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventInlineSource + * @returns CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInlineSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionDetail; /** - * Verifies a UserEventInlineSource message. + * Verifies a CompletionDetail message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventInlineSource + * @returns CompletionDetail */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInlineSource; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDetail; /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. - * @param message UserEventInlineSource + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * @param message CompletionDetail * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventInlineSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventInlineSource to JSON. + * Converts this CompletionDetail to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UserEventInlineSource + * Gets the default type url for CompletionDetail * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportErrorsConfig. */ - interface IImportErrorsConfig { + /** Properties of a PurchaseTransaction. */ + interface IPurchaseTransaction { - /** ImportErrorsConfig gcsPrefix */ - gcsPrefix?: (string|null); + /** PurchaseTransaction id */ + id?: (string|null); + + /** PurchaseTransaction revenue */ + revenue?: (number|null); + + /** PurchaseTransaction tax */ + tax?: (number|null); + + /** PurchaseTransaction cost */ + cost?: (number|null); + + /** PurchaseTransaction currencyCode */ + currencyCode?: (string|null); } - /** Represents an ImportErrorsConfig. */ - class ImportErrorsConfig implements IImportErrorsConfig { + /** Represents a PurchaseTransaction. */ + class PurchaseTransaction implements IPurchaseTransaction { /** - * Constructs a new ImportErrorsConfig. + * Constructs a new PurchaseTransaction. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig); + constructor(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction); - /** ImportErrorsConfig gcsPrefix. */ - public gcsPrefix?: (string|null); + /** PurchaseTransaction id. */ + public id: string; - /** ImportErrorsConfig destination. */ - public destination?: "gcsPrefix"; + /** PurchaseTransaction revenue. */ + public revenue: number; + + /** PurchaseTransaction tax. */ + public tax: number; + + /** PurchaseTransaction cost. */ + public cost: number; + + /** PurchaseTransaction currencyCode. */ + public currencyCode: string; /** - * Creates a new ImportErrorsConfig instance using the specified properties. + * Creates a new PurchaseTransaction instance using the specified properties. * @param [properties] Properties to set - * @returns ImportErrorsConfig instance + * @returns PurchaseTransaction instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportErrorsConfig): google.cloud.retail.v2alpha.ImportErrorsConfig; + public static create(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction): google.cloud.retail.v2alpha.PurchaseTransaction; /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. - * @param message ImportErrorsConfig message or plain object to encode + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * @param message PurchaseTransaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportErrorsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * Decodes a PurchaseTransaction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportErrorsConfig + * @returns PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportErrorsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurchaseTransaction; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportErrorsConfig + * @returns PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportErrorsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurchaseTransaction; /** - * Verifies an ImportErrorsConfig message. + * Verifies a PurchaseTransaction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportErrorsConfig + * @returns PurchaseTransaction */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportErrorsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurchaseTransaction; /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. - * @param message ImportErrorsConfig + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * @param message PurchaseTransaction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportErrorsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportErrorsConfig to JSON. + * Converts this PurchaseTransaction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportErrorsConfig + * Gets the default type url for PurchaseTransaction * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportProductsRequest. */ - interface IImportProductsRequest { - - /** ImportProductsRequest parent */ - parent?: (string|null); - - /** ImportProductsRequest requestId */ - requestId?: (string|null); - - /** ImportProductsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); - - /** ImportProductsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); - - /** ImportProductsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** ImportProductsRequest reconciliationMode */ - reconciliationMode?: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null); - - /** ImportProductsRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); - - /** ImportProductsRequest skipDefaultBranchProtection */ - skipDefaultBranchProtection?: (boolean|null); - } + /** Represents a CatalogService */ + class CatalogService extends $protobuf.rpc.Service { - /** Represents an ImportProductsRequest. */ - class ImportProductsRequest implements IImportProductsRequest { + /** + * Constructs a new CatalogService 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); /** - * Constructs a new ImportProductsRequest. - * @param [properties] Properties to set + * Creates new CatalogService 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. */ - constructor(properties?: google.cloud.retail.v2alpha.IImportProductsRequest); + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CatalogService; - /** ImportProductsRequest parent. */ - public parent: string; + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse + */ + public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest, callback: google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback): void; - /** ImportProductsRequest requestId. */ - public requestId: string; + /** + * Calls ListCatalogs. + * @param request ListCatalogsRequest message or plain object + * @returns Promise + */ + public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest): Promise; - /** ImportProductsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.IProductInputConfig|null); + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Catalog + */ + public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback): void; - /** ImportProductsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** + * Calls UpdateCatalog. + * @param request UpdateCatalogRequest message or plain object + * @returns Promise + */ + public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest): Promise; - /** ImportProductsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback): void; - /** ImportProductsRequest reconciliationMode. */ - public reconciliationMode: (google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|keyof typeof google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode); + /** + * Calls SetDefaultBranch. + * @param request SetDefaultBranchRequest message or plain object + * @returns Promise + */ + public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): Promise; - /** ImportProductsRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + */ + public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback): void; - /** ImportProductsRequest skipDefaultBranchProtection. */ - public skipDefaultBranchProtection: boolean; + /** + * Calls GetDefaultBranch. + * @param request GetDefaultBranchRequest message or plain object + * @returns Promise + */ + public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): Promise; /** - * Creates a new ImportProductsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportProductsRequest instance + * Calls GetCompletionConfig. + * @param request GetCompletionConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompletionConfig */ - public static create(properties?: google.cloud.retail.v2alpha.IImportProductsRequest): google.cloud.retail.v2alpha.ImportProductsRequest; + public getCompletionConfig(request: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetCompletionConfigCallback): void; /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetCompletionConfig. + * @param request GetCompletionConfigRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getCompletionConfig(request: google.cloud.retail.v2alpha.IGetCompletionConfigRequest): Promise; /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. - * @param message ImportProductsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls UpdateCompletionConfig. + * @param request UpdateCompletionConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompletionConfig */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public updateCompletionConfig(request: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfigCallback): void; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportProductsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateCompletionConfig. + * @param request UpdateCompletionConfigRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportProductsRequest; + public updateCompletionConfig(request: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest): Promise; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportProductsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetAttributesConfig. + * @param request GetAttributesConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsRequest; + public getAttributesConfig(request: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetAttributesConfigCallback): void; /** - * Verifies an ImportProductsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls GetAttributesConfig. + * @param request GetAttributesConfigRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public getAttributesConfig(request: google.cloud.retail.v2alpha.IGetAttributesConfigRequest): Promise; /** - * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportProductsRequest + * Calls UpdateAttributesConfig. + * @param request UpdateAttributesConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsRequest; + public updateAttributesConfig(request: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfigCallback): void; /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. - * @param message ImportProductsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateAttributesConfig. + * @param request UpdateAttributesConfigRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2alpha.ImportProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateAttributesConfig(request: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest): Promise; /** - * Converts this ImportProductsRequest to JSON. - * @returns JSON object + * Calls AddCatalogAttribute. + * @param request AddCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig */ - public toJSON(): { [k: string]: any }; + public addCatalogAttribute(request: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.AddCatalogAttributeCallback): void; /** - * Gets the default type url for ImportProductsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls AddCatalogAttribute. + * @param request AddCatalogAttributeRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public addCatalogAttribute(request: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest): Promise; - namespace ImportProductsRequest { + /** + * Calls RemoveCatalogAttribute. + * @param request RemoveCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig + */ + public removeCatalogAttribute(request: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttributeCallback): void; - /** ReconciliationMode enum. */ - enum ReconciliationMode { - RECONCILIATION_MODE_UNSPECIFIED = 0, - INCREMENTAL = 1, - FULL = 2 - } - } + /** + * Calls RemoveCatalogAttribute. + * @param request RemoveCatalogAttributeRequest message or plain object + * @returns Promise + */ + public removeCatalogAttribute(request: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): Promise; - /** Properties of an ImportUserEventsRequest. */ - interface IImportUserEventsRequest { + /** + * Calls BatchRemoveCatalogAttributes. + * @param request BatchRemoveCatalogAttributesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse + */ + public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, callback: google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback): void; - /** ImportUserEventsRequest parent */ - parent?: (string|null); + /** + * Calls BatchRemoveCatalogAttributes. + * @param request BatchRemoveCatalogAttributesRequest message or plain object + * @returns Promise + */ + public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): Promise; - /** ImportUserEventsRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + /** + * Calls ReplaceCatalogAttribute. + * @param request ReplaceCatalogAttributeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AttributesConfig + */ + public replaceCatalogAttribute(request: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttributeCallback): void; - /** ImportUserEventsRequest errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** + * Calls ReplaceCatalogAttribute. + * @param request ReplaceCatalogAttributeRequest message or plain object + * @returns Promise + */ + public replaceCatalogAttribute(request: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest): Promise; } - /** Represents an ImportUserEventsRequest. */ - class ImportUserEventsRequest implements IImportUserEventsRequest { + namespace CatalogService { /** - * Constructs a new ImportUserEventsRequest. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|listCatalogs}. + * @param error Error, if any + * @param [response] ListCatalogsResponse */ - constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest); - - /** ImportUserEventsRequest parent. */ - public parent: string; - - /** ImportUserEventsRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.IUserEventInputConfig|null); + type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListCatalogsResponse) => void; - /** ImportUserEventsRequest errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCatalog}. + * @param error Error, if any + * @param [response] Catalog + */ + type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Catalog) => void; /** - * Creates a new ImportUserEventsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportUserEventsRequest instance + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|setDefaultBranch}. + * @param error Error, if any + * @param [response] Empty */ - public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsRequest): google.cloud.retail.v2alpha.ImportUserEventsRequest; + type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getDefaultBranch}. + * @param error Error, if any + * @param [response] GetDefaultBranchResponse */ - public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.GetDefaultBranchResponse) => void; /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @param message ImportUserEventsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getCompletionConfig}. + * @param error Error, if any + * @param [response] CompletionConfig */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompletionConfig) => void; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCompletionConfig}. + * @param error Error, if any + * @param [response] CompletionConfig */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsRequest; + type UpdateCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompletionConfig) => void; /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getAttributesConfig}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsRequest; + type GetAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; /** - * Verifies an ImportUserEventsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateAttributesConfig}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static verify(message: { [k: string]: any }): (string|null); + type UpdateAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportUserEventsRequest + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|addCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsRequest; + type AddCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @param message ImportUserEventsRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|removeCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type RemoveCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; /** - * Converts this ImportUserEventsRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. + * @param error Error, if any + * @param [response] BatchRemoveCatalogAttributesResponse */ - public toJSON(): { [k: string]: any }; + type BatchRemoveCatalogAttributesCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) => void; /** - * Gets the default type url for ImportUserEventsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. + * @param error Error, if any + * @param [response] AttributesConfig */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type ReplaceCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; } - /** Properties of an ImportCompletionDataRequest. */ - interface IImportCompletionDataRequest { + /** Properties of a ListCatalogsRequest. */ + interface IListCatalogsRequest { - /** ImportCompletionDataRequest parent */ + /** ListCatalogsRequest parent */ parent?: (string|null); - /** ImportCompletionDataRequest inputConfig */ - inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** ListCatalogsRequest pageSize */ + pageSize?: (number|null); - /** ImportCompletionDataRequest notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** ListCatalogsRequest pageToken */ + pageToken?: (string|null); } - /** Represents an ImportCompletionDataRequest. */ - class ImportCompletionDataRequest implements IImportCompletionDataRequest { + /** Represents a ListCatalogsRequest. */ + class ListCatalogsRequest implements IListCatalogsRequest { /** - * Constructs a new ImportCompletionDataRequest. + * Constructs a new ListCatalogsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest); + constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest); - /** ImportCompletionDataRequest parent. */ + /** ListCatalogsRequest parent. */ public parent: string; - /** ImportCompletionDataRequest inputConfig. */ - public inputConfig?: (google.cloud.retail.v2alpha.ICompletionDataInputConfig|null); + /** ListCatalogsRequest pageSize. */ + public pageSize: number; - /** ImportCompletionDataRequest notificationPubsubTopic. */ - public notificationPubsubTopic: string; + /** ListCatalogsRequest pageToken. */ + public pageToken: string; /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. + * Creates a new ListCatalogsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportCompletionDataRequest instance + * @returns ListCatalogsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataRequest): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest): google.cloud.retail.v2alpha.ListCatalogsRequest; /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @param message ImportCompletionDataRequest message or plain object to encode + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * @param message ListCatalogsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. + * Decodes a ListCatalogsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportCompletionDataRequest + * @returns ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListCatalogsRequest; /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataRequest + * @returns ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListCatalogsRequest; /** - * Verifies an ImportCompletionDataRequest message. + * Verifies a ListCatalogsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportCompletionDataRequest + * @returns ListCatalogsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsRequest; /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. - * @param message ImportCompletionDataRequest + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. + * @param message ListCatalogsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportCompletionDataRequest to JSON. + * Converts this ListCatalogsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportCompletionDataRequest + * Gets the default type url for ListCatalogsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ProductInputConfig. */ - interface IProductInputConfig { - - /** ProductInputConfig productInlineSource */ - productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); + /** Properties of a ListCatalogsResponse. */ + interface IListCatalogsResponse { - /** ProductInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + /** ListCatalogsResponse catalogs */ + catalogs?: (google.cloud.retail.v2alpha.ICatalog[]|null); - /** ProductInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListCatalogsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a ProductInputConfig. */ - class ProductInputConfig implements IProductInputConfig { + /** Represents a ListCatalogsResponse. */ + class ListCatalogsResponse implements IListCatalogsResponse { /** - * Constructs a new ProductInputConfig. + * Constructs a new ListCatalogsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductInputConfig); - - /** ProductInputConfig productInlineSource. */ - public productInlineSource?: (google.cloud.retail.v2alpha.IProductInlineSource|null); - - /** ProductInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse); - /** ProductInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** ListCatalogsResponse catalogs. */ + public catalogs: google.cloud.retail.v2alpha.ICatalog[]; - /** ProductInputConfig source. */ - public source?: ("productInlineSource"|"gcsSource"|"bigQuerySource"); + /** ListCatalogsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ProductInputConfig instance using the specified properties. + * Creates a new ListCatalogsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ProductInputConfig instance + * @returns ListCatalogsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductInputConfig): google.cloud.retail.v2alpha.ProductInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. - * @param message ProductInputConfig message or plain object to encode + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * @param message ListCatalogsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductInputConfig message from the specified reader or buffer. + * Decodes a ListCatalogsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductInputConfig + * @returns ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductInputConfig + * @returns ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Verifies a ProductInputConfig message. + * Verifies a ListCatalogsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductInputConfig + * @returns ListCatalogsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsResponse; /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. - * @param message ProductInputConfig + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. + * @param message ListCatalogsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductInputConfig to JSON. + * Converts this ListCatalogsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ProductInputConfig + * Gets the default type url for ListCatalogsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a UserEventInputConfig. */ - interface IUserEventInputConfig { - - /** UserEventInputConfig userEventInlineSource */ - userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); + /** Properties of an UpdateCatalogRequest. */ + interface IUpdateCatalogRequest { - /** UserEventInputConfig gcsSource */ - gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + /** UpdateCatalogRequest catalog */ + catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - /** UserEventInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** UpdateCatalogRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a UserEventInputConfig. */ - class UserEventInputConfig implements IUserEventInputConfig { + /** Represents an UpdateCatalogRequest. */ + class UpdateCatalogRequest implements IUpdateCatalogRequest { /** - * Constructs a new UserEventInputConfig. + * Constructs a new UpdateCatalogRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig); - - /** UserEventInputConfig userEventInlineSource. */ - public userEventInlineSource?: (google.cloud.retail.v2alpha.IUserEventInlineSource|null); - - /** UserEventInputConfig gcsSource. */ - public gcsSource?: (google.cloud.retail.v2alpha.IGcsSource|null); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest); - /** UserEventInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** UpdateCatalogRequest catalog. */ + public catalog?: (google.cloud.retail.v2alpha.ICatalog|null); - /** UserEventInputConfig source. */ - public source?: ("userEventInlineSource"|"gcsSource"|"bigQuerySource"); + /** UpdateCatalogRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new UserEventInputConfig instance using the specified properties. + * Creates a new UpdateCatalogRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventInputConfig instance + * @returns UpdateCatalogRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventInputConfig): google.cloud.retail.v2alpha.UserEventInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. - * @param message UserEventInputConfig message or plain object to encode + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * @param message UpdateCatalogRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventInputConfig + * @returns UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventInputConfig + * @returns UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Verifies a UserEventInputConfig message. + * Verifies an UpdateCatalogRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventInputConfig + * @returns UpdateCatalogRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCatalogRequest; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. - * @param message UserEventInputConfig + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * @param message UpdateCatalogRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this UpdateCatalogRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UserEventInputConfig + * Gets the default type url for UpdateCatalogRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CompletionDataInputConfig. */ - interface ICompletionDataInputConfig { + /** Properties of a SetDefaultBranchRequest. */ + interface ISetDefaultBranchRequest { - /** CompletionDataInputConfig bigQuerySource */ - bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** SetDefaultBranchRequest catalog */ + catalog?: (string|null); + + /** SetDefaultBranchRequest branchId */ + branchId?: (string|null); + + /** SetDefaultBranchRequest note */ + note?: (string|null); + + /** SetDefaultBranchRequest force */ + force?: (boolean|null); } - /** Represents a CompletionDataInputConfig. */ - class CompletionDataInputConfig implements ICompletionDataInputConfig { + /** Represents a SetDefaultBranchRequest. */ + class SetDefaultBranchRequest implements ISetDefaultBranchRequest { /** - * Constructs a new CompletionDataInputConfig. + * Constructs a new SetDefaultBranchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig); + constructor(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest); - /** CompletionDataInputConfig bigQuerySource. */ - public bigQuerySource?: (google.cloud.retail.v2alpha.IBigQuerySource|null); + /** SetDefaultBranchRequest catalog. */ + public catalog: string; - /** CompletionDataInputConfig source. */ - public source?: "bigQuerySource"; + /** SetDefaultBranchRequest branchId. */ + public branchId: string; + + /** SetDefaultBranchRequest note. */ + public note: string; + + /** SetDefaultBranchRequest force. */ + public force: boolean; /** - * Creates a new CompletionDataInputConfig instance using the specified properties. + * Creates a new SetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionDataInputConfig instance + * @returns SetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompletionDataInputConfig): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static create(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. - * @param message CompletionDataInputConfig message or plain object to encode + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * @param message SetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDataInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionDataInputConfig + * @returns SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionDataInputConfig + * @returns SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Verifies a CompletionDataInputConfig message. + * Verifies a SetDefaultBranchRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionDataInputConfig + * @returns SetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDataInputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetDefaultBranchRequest; /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. - * @param message CompletionDataInputConfig + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message SetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompletionDataInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionDataInputConfig to JSON. + * Converts this SetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CompletionDataInputConfig + * Gets the default type url for SetDefaultBranchRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportMetadata. */ - interface IImportMetadata { - - /** ImportMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata successCount */ - successCount?: (number|Long|string|null); - - /** ImportMetadata failureCount */ - failureCount?: (number|Long|string|null); - - /** ImportMetadata requestId */ - requestId?: (string|null); - - /** ImportMetadata notificationPubsubTopic */ - notificationPubsubTopic?: (string|null); + /** Properties of a GetDefaultBranchRequest. */ + interface IGetDefaultBranchRequest { - /** ImportMetadata transformedUserEventsMetadata */ - transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); + /** GetDefaultBranchRequest catalog */ + catalog?: (string|null); } - /** Represents an ImportMetadata. */ - class ImportMetadata implements IImportMetadata { + /** Represents a GetDefaultBranchRequest. */ + class GetDefaultBranchRequest implements IGetDefaultBranchRequest { /** - * Constructs a new ImportMetadata. + * Constructs a new GetDefaultBranchRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportMetadata); - - /** ImportMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ImportMetadata successCount. */ - public successCount: (number|Long|string); - - /** ImportMetadata failureCount. */ - public failureCount: (number|Long|string); - - /** ImportMetadata requestId. */ - public requestId: string; - - /** ImportMetadata notificationPubsubTopic. */ - public notificationPubsubTopic: string; + constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest); - /** ImportMetadata transformedUserEventsMetadata. */ - public transformedUserEventsMetadata?: (google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null); + /** GetDefaultBranchRequest catalog. */ + public catalog: string; /** - * Creates a new ImportMetadata instance using the specified properties. + * Creates a new GetDefaultBranchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportMetadata instance + * @returns GetDefaultBranchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportMetadata): google.cloud.retail.v2alpha.ImportMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. - * @param message ImportMetadata message or plain object to encode + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * @param message GetDefaultBranchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportMetadata message from the specified reader or buffer. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportMetadata + * @returns GetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportMetadata + * @returns GetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Verifies an ImportMetadata message. + * Verifies a GetDefaultBranchRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportMetadata + * @returns GetDefaultBranchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchRequest; /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. - * @param message ImportMetadata + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * @param message GetDefaultBranchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportMetadata to JSON. + * Converts this GetDefaultBranchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportMetadata + * Gets the default type url for GetDefaultBranchRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TransformedUserEventsMetadata. */ - interface ITransformedUserEventsMetadata { + /** Properties of a GetDefaultBranchResponse. */ + interface IGetDefaultBranchResponse { - /** TransformedUserEventsMetadata sourceEventsCount */ - sourceEventsCount?: (number|Long|string|null); + /** GetDefaultBranchResponse branch */ + branch?: (string|null); - /** TransformedUserEventsMetadata transformedEventsCount */ - transformedEventsCount?: (number|Long|string|null); + /** GetDefaultBranchResponse setTime */ + setTime?: (google.protobuf.ITimestamp|null); + + /** GetDefaultBranchResponse note */ + note?: (string|null); } - /** Represents a TransformedUserEventsMetadata. */ - class TransformedUserEventsMetadata implements ITransformedUserEventsMetadata { + /** Represents a GetDefaultBranchResponse. */ + class GetDefaultBranchResponse implements IGetDefaultBranchResponse { /** - * Constructs a new TransformedUserEventsMetadata. + * Constructs a new GetDefaultBranchResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse); - /** TransformedUserEventsMetadata sourceEventsCount. */ - public sourceEventsCount: (number|Long|string); + /** GetDefaultBranchResponse branch. */ + public branch: string; - /** TransformedUserEventsMetadata transformedEventsCount. */ - public transformedEventsCount: (number|Long|string); + /** GetDefaultBranchResponse setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); + + /** GetDefaultBranchResponse note. */ + public note: string; /** - * Creates a new TransformedUserEventsMetadata instance using the specified properties. + * Creates a new GetDefaultBranchResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TransformedUserEventsMetadata instance + * @returns GetDefaultBranchResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. - * @param message TransformedUserEventsMetadata message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. - * @param message TransformedUserEventsMetadata message or plain object to encode + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @param message GetDefaultBranchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ITransformedUserEventsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TransformedUserEventsMetadata + * @returns GetDefaultBranchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TransformedUserEventsMetadata + * @returns GetDefaultBranchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Verifies a TransformedUserEventsMetadata message. + * Verifies a GetDefaultBranchResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TransformedUserEventsMetadata + * @returns GetDefaultBranchResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TransformedUserEventsMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchResponse; /** - * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. - * @param message TransformedUserEventsMetadata + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * @param message GetDefaultBranchResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.TransformedUserEventsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TransformedUserEventsMetadata to JSON. + * Converts this GetDefaultBranchResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TransformedUserEventsMetadata + * Gets the default type url for GetDefaultBranchResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportProductsResponse. */ - interface IImportProductsResponse { - - /** ImportProductsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** Properties of a GetCompletionConfigRequest. */ + interface IGetCompletionConfigRequest { - /** ImportProductsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** GetCompletionConfigRequest name */ + name?: (string|null); } - /** Represents an ImportProductsResponse. */ - class ImportProductsResponse implements IImportProductsResponse { + /** Represents a GetCompletionConfigRequest. */ + class GetCompletionConfigRequest implements IGetCompletionConfigRequest { /** - * Constructs a new ImportProductsResponse. + * Constructs a new GetCompletionConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportProductsResponse); - - /** ImportProductsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + constructor(properties?: google.cloud.retail.v2alpha.IGetCompletionConfigRequest); - /** ImportProductsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** GetCompletionConfigRequest name. */ + public name: string; /** - * Creates a new ImportProductsResponse instance using the specified properties. + * Creates a new GetCompletionConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportProductsResponse instance + * @returns GetCompletionConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportProductsResponse): google.cloud.retail.v2alpha.ImportProductsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IGetCompletionConfigRequest): google.cloud.retail.v2alpha.GetCompletionConfigRequest; /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode + * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * @param message GetCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. - * @param message ImportProductsResponse message or plain object to encode + * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * @param message GetCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportProductsResponse + * @returns GetCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetCompletionConfigRequest; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportProductsResponse + * @returns GetCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetCompletionConfigRequest; /** - * Verifies an ImportProductsResponse message. + * Verifies a GetCompletionConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportProductsResponse + * @returns GetCompletionConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetCompletionConfigRequest; /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. - * @param message ImportProductsResponse + * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. + * @param message GetCompletionConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportProductsResponse to JSON. + * Converts this GetCompletionConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportProductsResponse + * Gets the default type url for GetCompletionConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportUserEventsResponse. */ - interface IImportUserEventsResponse { - - /** ImportUserEventsResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** Properties of an UpdateCompletionConfigRequest. */ + interface IUpdateCompletionConfigRequest { - /** ImportUserEventsResponse errorsConfig */ - errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** UpdateCompletionConfigRequest completionConfig */ + completionConfig?: (google.cloud.retail.v2alpha.ICompletionConfig|null); - /** ImportUserEventsResponse importSummary */ - importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); + /** UpdateCompletionConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an ImportUserEventsResponse. */ - class ImportUserEventsResponse implements IImportUserEventsResponse { + /** Represents an UpdateCompletionConfigRequest. */ + class UpdateCompletionConfigRequest implements IUpdateCompletionConfigRequest { /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new UpdateCompletionConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse); - - /** ImportUserEventsResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + constructor(properties?: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest); - /** ImportUserEventsResponse errorsConfig. */ - public errorsConfig?: (google.cloud.retail.v2alpha.IImportErrorsConfig|null); + /** UpdateCompletionConfigRequest completionConfig. */ + public completionConfig?: (google.cloud.retail.v2alpha.ICompletionConfig|null); - /** ImportUserEventsResponse importSummary. */ - public importSummary?: (google.cloud.retail.v2alpha.IUserEventImportSummary|null); + /** UpdateCompletionConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Creates a new UpdateCompletionConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportUserEventsResponse instance + * @returns UpdateCompletionConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportUserEventsResponse): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode + * Encodes the specified UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. + * @param message UpdateCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. - * @param message ImportUserEventsResponse message or plain object to encode + * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. + * @param message UpdateCompletionConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportUserEventsResponse + * @returns UpdateCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportUserEventsResponse + * @returns UpdateCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; /** - * Verifies an ImportUserEventsResponse message. + * Verifies an UpdateCompletionConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportUserEventsResponse + * @returns UpdateCompletionConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. - * @param message ImportUserEventsResponse + * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. + * @param message UpdateCompletionConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this UpdateCompletionConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportUserEventsResponse + * Gets the default type url for UpdateCompletionConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a UserEventImportSummary. */ - interface IUserEventImportSummary { - - /** UserEventImportSummary joinedEventsCount */ - joinedEventsCount?: (number|Long|string|null); + /** Properties of a GetAttributesConfigRequest. */ + interface IGetAttributesConfigRequest { - /** UserEventImportSummary unjoinedEventsCount */ - unjoinedEventsCount?: (number|Long|string|null); + /** GetAttributesConfigRequest name */ + name?: (string|null); } - /** Represents a UserEventImportSummary. */ - class UserEventImportSummary implements IUserEventImportSummary { + /** Represents a GetAttributesConfigRequest. */ + class GetAttributesConfigRequest implements IGetAttributesConfigRequest { /** - * Constructs a new UserEventImportSummary. + * Constructs a new GetAttributesConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary); - - /** UserEventImportSummary joinedEventsCount. */ - public joinedEventsCount: (number|Long|string); + constructor(properties?: google.cloud.retail.v2alpha.IGetAttributesConfigRequest); - /** UserEventImportSummary unjoinedEventsCount. */ - public unjoinedEventsCount: (number|Long|string); + /** GetAttributesConfigRequest name. */ + public name: string; /** - * Creates a new UserEventImportSummary instance using the specified properties. + * Creates a new GetAttributesConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEventImportSummary instance + * @returns GetAttributesConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEventImportSummary): google.cloud.retail.v2alpha.UserEventImportSummary; + public static create(properties?: google.cloud.retail.v2alpha.IGetAttributesConfigRequest): google.cloud.retail.v2alpha.GetAttributesConfigRequest; /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode + * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. + * @param message GetAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. - * @param message UserEventImportSummary message or plain object to encode + * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. + * @param message GetAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEventImportSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserEventImportSummary + * @returns GetAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEventImportSummary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetAttributesConfigRequest; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserEventImportSummary + * @returns GetAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEventImportSummary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetAttributesConfigRequest; /** - * Verifies a UserEventImportSummary message. + * Verifies a GetAttributesConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. + * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserEventImportSummary + * @returns GetAttributesConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEventImportSummary; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetAttributesConfigRequest; /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. - * @param message UserEventImportSummary + * Creates a plain object from a GetAttributesConfigRequest message. Also converts values to other types if specified. + * @param message GetAttributesConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UserEventImportSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserEventImportSummary to JSON. + * Converts this GetAttributesConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UserEventImportSummary + * Gets the default type url for GetAttributesConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImportCompletionDataResponse. */ - interface IImportCompletionDataResponse { + /** Properties of an UpdateAttributesConfigRequest. */ + interface IUpdateAttributesConfigRequest { - /** ImportCompletionDataResponse errorSamples */ - errorSamples?: (google.rpc.IStatus[]|null); + /** UpdateAttributesConfigRequest attributesConfig */ + attributesConfig?: (google.cloud.retail.v2alpha.IAttributesConfig|null); + + /** UpdateAttributesConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an ImportCompletionDataResponse. */ - class ImportCompletionDataResponse implements IImportCompletionDataResponse { + /** Represents an UpdateAttributesConfigRequest. */ + class UpdateAttributesConfigRequest implements IUpdateAttributesConfigRequest { /** - * Constructs a new ImportCompletionDataResponse. + * Constructs a new UpdateAttributesConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest); - /** ImportCompletionDataResponse errorSamples. */ - public errorSamples: google.rpc.IStatus[]; + /** UpdateAttributesConfigRequest attributesConfig. */ + public attributesConfig?: (google.cloud.retail.v2alpha.IAttributesConfig|null); + + /** UpdateAttributesConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. + * Creates a new UpdateAttributesConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportCompletionDataResponse instance + * @returns UpdateAttributesConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IImportCompletionDataResponse): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode + * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * @param message UpdateAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. - * @param message ImportCompletionDataResponse message or plain object to encode + * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * @param message UpdateAttributesConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IImportCompletionDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportCompletionDataResponse + * @returns UpdateAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportCompletionDataResponse + * @returns UpdateAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; /** - * Verifies an ImportCompletionDataResponse message. + * Verifies an UpdateAttributesConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportCompletionDataResponse + * @returns UpdateAttributesConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ImportCompletionDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. - * @param message ImportCompletionDataResponse + * Creates a plain object from an UpdateAttributesConfigRequest message. Also converts values to other types if specified. + * @param message UpdateAttributesConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ImportCompletionDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportCompletionDataResponse to JSON. + * Converts this UpdateAttributesConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportCompletionDataResponse + * Gets the default type url for UpdateAttributesConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Product. */ - interface IProduct { - - /** Product expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Product ttl */ - ttl?: (google.protobuf.IDuration|null); - - /** Product name */ - name?: (string|null); - - /** Product id */ - id?: (string|null); - - /** Product type */ - type?: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type|null); - - /** Product primaryProductId */ - primaryProductId?: (string|null); - - /** Product collectionMemberIds */ - collectionMemberIds?: (string[]|null); - - /** Product gtin */ - gtin?: (string|null); - - /** Product categories */ - categories?: (string[]|null); - - /** Product title */ - title?: (string|null); - - /** Product brands */ - brands?: (string[]|null); - - /** Product description */ - description?: (string|null); - - /** Product languageCode */ - languageCode?: (string|null); - - /** Product attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); - - /** Product tags */ - tags?: (string[]|null); - - /** Product priceInfo */ - priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - - /** Product rating */ - rating?: (google.cloud.retail.v2alpha.IRating|null); - - /** Product availableTime */ - availableTime?: (google.protobuf.ITimestamp|null); - - /** Product availability */ - availability?: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability|null); - - /** Product availableQuantity */ - availableQuantity?: (google.protobuf.IInt32Value|null); - - /** Product fulfillmentInfo */ - fulfillmentInfo?: (google.cloud.retail.v2alpha.IFulfillmentInfo[]|null); - - /** Product uri */ - uri?: (string|null); - - /** Product images */ - images?: (google.cloud.retail.v2alpha.IImage[]|null); - - /** Product audience */ - audience?: (google.cloud.retail.v2alpha.IAudience|null); - - /** Product colorInfo */ - colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); - - /** Product sizes */ - sizes?: (string[]|null); - - /** Product materials */ - materials?: (string[]|null); - - /** Product patterns */ - patterns?: (string[]|null); - - /** Product conditions */ - conditions?: (string[]|null); - - /** Product promotions */ - promotions?: (google.cloud.retail.v2alpha.IPromotion[]|null); - - /** Product publishTime */ - publishTime?: (google.protobuf.ITimestamp|null); - - /** Product retrievableFields */ - retrievableFields?: (google.protobuf.IFieldMask|null); + /** Properties of an AddCatalogAttributeRequest. */ + interface IAddCatalogAttributeRequest { - /** Product variants */ - variants?: (google.cloud.retail.v2alpha.IProduct[]|null); + /** AddCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); - /** Product localInventories */ - localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); + /** AddCatalogAttributeRequest catalogAttribute */ + catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); } - /** Represents a Product. */ - class Product implements IProduct { + /** Represents an AddCatalogAttributeRequest. */ + class AddCatalogAttributeRequest implements IAddCatalogAttributeRequest { /** - * Constructs a new Product. + * Constructs a new AddCatalogAttributeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProduct); - - /** Product expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Product ttl. */ - public ttl?: (google.protobuf.IDuration|null); - - /** Product name. */ - public name: string; - - /** Product id. */ - public id: string; - - /** Product type. */ - public type: (google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type); - - /** Product primaryProductId. */ - public primaryProductId: string; - - /** Product collectionMemberIds. */ - public collectionMemberIds: string[]; - - /** Product gtin. */ - public gtin: string; - - /** Product categories. */ - public categories: string[]; - - /** Product title. */ - public title: string; - - /** Product brands. */ - public brands: string[]; - - /** Product description. */ - public description: string; - - /** Product languageCode. */ - public languageCode: string; - - /** Product attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; - - /** Product tags. */ - public tags: string[]; - - /** Product priceInfo. */ - public priceInfo?: (google.cloud.retail.v2alpha.IPriceInfo|null); - - /** Product rating. */ - public rating?: (google.cloud.retail.v2alpha.IRating|null); - - /** Product availableTime. */ - public availableTime?: (google.protobuf.ITimestamp|null); - - /** Product availability. */ - public availability: (google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability); - - /** Product availableQuantity. */ - public availableQuantity?: (google.protobuf.IInt32Value|null); - - /** Product fulfillmentInfo. */ - public fulfillmentInfo: google.cloud.retail.v2alpha.IFulfillmentInfo[]; - - /** Product uri. */ - public uri: string; - - /** Product images. */ - public images: google.cloud.retail.v2alpha.IImage[]; - - /** Product audience. */ - public audience?: (google.cloud.retail.v2alpha.IAudience|null); - - /** Product colorInfo. */ - public colorInfo?: (google.cloud.retail.v2alpha.IColorInfo|null); - - /** Product sizes. */ - public sizes: string[]; - - /** Product materials. */ - public materials: string[]; - - /** Product patterns. */ - public patterns: string[]; - - /** Product conditions. */ - public conditions: string[]; - - /** Product promotions. */ - public promotions: google.cloud.retail.v2alpha.IPromotion[]; - - /** Product publishTime. */ - public publishTime?: (google.protobuf.ITimestamp|null); - - /** Product retrievableFields. */ - public retrievableFields?: (google.protobuf.IFieldMask|null); - - /** Product variants. */ - public variants: google.cloud.retail.v2alpha.IProduct[]; + constructor(properties?: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest); - /** Product localInventories. */ - public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; + /** AddCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; - /** Product expiration. */ - public expiration?: ("expireTime"|"ttl"); + /** AddCatalogAttributeRequest catalogAttribute. */ + public catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); /** - * Creates a new Product instance using the specified properties. + * Creates a new AddCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Product instance + * @returns AddCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProduct): google.cloud.retail.v2alpha.Product; + public static create(properties?: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * @param message AddCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * @param message AddCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Product + * @returns AddCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Product; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Product + * @returns AddCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Product; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; /** - * Verifies a Product message. + * Verifies an AddCatalogAttributeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Product + * @returns AddCatalogAttributeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Product; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @param message Product + * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message AddCatalogAttributeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Product to JSON. + * Converts this AddCatalogAttributeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Product + * Gets the default type url for AddCatalogAttributeRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Product { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - PRIMARY = 1, - VARIANT = 2, - COLLECTION = 3 - } - - /** Availability enum. */ - enum Availability { - AVAILABILITY_UNSPECIFIED = 0, - IN_STOCK = 1, - OUT_OF_STOCK = 2, - PREORDER = 3, - BACKORDER = 4 - } - } + /** Properties of a RemoveCatalogAttributeRequest. */ + interface IRemoveCatalogAttributeRequest { - /** Properties of a Promotion. */ - interface IPromotion { + /** RemoveCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); - /** Promotion promotionId */ - promotionId?: (string|null); + /** RemoveCatalogAttributeRequest key */ + key?: (string|null); } - /** Represents a Promotion. */ - class Promotion implements IPromotion { + /** Represents a RemoveCatalogAttributeRequest. */ + class RemoveCatalogAttributeRequest implements IRemoveCatalogAttributeRequest { /** - * Constructs a new Promotion. + * Constructs a new RemoveCatalogAttributeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPromotion); + constructor(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest); - /** Promotion promotionId. */ - public promotionId: string; + /** RemoveCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; + + /** RemoveCatalogAttributeRequest key. */ + public key: string; /** - * Creates a new Promotion instance using the specified properties. + * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Promotion instance + * @returns RemoveCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPromotion): google.cloud.retail.v2alpha.Promotion; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * @param message RemoveCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. - * @param message Promotion message or plain object to encode + * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * @param message RemoveCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPromotion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Promotion + * @returns RemoveCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Promotion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Promotion + * @returns RemoveCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Promotion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; /** - * Verifies a Promotion message. + * Verifies a RemoveCatalogAttributeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Promotion + * @returns RemoveCatalogAttributeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Promotion; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. - * @param message Promotion + * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message RemoveCatalogAttributeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Promotion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Promotion to JSON. + * Converts this RemoveCatalogAttributeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Promotion + * Gets the default type url for RemoveCatalogAttributeRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a UserEvent. */ - interface IUserEvent { - - /** UserEvent eventType */ - eventType?: (string|null); - - /** UserEvent visitorId */ - visitorId?: (string|null); + /** Properties of a BatchRemoveCatalogAttributesRequest. */ + interface IBatchRemoveCatalogAttributesRequest { - /** UserEvent sessionId */ - sessionId?: (string|null); + /** BatchRemoveCatalogAttributesRequest attributesConfig */ + attributesConfig?: (string|null); - /** UserEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); + /** BatchRemoveCatalogAttributesRequest attributeKeys */ + attributeKeys?: (string[]|null); + } - /** UserEvent experimentIds */ - experimentIds?: (string[]|null); + /** Represents a BatchRemoveCatalogAttributesRequest. */ + class BatchRemoveCatalogAttributesRequest implements IBatchRemoveCatalogAttributesRequest { - /** UserEvent attributionToken */ - attributionToken?: (string|null); + /** + * Constructs a new BatchRemoveCatalogAttributesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest); - /** UserEvent productDetails */ - productDetails?: (google.cloud.retail.v2alpha.IProductDetail[]|null); + /** BatchRemoveCatalogAttributesRequest attributesConfig. */ + public attributesConfig: string; - /** UserEvent completionDetail */ - completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + /** BatchRemoveCatalogAttributesRequest attributeKeys. */ + public attributeKeys: string[]; - /** UserEvent attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** + * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRemoveCatalogAttributesRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; - /** UserEvent cartId */ - cartId?: (string|null); + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent purchaseTransaction */ - purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent searchQuery */ - searchQuery?: (string|null); + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; - /** UserEvent filter */ - filter?: (string|null); + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; - /** UserEvent orderBy */ - orderBy?: (string|null); + /** + * Verifies a BatchRemoveCatalogAttributesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UserEvent offset */ - offset?: (number|null); + /** + * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRemoveCatalogAttributesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; - /** UserEvent pageCategories */ - pageCategories?: (string[]|null); + /** + * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. + * @param message BatchRemoveCatalogAttributesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent userInfo */ - userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** + * Converts this BatchRemoveCatalogAttributesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** UserEvent uri */ - uri?: (string|null); + /** + * Gets the default type url for BatchRemoveCatalogAttributesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** UserEvent referrerUri */ - referrerUri?: (string|null); + /** Properties of a BatchRemoveCatalogAttributesResponse. */ + interface IBatchRemoveCatalogAttributesResponse { - /** UserEvent pageViewId */ - pageViewId?: (string|null); + /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes */ + deletedCatalogAttributes?: (string[]|null); - /** UserEvent entity */ - entity?: (string|null); + /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes */ + resetCatalogAttributes?: (string[]|null); } - /** Represents a UserEvent. */ - class UserEvent implements IUserEvent { + /** Represents a BatchRemoveCatalogAttributesResponse. */ + class BatchRemoveCatalogAttributesResponse implements IBatchRemoveCatalogAttributesResponse { /** - * Constructs a new UserEvent. + * Constructs a new BatchRemoveCatalogAttributesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUserEvent); + constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse); - /** UserEvent eventType. */ - public eventType: string; + /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. */ + public deletedCatalogAttributes: string[]; - /** UserEvent visitorId. */ - public visitorId: string; + /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes. */ + public resetCatalogAttributes: string[]; - /** UserEvent sessionId. */ - public sessionId: string; + /** + * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchRemoveCatalogAttributesResponse instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; - /** UserEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent experimentIds. */ - public experimentIds: string[]; + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** UserEvent attributionToken. */ - public attributionToken: string; + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; - /** UserEvent productDetails. */ - public productDetails: google.cloud.retail.v2alpha.IProductDetail[]; + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; - /** UserEvent completionDetail. */ - public completionDetail?: (google.cloud.retail.v2alpha.ICompletionDetail|null); + /** + * Verifies a BatchRemoveCatalogAttributesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UserEvent attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + /** + * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchRemoveCatalogAttributesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; - /** UserEvent cartId. */ - public cartId: string; + /** + * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. + * @param message BatchRemoveCatalogAttributesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UserEvent purchaseTransaction. */ - public purchaseTransaction?: (google.cloud.retail.v2alpha.IPurchaseTransaction|null); + /** + * Converts this BatchRemoveCatalogAttributesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** UserEvent searchQuery. */ - public searchQuery: string; + /** + * Gets the default type url for BatchRemoveCatalogAttributesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** UserEvent filter. */ - public filter: string; + /** Properties of a ReplaceCatalogAttributeRequest. */ + interface IReplaceCatalogAttributeRequest { - /** UserEvent orderBy. */ - public orderBy: string; + /** ReplaceCatalogAttributeRequest attributesConfig */ + attributesConfig?: (string|null); - /** UserEvent offset. */ - public offset: number; + /** ReplaceCatalogAttributeRequest catalogAttribute */ + catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); - /** UserEvent pageCategories. */ - public pageCategories: string[]; + /** ReplaceCatalogAttributeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** UserEvent userInfo. */ - public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** Represents a ReplaceCatalogAttributeRequest. */ + class ReplaceCatalogAttributeRequest implements IReplaceCatalogAttributeRequest { - /** UserEvent uri. */ - public uri: string; + /** + * Constructs a new ReplaceCatalogAttributeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest); - /** UserEvent referrerUri. */ - public referrerUri: string; + /** ReplaceCatalogAttributeRequest attributesConfig. */ + public attributesConfig: string; - /** UserEvent pageViewId. */ - public pageViewId: string; + /** ReplaceCatalogAttributeRequest catalogAttribute. */ + public catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); - /** UserEvent entity. */ - public entity: string; + /** ReplaceCatalogAttributeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new UserEvent instance using the specified properties. + * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UserEvent instance + * @returns ReplaceCatalogAttributeRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUserEvent): google.cloud.retail.v2alpha.UserEvent; + public static create(properties?: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode + * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @param message ReplaceCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. - * @param message UserEvent message or plain object to encode + * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @param message ReplaceCatalogAttributeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUserEvent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + + /** + * Verifies a ReplaceCatalogAttributeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceCatalogAttributeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + + /** + * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. + * @param message ReplaceCatalogAttributeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceCatalogAttributeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplaceCatalogAttributeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CompletionService */ + class CompletionService extends $protobuf.rpc.Service { + + /** + * Constructs a new CompletionService 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); /** - * Decodes a UserEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UserEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Creates new CompletionService 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 decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UserEvent; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): CompletionService; /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UserEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UserEvent; + public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest, callback: google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback): void; /** - * Verifies a UserEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CompleteQuery. + * @param request CompleteQueryRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest): Promise; /** - * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UserEvent + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UserEvent; + public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest, callback: google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback): void; /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. - * @param message UserEvent - * @param [options] Conversion options - * @returns Plain object + * Calls ImportCompletionData. + * @param request ImportCompletionDataRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2alpha.UserEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest): Promise; + } + + namespace CompletionService { /** - * Converts this UserEvent to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|completeQuery}. + * @param error Error, if any + * @param [response] CompleteQueryResponse */ - public toJSON(): { [k: string]: any }; + type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompleteQueryResponse) => void; /** - * Gets the default type url for UserEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|importCompletionData}. + * @param error Error, if any + * @param [response] Operation */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of a ProductDetail. */ - interface IProductDetail { + /** Properties of a CompleteQueryRequest. */ + interface ICompleteQueryRequest { - /** ProductDetail product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** CompleteQueryRequest catalog */ + catalog?: (string|null); - /** ProductDetail quantity */ - quantity?: (google.protobuf.IInt32Value|null); + /** CompleteQueryRequest query */ + query?: (string|null); + + /** CompleteQueryRequest visitorId */ + visitorId?: (string|null); + + /** CompleteQueryRequest languageCodes */ + languageCodes?: (string[]|null); + + /** CompleteQueryRequest deviceType */ + deviceType?: (string|null); + + /** CompleteQueryRequest dataset */ + dataset?: (string|null); + + /** CompleteQueryRequest maxSuggestions */ + maxSuggestions?: (number|null); + + /** CompleteQueryRequest enableAttributeSuggestions */ + enableAttributeSuggestions?: (boolean|null); + + /** CompleteQueryRequest entity */ + entity?: (string|null); } - /** Represents a ProductDetail. */ - class ProductDetail implements IProductDetail { + /** Represents a CompleteQueryRequest. */ + class CompleteQueryRequest implements ICompleteQueryRequest { /** - * Constructs a new ProductDetail. + * Constructs a new CompleteQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IProductDetail); + constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest); - /** ProductDetail product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** CompleteQueryRequest catalog. */ + public catalog: string; - /** ProductDetail quantity. */ - public quantity?: (google.protobuf.IInt32Value|null); + /** CompleteQueryRequest query. */ + public query: string; + + /** CompleteQueryRequest visitorId. */ + public visitorId: string; + + /** CompleteQueryRequest languageCodes. */ + public languageCodes: string[]; + + /** CompleteQueryRequest deviceType. */ + public deviceType: string; + + /** CompleteQueryRequest dataset. */ + public dataset: string; + + /** CompleteQueryRequest maxSuggestions. */ + public maxSuggestions: number; + + /** CompleteQueryRequest enableAttributeSuggestions. */ + public enableAttributeSuggestions: boolean; + + /** CompleteQueryRequest entity. */ + public entity: string; /** - * Creates a new ProductDetail instance using the specified properties. + * Creates a new CompleteQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ProductDetail instance + * @returns CompleteQueryRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IProductDetail): google.cloud.retail.v2alpha.ProductDetail; + public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. - * @param message ProductDetail message or plain object to encode + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @param message CompleteQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IProductDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductDetail message from the specified reader or buffer. + * Decodes a CompleteQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductDetail + * @returns CompleteQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ProductDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductDetail + * @returns CompleteQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ProductDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Verifies a ProductDetail message. + * Verifies a CompleteQueryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductDetail + * @returns CompleteQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ProductDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryRequest; /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. - * @param message ProductDetail + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @param message CompleteQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ProductDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductDetail to JSON. + * Converts this CompleteQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ProductDetail + * Gets the default type url for CompleteQueryRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CompletionDetail. */ - interface ICompletionDetail { + /** Properties of a CompleteQueryResponse. */ + interface ICompleteQueryResponse { - /** CompletionDetail completionAttributionToken */ - completionAttributionToken?: (string|null); + /** CompleteQueryResponse completionResults */ + completionResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]|null); - /** CompletionDetail selectedSuggestion */ - selectedSuggestion?: (string|null); + /** CompleteQueryResponse attributionToken */ + attributionToken?: (string|null); - /** CompletionDetail selectedPosition */ - selectedPosition?: (number|null); + /** CompleteQueryResponse recentSearchResults */ + recentSearchResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]|null); + + /** CompleteQueryResponse attributeResults */ + attributeResults?: ({ [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }|null); } - /** Represents a CompletionDetail. */ - class CompletionDetail implements ICompletionDetail { + /** Represents a CompleteQueryResponse. */ + class CompleteQueryResponse implements ICompleteQueryResponse { /** - * Constructs a new CompletionDetail. + * Constructs a new CompleteQueryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompletionDetail); + constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse); - /** CompletionDetail completionAttributionToken. */ - public completionAttributionToken: string; + /** CompleteQueryResponse completionResults. */ + public completionResults: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]; - /** CompletionDetail selectedSuggestion. */ - public selectedSuggestion: string; + /** CompleteQueryResponse attributionToken. */ + public attributionToken: string; - /** CompletionDetail selectedPosition. */ - public selectedPosition: number; + /** CompleteQueryResponse recentSearchResults. */ + public recentSearchResults: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]; + + /** CompleteQueryResponse attributeResults. */ + public attributeResults: { [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }; /** - * Creates a new CompletionDetail instance using the specified properties. + * Creates a new CompleteQueryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionDetail instance + * @returns CompleteQueryResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompletionDetail): google.cloud.retail.v2alpha.CompletionDetail; + public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. - * @param message CompletionDetail message or plain object to encode + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @param message CompleteQueryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompletionDetail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionDetail message from the specified reader or buffer. + * Decodes a CompleteQueryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionDetail + * @returns CompleteQueryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompletionDetail; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionDetail + * @returns CompleteQueryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompletionDetail; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Verifies a CompletionDetail message. + * Verifies a CompleteQueryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionDetail + * @returns CompleteQueryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompletionDetail; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse; /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. - * @param message CompletionDetail + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @param message CompleteQueryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompletionDetail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionDetail to JSON. + * Converts this CompleteQueryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CompletionDetail + * Gets the default type url for CompleteQueryResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurchaseTransaction. */ - interface IPurchaseTransaction { + namespace CompleteQueryResponse { - /** PurchaseTransaction id */ - id?: (string|null); + /** Properties of a CompletionResult. */ + interface ICompletionResult { - /** PurchaseTransaction revenue */ - revenue?: (number|null); + /** CompletionResult suggestion */ + suggestion?: (string|null); - /** PurchaseTransaction tax */ - tax?: (number|null); + /** CompletionResult attributes */ + attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); - /** PurchaseTransaction cost */ - cost?: (number|null); + /** CompletionResult facets */ + facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); - /** PurchaseTransaction currencyCode */ - currencyCode?: (string|null); - } + /** CompletionResult totalProductCount */ + totalProductCount?: (number|null); + } - /** Represents a PurchaseTransaction. */ - class PurchaseTransaction implements IPurchaseTransaction { + /** Represents a CompletionResult. */ + class CompletionResult implements ICompletionResult { - /** - * Constructs a new PurchaseTransaction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction); + /** + * Constructs a new CompletionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult); - /** PurchaseTransaction id. */ - public id: string; + /** CompletionResult suggestion. */ + public suggestion: string; - /** PurchaseTransaction revenue. */ - public revenue: number; + /** CompletionResult attributes. */ + public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; - /** PurchaseTransaction tax. */ - public tax: number; + /** CompletionResult facets. */ + public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; + + /** CompletionResult totalProductCount. */ + public totalProductCount: number; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CompletionResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @param message CompletionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Verifies a CompletionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompletionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @param message CompletionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompletionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CompletionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecentSearchResult. */ + interface IRecentSearchResult { + + /** RecentSearchResult recentSearch */ + recentSearch?: (string|null); + } + + /** Represents a RecentSearchResult. */ + class RecentSearchResult implements IRecentSearchResult { + + /** + * Constructs a new RecentSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult); + + /** RecentSearchResult recentSearch. */ + public recentSearch: string; + + /** + * Creates a new RecentSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns RecentSearchResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + + /** + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @param message RecentSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + + /** + * Verifies a RecentSearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecentSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + + /** + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @param message RecentSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecentSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecentSearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttributeResult. */ + interface IAttributeResult { + + /** AttributeResult suggestions */ + suggestions?: (string[]|null); + } - /** PurchaseTransaction cost. */ - public cost: number; + /** Represents an AttributeResult. */ + class AttributeResult implements IAttributeResult { - /** PurchaseTransaction currencyCode. */ - public currencyCode: string; + /** + * Constructs a new AttributeResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult); - /** - * Creates a new PurchaseTransaction instance using the specified properties. - * @param [properties] Properties to set - * @returns PurchaseTransaction instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IPurchaseTransaction): google.cloud.retail.v2alpha.PurchaseTransaction; + /** AttributeResult suggestions. */ + public suggestions: string[]; - /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new AttributeResult instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributeResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; - /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. - * @param message PurchaseTransaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurchaseTransaction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @param message AttributeResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PurchaseTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurchaseTransaction; + /** + * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @param message AttributeResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PurchaseTransaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurchaseTransaction; + /** + * Decodes an AttributeResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; - /** - * Verifies a PurchaseTransaction message. - * @param message 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 AttributeResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; - /** - * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PurchaseTransaction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurchaseTransaction; + /** + * Verifies an AttributeResult message. + * @param message Plain object 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 PurchaseTransaction message. Also converts values to other types if specified. - * @param message PurchaseTransaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.PurchaseTransaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributeResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; - /** - * Converts this PurchaseTransaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. + * @param message AttributeResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for PurchaseTransaction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Converts this AttributeResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributeResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a CatalogService */ - class CatalogService extends $protobuf.rpc.Service { + /** Represents a SearchService */ + class SearchService extends $protobuf.rpc.Service { /** - * Constructs a new CatalogService service. + * Constructs a new SearchService service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -26432,2470 +31933,2178 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new CatalogService service using the specified rpc implementation. + * Creates new SearchService 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): CatalogService; - - /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListCatalogsResponse - */ - public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest, callback: google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback): void; - - /** - * Calls ListCatalogs. - * @param request ListCatalogsRequest message or plain object - * @returns Promise - */ - public listCatalogs(request: google.cloud.retail.v2alpha.IListCatalogsRequest): Promise; - - /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Catalog - */ - public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback): void; - - /** - * Calls UpdateCatalog. - * @param request UpdateCatalogRequest message or plain object - * @returns Promise - */ - public updateCatalog(request: google.cloud.retail.v2alpha.IUpdateCatalogRequest): Promise; - - /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback): void; - - /** - * Calls SetDefaultBranch. - * @param request SetDefaultBranchRequest message or plain object - * @returns Promise - */ - public setDefaultBranch(request: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): Promise; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SearchService; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * Calls Search. + * @param request SearchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchResponse */ - public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback): void; + public search(request: google.cloud.retail.v2alpha.ISearchRequest, callback: google.cloud.retail.v2alpha.SearchService.SearchCallback): void; /** - * Calls GetDefaultBranch. - * @param request GetDefaultBranchRequest message or plain object + * Calls Search. + * @param request SearchRequest message or plain object * @returns Promise */ - public getDefaultBranch(request: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): Promise; - - /** - * Calls GetCompletionConfig. - * @param request GetCompletionConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompletionConfig - */ - public getCompletionConfig(request: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetCompletionConfigCallback): void; + public search(request: google.cloud.retail.v2alpha.ISearchRequest): Promise; + } - /** - * Calls GetCompletionConfig. - * @param request GetCompletionConfigRequest message or plain object - * @returns Promise - */ - public getCompletionConfig(request: google.cloud.retail.v2alpha.IGetCompletionConfigRequest): Promise; + namespace SearchService { /** - * Calls UpdateCompletionConfig. - * @param request UpdateCompletionConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompletionConfig + * Callback as used by {@link google.cloud.retail.v2alpha.SearchService|search}. + * @param error Error, if any + * @param [response] SearchResponse */ - public updateCompletionConfig(request: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfigCallback): void; + type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.SearchResponse) => void; + } - /** - * Calls UpdateCompletionConfig. - * @param request UpdateCompletionConfigRequest message or plain object - * @returns Promise - */ - public updateCompletionConfig(request: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest): Promise; + /** Properties of a SearchRequest. */ + interface ISearchRequest { - /** - * Calls GetAttributesConfig. - * @param request GetAttributesConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AttributesConfig - */ - public getAttributesConfig(request: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.GetAttributesConfigCallback): void; + /** SearchRequest placement */ + placement?: (string|null); - /** - * Calls GetAttributesConfig. - * @param request GetAttributesConfigRequest message or plain object - * @returns Promise - */ - public getAttributesConfig(request: google.cloud.retail.v2alpha.IGetAttributesConfigRequest): Promise; + /** SearchRequest branch */ + branch?: (string|null); - /** - * Calls UpdateAttributesConfig. - * @param request UpdateAttributesConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AttributesConfig - */ - public updateAttributesConfig(request: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, callback: google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfigCallback): void; + /** SearchRequest query */ + query?: (string|null); - /** - * Calls UpdateAttributesConfig. - * @param request UpdateAttributesConfigRequest message or plain object - * @returns Promise - */ - public updateAttributesConfig(request: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest): Promise; + /** SearchRequest visitorId */ + visitorId?: (string|null); - /** - * Calls AddCatalogAttribute. - * @param request AddCatalogAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AttributesConfig - */ - public addCatalogAttribute(request: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.AddCatalogAttributeCallback): void; + /** SearchRequest userInfo */ + userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - /** - * Calls AddCatalogAttribute. - * @param request AddCatalogAttributeRequest message or plain object - * @returns Promise - */ - public addCatalogAttribute(request: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest): Promise; + /** SearchRequest pageSize */ + pageSize?: (number|null); - /** - * Calls RemoveCatalogAttribute. - * @param request RemoveCatalogAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AttributesConfig - */ - public removeCatalogAttribute(request: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttributeCallback): void; + /** SearchRequest pageToken */ + pageToken?: (string|null); - /** - * Calls RemoveCatalogAttribute. - * @param request RemoveCatalogAttributeRequest message or plain object - * @returns Promise - */ - public removeCatalogAttribute(request: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): Promise; + /** SearchRequest offset */ + offset?: (number|null); - /** - * Calls BatchRemoveCatalogAttributes. - * @param request BatchRemoveCatalogAttributesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse - */ - public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, callback: google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback): void; + /** SearchRequest filter */ + filter?: (string|null); - /** - * Calls BatchRemoveCatalogAttributes. - * @param request BatchRemoveCatalogAttributesRequest message or plain object - * @returns Promise - */ - public batchRemoveCatalogAttributes(request: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): Promise; + /** SearchRequest canonicalFilter */ + canonicalFilter?: (string|null); - /** - * Calls ReplaceCatalogAttribute. - * @param request ReplaceCatalogAttributeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AttributesConfig - */ - public replaceCatalogAttribute(request: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, callback: google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttributeCallback): void; + /** SearchRequest orderBy */ + orderBy?: (string|null); - /** - * Calls ReplaceCatalogAttribute. - * @param request ReplaceCatalogAttributeRequest message or plain object - * @returns Promise - */ - public replaceCatalogAttribute(request: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest): Promise; - } + /** SearchRequest facetSpecs */ + facetSpecs?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]|null); - namespace CatalogService { + /** SearchRequest dynamicFacetSpec */ + dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|listCatalogs}. - * @param error Error, if any - * @param [response] ListCatalogsResponse - */ - type ListCatalogsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListCatalogsResponse) => void; + /** SearchRequest boostSpec */ + boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCatalog}. - * @param error Error, if any - * @param [response] Catalog - */ - type UpdateCatalogCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Catalog) => void; + /** SearchRequest queryExpansionSpec */ + queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|setDefaultBranch}. - * @param error Error, if any - * @param [response] Empty - */ - type SetDefaultBranchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** SearchRequest relevanceThreshold */ + relevanceThreshold?: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getDefaultBranch}. - * @param error Error, if any - * @param [response] GetDefaultBranchResponse - */ - type GetDefaultBranchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.GetDefaultBranchResponse) => void; + /** SearchRequest variantRollupKeys */ + variantRollupKeys?: (string[]|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getCompletionConfig}. - * @param error Error, if any - * @param [response] CompletionConfig - */ - type GetCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompletionConfig) => void; + /** SearchRequest pageCategories */ + pageCategories?: (string[]|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCompletionConfig}. - * @param error Error, if any - * @param [response] CompletionConfig - */ - type UpdateCompletionConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompletionConfig) => void; + /** SearchRequest searchMode */ + searchMode?: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getAttributesConfig}. - * @param error Error, if any - * @param [response] AttributesConfig - */ - type GetAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; + /** SearchRequest personalizationSpec */ + personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateAttributesConfig}. - * @param error Error, if any - * @param [response] AttributesConfig - */ - type UpdateAttributesConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; + /** SearchRequest labels */ + labels?: ({ [k: string]: string }|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|addCatalogAttribute}. - * @param error Error, if any - * @param [response] AttributesConfig - */ - type AddCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; + /** SearchRequest spellCorrectionSpec */ + spellCorrectionSpec?: (google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|removeCatalogAttribute}. - * @param error Error, if any - * @param [response] AttributesConfig - */ - type RemoveCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; + /** SearchRequest entity */ + entity?: (string|null); + } - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. - * @param error Error, if any - * @param [response] BatchRemoveCatalogAttributesResponse - */ - type BatchRemoveCatalogAttributesCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) => void; + /** Represents a SearchRequest. */ + class SearchRequest implements ISearchRequest { /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. - * @param error Error, if any - * @param [response] AttributesConfig + * Constructs a new SearchRequest. + * @param [properties] Properties to set */ - type ReplaceCatalogAttributeCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AttributesConfig) => void; - } - - /** Properties of a ListCatalogsRequest. */ - interface IListCatalogsRequest { - - /** ListCatalogsRequest parent */ - parent?: (string|null); + constructor(properties?: google.cloud.retail.v2alpha.ISearchRequest); - /** ListCatalogsRequest pageSize */ - pageSize?: (number|null); + /** SearchRequest placement. */ + public placement: string; - /** ListCatalogsRequest pageToken */ - pageToken?: (string|null); - } + /** SearchRequest branch. */ + public branch: string; - /** Represents a ListCatalogsRequest. */ - class ListCatalogsRequest implements IListCatalogsRequest { + /** SearchRequest query. */ + public query: string; - /** - * Constructs a new ListCatalogsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest); + /** SearchRequest visitorId. */ + public visitorId: string; - /** ListCatalogsRequest parent. */ - public parent: string; + /** SearchRequest userInfo. */ + public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); - /** ListCatalogsRequest pageSize. */ + /** SearchRequest pageSize. */ public pageSize: number; - /** ListCatalogsRequest pageToken. */ + /** SearchRequest pageToken. */ public pageToken: string; - /** - * Creates a new ListCatalogsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListCatalogsRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsRequest): google.cloud.retail.v2alpha.ListCatalogsRequest; - - /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. - * @param message ListCatalogsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListCatalogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListCatalogsRequest; + /** SearchRequest offset. */ + public offset: number; - /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListCatalogsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListCatalogsRequest; + /** SearchRequest filter. */ + public filter: string; - /** - * Verifies a ListCatalogsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SearchRequest canonicalFilter. */ + public canonicalFilter: string; - /** - * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListCatalogsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsRequest; + /** SearchRequest orderBy. */ + public orderBy: string; - /** - * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. - * @param message ListCatalogsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SearchRequest facetSpecs. */ + public facetSpecs: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]; - /** - * Converts this ListCatalogsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** SearchRequest dynamicFacetSpec. */ + public dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); - /** - * Gets the default type url for ListCatalogsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** SearchRequest boostSpec. */ + public boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); - /** Properties of a ListCatalogsResponse. */ - interface IListCatalogsResponse { + /** SearchRequest queryExpansionSpec. */ + public queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); - /** ListCatalogsResponse catalogs */ - catalogs?: (google.cloud.retail.v2alpha.ICatalog[]|null); + /** SearchRequest relevanceThreshold. */ + public relevanceThreshold: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold); - /** ListCatalogsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** SearchRequest variantRollupKeys. */ + public variantRollupKeys: string[]; - /** Represents a ListCatalogsResponse. */ - class ListCatalogsResponse implements IListCatalogsResponse { + /** SearchRequest pageCategories. */ + public pageCategories: string[]; - /** - * Constructs a new ListCatalogsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse); + /** SearchRequest searchMode. */ + public searchMode: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode); - /** ListCatalogsResponse catalogs. */ - public catalogs: google.cloud.retail.v2alpha.ICatalog[]; + /** SearchRequest personalizationSpec. */ + public personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); - /** ListCatalogsResponse nextPageToken. */ - public nextPageToken: string; + /** SearchRequest labels. */ + public labels: { [k: string]: string }; + + /** SearchRequest spellCorrectionSpec. */ + public spellCorrectionSpec?: (google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null); + + /** SearchRequest entity. */ + public entity: string; + + /** SearchRequest _spellCorrectionSpec. */ + public _spellCorrectionSpec?: "spellCorrectionSpec"; /** - * Creates a new ListCatalogsResponse instance using the specified properties. + * Creates a new SearchRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListCatalogsResponse instance + * @returns SearchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListCatalogsResponse): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static create(properties?: google.cloud.retail.v2alpha.ISearchRequest): google.cloud.retail.v2alpha.SearchRequest; /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. - * @param message ListCatalogsResponse message or plain object to encode + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @param message SearchRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListCatalogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. + * Decodes a SearchRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListCatalogsResponse + * @returns SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListCatalogsResponse + * @returns SearchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest; /** - * Verifies a ListCatalogsResponse message. + * Verifies a SearchRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListCatalogsResponse + * @returns SearchRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListCatalogsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest; /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. - * @param message ListCatalogsResponse + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @param message SearchRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListCatalogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListCatalogsResponse to JSON. + * Converts this SearchRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListCatalogsResponse + * Gets the default type url for SearchRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateCatalogRequest. */ - interface IUpdateCatalogRequest { + namespace SearchRequest { - /** UpdateCatalogRequest catalog */ - catalog?: (google.cloud.retail.v2alpha.ICatalog|null); + /** Properties of a FacetSpec. */ + interface IFacetSpec { - /** UpdateCatalogRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** FacetSpec facetKey */ + facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - /** Represents an UpdateCatalogRequest. */ - class UpdateCatalogRequest implements IUpdateCatalogRequest { + /** FacetSpec limit */ + limit?: (number|null); - /** - * Constructs a new UpdateCatalogRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest); + /** FacetSpec excludedFilterKeys */ + excludedFilterKeys?: (string[]|null); - /** UpdateCatalogRequest catalog. */ - public catalog?: (google.cloud.retail.v2alpha.ICatalog|null); + /** FacetSpec enableDynamicPosition */ + enableDynamicPosition?: (boolean|null); + } - /** UpdateCatalogRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** Represents a FacetSpec. */ + class FacetSpec implements IFacetSpec { - /** - * Creates a new UpdateCatalogRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCatalogRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateCatalogRequest): google.cloud.retail.v2alpha.UpdateCatalogRequest; + /** + * Constructs a new FacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec); - /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetSpec facetKey. */ + public facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. - * @param message UpdateCatalogRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCatalogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetSpec limit. */ + public limit: number; - /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCatalogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateCatalogRequest; + /** FacetSpec excludedFilterKeys. */ + public excludedFilterKeys: string[]; - /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCatalogRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateCatalogRequest; + /** FacetSpec enableDynamicPosition. */ + public enableDynamicPosition: boolean; - /** - * Verifies an UpdateCatalogRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new FacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - /** - * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCatalogRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCatalogRequest; + /** + * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. - * @param message UpdateCatalogRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateCatalogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @param message FacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this UpdateCatalogRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - /** - * Gets the default type url for UpdateCatalogRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - /** Properties of a SetDefaultBranchRequest. */ - interface ISetDefaultBranchRequest { + /** + * Verifies a FacetSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SetDefaultBranchRequest catalog */ - catalog?: (string|null); + /** + * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - /** SetDefaultBranchRequest branchId */ - branchId?: (string|null); + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @param message FacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SetDefaultBranchRequest note */ - note?: (string|null); + /** + * Converts this FacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** SetDefaultBranchRequest force */ - force?: (boolean|null); - } + /** + * Gets the default type url for FacetSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Represents a SetDefaultBranchRequest. */ - class SetDefaultBranchRequest implements ISetDefaultBranchRequest { + namespace FacetSpec { - /** - * Constructs a new SetDefaultBranchRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest); + /** Properties of a FacetKey. */ + interface IFacetKey { - /** SetDefaultBranchRequest catalog. */ - public catalog: string; + /** FacetKey key */ + key?: (string|null); - /** SetDefaultBranchRequest branchId. */ - public branchId: string; + /** FacetKey intervals */ + intervals?: (google.cloud.retail.v2alpha.IInterval[]|null); - /** SetDefaultBranchRequest note. */ - public note: string; + /** FacetKey restrictedValues */ + restrictedValues?: (string[]|null); - /** SetDefaultBranchRequest force. */ - public force: boolean; + /** FacetKey prefixes */ + prefixes?: (string[]|null); - /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultBranchRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ISetDefaultBranchRequest): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + /** FacetKey contains */ + contains?: (string[]|null); - /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetKey caseInsensitive */ + caseInsensitive?: (boolean|null); - /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. - * @param message SetDefaultBranchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FacetKey orderBy */ + orderBy?: (string|null); - /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + /** FacetKey query */ + query?: (string|null); - /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + /** FacetKey returnMinMax */ + returnMinMax?: (boolean|null); + } - /** - * Verifies a SetDefaultBranchRequest message. - * @param message 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 FacetKey. */ + class FacetKey implements IFacetKey { - /** - * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultBranchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetDefaultBranchRequest; + /** + * Constructs a new FacetKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey); - /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message SetDefaultBranchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FacetKey key. */ + public key: string; - /** - * Converts this SetDefaultBranchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FacetKey intervals. */ + public intervals: google.cloud.retail.v2alpha.IInterval[]; - /** - * Gets the default type url for SetDefaultBranchRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** FacetKey restrictedValues. */ + public restrictedValues: string[]; - /** Properties of a GetDefaultBranchRequest. */ - interface IGetDefaultBranchRequest { + /** FacetKey prefixes. */ + public prefixes: string[]; - /** GetDefaultBranchRequest catalog */ - catalog?: (string|null); - } + /** FacetKey contains. */ + public contains: string[]; - /** Represents a GetDefaultBranchRequest. */ - class GetDefaultBranchRequest implements IGetDefaultBranchRequest { + /** FacetKey caseInsensitive. */ + public caseInsensitive: boolean; + + /** FacetKey orderBy. */ + public orderBy: string; + + /** FacetKey query. */ + public query: string; + + /** FacetKey returnMinMax. */ + public returnMinMax: boolean; + + /** + * Creates a new FacetKey instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetKey instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; + + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @param message FacetKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; + + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - /** - * Constructs a new GetDefaultBranchRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest); + /** + * Verifies a FacetKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** GetDefaultBranchRequest catalog. */ - public catalog: string; + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDefaultBranchRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchRequest): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @param message FacetKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this FacetKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. - * @param message GetDefaultBranchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Gets the default type url for FacetKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } - /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + /** Properties of a DynamicFacetSpec. */ + interface IDynamicFacetSpec { - /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + /** DynamicFacetSpec mode */ + mode?: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null); + } - /** - * Verifies a GetDefaultBranchRequest message. - * @param message 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 DynamicFacetSpec. */ + class DynamicFacetSpec implements IDynamicFacetSpec { - /** - * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDefaultBranchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchRequest; + /** + * Constructs a new DynamicFacetSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec); - /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. - * @param message GetDefaultBranchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DynamicFacetSpec mode. */ + public mode: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode); - /** - * Converts this GetDefaultBranchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicFacetSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** - * Gets the default type url for GetDefaultBranchRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a GetDefaultBranchResponse. */ - interface IGetDefaultBranchResponse { + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @param message DynamicFacetSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** GetDefaultBranchResponse branch */ - branch?: (string|null); + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** GetDefaultBranchResponse setTime */ - setTime?: (google.protobuf.ITimestamp|null); + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** GetDefaultBranchResponse note */ - note?: (string|null); - } + /** + * Verifies a DynamicFacetSpec message. + * @param message 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 GetDefaultBranchResponse. */ - class GetDefaultBranchResponse implements IGetDefaultBranchResponse { + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicFacetSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - /** - * Constructs a new GetDefaultBranchResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse); + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @param message DynamicFacetSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** GetDefaultBranchResponse branch. */ - public branch: string; + /** + * Converts this DynamicFacetSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** GetDefaultBranchResponse setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); + /** + * Gets the default type url for DynamicFacetSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** GetDefaultBranchResponse note. */ - public note: string; + namespace DynamicFacetSpec { - /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDefaultBranchResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IGetDefaultBranchResponse): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + DISABLED = 1, + ENABLED = 2 + } + } - /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a BoostSpec. */ + interface IBoostSpec { - /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @param message GetDefaultBranchResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetDefaultBranchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** BoostSpec conditionBoostSpecs */ + conditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); - /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDefaultBranchResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + /** BoostSpec skipBoostSpecValidation */ + skipBoostSpecValidation?: (boolean|null); + } - /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDefaultBranchResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + /** Represents a BoostSpec. */ + class BoostSpec implements IBoostSpec { - /** - * Verifies a GetDefaultBranchResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new BoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec); - /** - * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDefaultBranchResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetDefaultBranchResponse; + /** BoostSpec conditionBoostSpecs. */ + public conditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; - /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. - * @param message GetDefaultBranchResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.GetDefaultBranchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BoostSpec skipBoostSpecValidation. */ + public skipBoostSpecValidation?: (boolean|null); - /** - * Converts this GetDefaultBranchResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** BoostSpec _skipBoostSpecValidation. */ + public _skipBoostSpecValidation?: "skipBoostSpecValidation"; - /** - * Gets the default type url for GetDefaultBranchResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a new BoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns BoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** Properties of a GetCompletionConfigRequest. */ - interface IGetCompletionConfigRequest { + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** GetCompletionConfigRequest name */ - name?: (string|null); - } + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @param message BoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a GetCompletionConfigRequest. */ - class GetCompletionConfigRequest implements IGetCompletionConfigRequest { + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** - * Constructs a new GetCompletionConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IGetCompletionConfigRequest); + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** GetCompletionConfigRequest name. */ - public name: string; + /** + * Verifies a BoostSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new GetCompletionConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetCompletionConfigRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IGetCompletionConfigRequest): google.cloud.retail.v2alpha.GetCompletionConfigRequest; + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; - /** - * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. - * @param message GetCompletionConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @param message BoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. - * @param message GetCompletionConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this BoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetCompletionConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetCompletionConfigRequest; + /** + * Gets the default type url for BoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetCompletionConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetCompletionConfigRequest; + namespace BoostSpec { - /** - * Verifies a GetCompletionConfigRequest message. - * @param message 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 ConditionBoostSpec. */ + interface IConditionBoostSpec { - /** - * Creates a GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetCompletionConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetCompletionConfigRequest; + /** ConditionBoostSpec condition */ + condition?: (string|null); - /** - * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. - * @param message GetCompletionConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.GetCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ConditionBoostSpec boost */ + boost?: (number|null); + } - /** - * Converts this GetCompletionConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a ConditionBoostSpec. */ + class ConditionBoostSpec implements IConditionBoostSpec { - /** - * Gets the default type url for GetCompletionConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Constructs a new ConditionBoostSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec); - /** Properties of an UpdateCompletionConfigRequest. */ - interface IUpdateCompletionConfigRequest { + /** ConditionBoostSpec condition. */ + public condition: string; - /** UpdateCompletionConfigRequest completionConfig */ - completionConfig?: (google.cloud.retail.v2alpha.ICompletionConfig|null); + /** ConditionBoostSpec boost. */ + public boost: number; - /** UpdateCompletionConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionBoostSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - /** Represents an UpdateCompletionConfigRequest. */ - class UpdateCompletionConfigRequest implements IUpdateCompletionConfigRequest { + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new UpdateCompletionConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest); + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @param message ConditionBoostSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateCompletionConfigRequest completionConfig. */ - public completionConfig?: (google.cloud.retail.v2alpha.ICompletionConfig|null); + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - /** UpdateCompletionConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Creates a new UpdateCompletionConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateCompletionConfigRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; + /** + * Verifies a ConditionBoostSpec message. + * @param message 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 UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. - * @param message UpdateCompletionConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionBoostSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; - /** - * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. - * @param message UpdateCompletionConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @param message ConditionBoostSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateCompletionConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; + /** + * Converts this ConditionBoostSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateCompletionConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; + /** + * Gets the default type url for ConditionBoostSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } - /** - * Verifies an UpdateCompletionConfigRequest message. - * @param message 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 QueryExpansionSpec. */ + interface IQueryExpansionSpec { - /** - * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateCompletionConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateCompletionConfigRequest; + /** QueryExpansionSpec condition */ + condition?: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null); - /** - * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. - * @param message UpdateCompletionConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QueryExpansionSpec pinUnexpandedResults */ + pinUnexpandedResults?: (boolean|null); + } - /** - * Converts this UpdateCompletionConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a QueryExpansionSpec. */ + class QueryExpansionSpec implements IQueryExpansionSpec { - /** - * Gets the default type url for UpdateCompletionConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Constructs a new QueryExpansionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec); - /** Properties of a GetAttributesConfigRequest. */ - interface IGetAttributesConfigRequest { + /** QueryExpansionSpec condition. */ + public condition: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition); - /** GetAttributesConfigRequest name */ - name?: (string|null); - } + /** QueryExpansionSpec pinUnexpandedResults. */ + public pinUnexpandedResults: boolean; - /** Represents a GetAttributesConfigRequest. */ - class GetAttributesConfigRequest implements IGetAttributesConfigRequest { + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; - /** - * Constructs a new GetAttributesConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IGetAttributesConfigRequest); + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** GetAttributesConfigRequest name. */ - public name: string; + /** + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @param message QueryExpansionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new GetAttributesConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAttributesConfigRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IGetAttributesConfigRequest): google.cloud.retail.v2alpha.GetAttributesConfigRequest; + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; - /** - * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. - * @param message GetAttributesConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; - /** - * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. - * @param message GetAttributesConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a QueryExpansionSpec message. + * @param message 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 GetAttributesConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAttributesConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetAttributesConfigRequest; + /** + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; - /** - * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAttributesConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetAttributesConfigRequest; + /** + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * @param message QueryExpansionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a GetAttributesConfigRequest message. - * @param message 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 QueryExpansionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAttributesConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetAttributesConfigRequest; + /** + * Gets the default type url for QueryExpansionSpec + * @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 GetAttributesConfigRequest message. Also converts values to other types if specified. - * @param message GetAttributesConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.GetAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace QueryExpansionSpec { - /** - * Converts this GetAttributesConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Condition enum. */ + enum Condition { + CONDITION_UNSPECIFIED = 0, + DISABLED = 1, + AUTO = 3 + } + } - /** - * Gets the default type url for GetAttributesConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Properties of a PersonalizationSpec. */ + interface IPersonalizationSpec { - /** Properties of an UpdateAttributesConfigRequest. */ - interface IUpdateAttributesConfigRequest { + /** PersonalizationSpec mode */ + mode?: (google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|null); + } - /** UpdateAttributesConfigRequest attributesConfig */ - attributesConfig?: (google.cloud.retail.v2alpha.IAttributesConfig|null); + /** Represents a PersonalizationSpec. */ + class PersonalizationSpec implements IPersonalizationSpec { - /** UpdateAttributesConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Constructs a new PersonalizationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec); - /** Represents an UpdateAttributesConfigRequest. */ - class UpdateAttributesConfigRequest implements IUpdateAttributesConfigRequest { + /** PersonalizationSpec mode. */ + public mode: (google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode); - /** - * Constructs a new UpdateAttributesConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest); + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PersonalizationSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; - /** UpdateAttributesConfigRequest attributesConfig. */ - public attributesConfig?: (google.cloud.retail.v2alpha.IAttributesConfig|null); + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateAttributesConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @param message PersonalizationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new UpdateAttributesConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAttributesConfigRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; - /** - * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. - * @param message UpdateAttributesConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; - /** - * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. - * @param message UpdateAttributesConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a PersonalizationSpec message. + * @param message 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 UpdateAttributesConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAttributesConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; + /** + * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersonalizationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; - /** - * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAttributesConfigRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @param message PersonalizationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies an UpdateAttributesConfigRequest message. - * @param message 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 PersonalizationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAttributesConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateAttributesConfigRequest; + /** + * Gets the default type url for PersonalizationSpec + * @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 UpdateAttributesConfigRequest message. Also converts values to other types if specified. - * @param message UpdateAttributesConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace PersonalizationSpec { - /** - * Converts this UpdateAttributesConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + AUTO = 1, + DISABLED = 2 + } + } - /** - * Gets the default type url for UpdateAttributesConfigRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Properties of a SpellCorrectionSpec. */ + interface ISpellCorrectionSpec { - /** Properties of an AddCatalogAttributeRequest. */ - interface IAddCatalogAttributeRequest { + /** SpellCorrectionSpec mode */ + mode?: (google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|null); + } - /** AddCatalogAttributeRequest attributesConfig */ - attributesConfig?: (string|null); + /** Represents a SpellCorrectionSpec. */ + class SpellCorrectionSpec implements ISpellCorrectionSpec { - /** AddCatalogAttributeRequest catalogAttribute */ - catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); - } + /** + * Constructs a new SpellCorrectionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec); - /** Represents an AddCatalogAttributeRequest. */ - class AddCatalogAttributeRequest implements IAddCatalogAttributeRequest { + /** SpellCorrectionSpec mode. */ + public mode: (google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode); - /** - * Constructs a new AddCatalogAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest); + /** + * Creates a new SpellCorrectionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns SpellCorrectionSpec instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; + + /** + * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @param message SpellCorrectionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** AddCatalogAttributeRequest attributesConfig. */ - public attributesConfig: string; + /** + * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @param message SpellCorrectionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; - /** AddCatalogAttributeRequest catalogAttribute. */ - public catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; - /** - * Creates a new AddCatalogAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AddCatalogAttributeRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; - /** - * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. - * @param message AddCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a SpellCorrectionSpec message. + * @param message 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 AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. - * @param message AddCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpellCorrectionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; - /** - * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + /** + * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. + * @param message SpellCorrectionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + /** + * Converts this SpellCorrectionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Verifies an AddCatalogAttributeRequest message. - * @param message 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 SpellCorrectionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddCatalogAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddCatalogAttributeRequest; + namespace SpellCorrectionSpec { - /** - * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. - * @param message AddCatalogAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.AddCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + SUGGESTION_ONLY = 1, + AUTO = 2 + } + } - /** - * Converts this AddCatalogAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** RelevanceThreshold enum. */ + enum RelevanceThreshold { + RELEVANCE_THRESHOLD_UNSPECIFIED = 0, + HIGH = 1, + MEDIUM = 2, + LOW = 3, + LOWEST = 4 + } - /** - * Gets the default type url for AddCatalogAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** SearchMode enum. */ + enum SearchMode { + SEARCH_MODE_UNSPECIFIED = 0, + PRODUCT_SEARCH_ONLY = 1, + FACETED_SEARCH_ONLY = 2 + } } - /** Properties of a RemoveCatalogAttributeRequest. */ - interface IRemoveCatalogAttributeRequest { + /** Properties of a SearchResponse. */ + interface ISearchResponse { - /** RemoveCatalogAttributeRequest attributesConfig */ - attributesConfig?: (string|null); + /** SearchResponse results */ + results?: (google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]|null); - /** RemoveCatalogAttributeRequest key */ - key?: (string|null); - } + /** SearchResponse facets */ + facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); - /** Represents a RemoveCatalogAttributeRequest. */ - class RemoveCatalogAttributeRequest implements IRemoveCatalogAttributeRequest { + /** SearchResponse totalSize */ + totalSize?: (number|null); - /** - * Constructs a new RemoveCatalogAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest); + /** SearchResponse correctedQuery */ + correctedQuery?: (string|null); - /** RemoveCatalogAttributeRequest attributesConfig. */ - public attributesConfig: string; + /** SearchResponse attributionToken */ + attributionToken?: (string|null); - /** RemoveCatalogAttributeRequest key. */ - public key: string; + /** SearchResponse nextPageToken */ + nextPageToken?: (string|null); - /** - * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveCatalogAttributeRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + /** SearchResponse queryExpansionInfo */ + queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); - /** - * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. - * @param message RemoveCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchResponse redirectUri */ + redirectUri?: (string|null); - /** - * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. - * @param message RemoveCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SearchResponse appliedControls */ + appliedControls?: (string[]|null); - /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + /** SearchResponse invalidConditionBoostSpecs */ + invalidConditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); - /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + /** SearchResponse experimentInfo */ + experimentInfo?: (google.cloud.retail.v2alpha.IExperimentInfo[]|null); + } - /** - * Verifies a RemoveCatalogAttributeRequest message. - * @param message 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 SearchResponse. */ + class SearchResponse implements ISearchResponse { /** - * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveCatalogAttributeRequest + * Constructs a new SearchResponse. + * @param [properties] Properties to set */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest; + constructor(properties?: google.cloud.retail.v2alpha.ISearchResponse); - /** - * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. - * @param message RemoveCatalogAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SearchResponse results. */ + public results: google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]; - /** - * Converts this RemoveCatalogAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** SearchResponse facets. */ + public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; - /** - * Gets the default type url for RemoveCatalogAttributeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** SearchResponse totalSize. */ + public totalSize: number; - /** Properties of a BatchRemoveCatalogAttributesRequest. */ - interface IBatchRemoveCatalogAttributesRequest { + /** SearchResponse correctedQuery. */ + public correctedQuery: string; - /** BatchRemoveCatalogAttributesRequest attributesConfig */ - attributesConfig?: (string|null); + /** SearchResponse attributionToken. */ + public attributionToken: string; - /** BatchRemoveCatalogAttributesRequest attributeKeys */ - attributeKeys?: (string[]|null); - } + /** SearchResponse nextPageToken. */ + public nextPageToken: string; - /** Represents a BatchRemoveCatalogAttributesRequest. */ - class BatchRemoveCatalogAttributesRequest implements IBatchRemoveCatalogAttributesRequest { + /** SearchResponse queryExpansionInfo. */ + public queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); - /** - * Constructs a new BatchRemoveCatalogAttributesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest); + /** SearchResponse redirectUri. */ + public redirectUri: string; - /** BatchRemoveCatalogAttributesRequest attributesConfig. */ - public attributesConfig: string; + /** SearchResponse appliedControls. */ + public appliedControls: string[]; - /** BatchRemoveCatalogAttributesRequest attributeKeys. */ - public attributeKeys: string[]; + /** SearchResponse invalidConditionBoostSpecs. */ + public invalidConditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; + + /** SearchResponse experimentInfo. */ + public experimentInfo: google.cloud.retail.v2alpha.IExperimentInfo[]; /** - * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * Creates a new SearchResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchRemoveCatalogAttributesRequest instance + * @returns SearchResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; + public static create(properties?: google.cloud.retail.v2alpha.ISearchResponse): google.cloud.retail.v2alpha.SearchResponse; /** - * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. - * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. - * @param message BatchRemoveCatalogAttributesRequest message or plain object to encode + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @param message SearchResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * Decodes a SearchResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchRemoveCatalogAttributesRequest + * @returns SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse; /** - * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchRemoveCatalogAttributesRequest + * @returns SearchResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse; /** - * Verifies a BatchRemoveCatalogAttributesRequest message. + * Verifies a SearchResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchRemoveCatalogAttributesRequest + * @returns SearchResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse; /** - * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. - * @param message BatchRemoveCatalogAttributesRequest + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @param message SearchResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchRemoveCatalogAttributesRequest to JSON. + * Converts this SearchResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchRemoveCatalogAttributesRequest + * Gets the default type url for SearchResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchRemoveCatalogAttributesResponse. */ - interface IBatchRemoveCatalogAttributesResponse { + namespace SearchResponse { - /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes */ - deletedCatalogAttributes?: (string[]|null); + /** Properties of a SearchResult. */ + interface ISearchResult { - /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes */ - resetCatalogAttributes?: (string[]|null); - } + /** SearchResult id */ + id?: (string|null); - /** Represents a BatchRemoveCatalogAttributesResponse. */ - class BatchRemoveCatalogAttributesResponse implements IBatchRemoveCatalogAttributesResponse { + /** SearchResult product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); - /** - * Constructs a new BatchRemoveCatalogAttributesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse); + /** SearchResult matchingVariantCount */ + matchingVariantCount?: (number|null); - /** BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. */ - public deletedCatalogAttributes: string[]; + /** SearchResult matchingVariantFields */ + matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); - /** BatchRemoveCatalogAttributesResponse resetCatalogAttributes. */ - public resetCatalogAttributes: string[]; + /** SearchResult variantRollupValues */ + variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); - /** - * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchRemoveCatalogAttributesResponse instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; + /** SearchResult personalLabels */ + personalLabels?: (string[]|null); + } - /** - * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. - * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a SearchResult. */ + class SearchResult implements ISearchResult { - /** - * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. - * @param message BatchRemoveCatalogAttributesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new SearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult); - /** - * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchRemoveCatalogAttributesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; + /** SearchResult id. */ + public id: string; - /** - * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchRemoveCatalogAttributesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; + /** SearchResult product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); - /** - * Verifies a BatchRemoveCatalogAttributesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SearchResult matchingVariantCount. */ + public matchingVariantCount: number; - /** - * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchRemoveCatalogAttributesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse; + /** SearchResult matchingVariantFields. */ + public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; - /** - * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. - * @param message BatchRemoveCatalogAttributesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SearchResult variantRollupValues. */ + public variantRollupValues: { [k: string]: google.protobuf.IValue }; + + /** SearchResult personalLabels. */ + public personalLabels: string[]; + + /** + * Creates a new SearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchResult instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + + /** + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. + * @param message SearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + + /** + * Decodes a SearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + + /** + * Verifies a SearchResult message. + * @param message 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 BatchRemoveCatalogAttributesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.SearchResult; - /** - * Gets the default type url for BatchRemoveCatalogAttributesResponse - * @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 SearchResult message. Also converts values to other types if specified. + * @param message SearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a ReplaceCatalogAttributeRequest. */ - interface IReplaceCatalogAttributeRequest { + /** + * Converts this SearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ReplaceCatalogAttributeRequest attributesConfig */ - attributesConfig?: (string|null); + /** + * Gets the default type url for SearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ReplaceCatalogAttributeRequest catalogAttribute */ - catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); + /** Properties of a Facet. */ + interface IFacet { - /** ReplaceCatalogAttributeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** Facet key */ + key?: (string|null); - /** Represents a ReplaceCatalogAttributeRequest. */ - class ReplaceCatalogAttributeRequest implements IReplaceCatalogAttributeRequest { + /** Facet values */ + values?: (google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]|null); - /** - * Constructs a new ReplaceCatalogAttributeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest); + /** Facet dynamicFacet */ + dynamicFacet?: (boolean|null); + } - /** ReplaceCatalogAttributeRequest attributesConfig. */ - public attributesConfig: string; + /** Represents a Facet. */ + class Facet implements IFacet { - /** ReplaceCatalogAttributeRequest catalogAttribute. */ - public catalogAttribute?: (google.cloud.retail.v2alpha.ICatalogAttribute|null); + /** + * Constructs a new Facet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet); - /** ReplaceCatalogAttributeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** Facet key. */ + public key: string; - /** - * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReplaceCatalogAttributeRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + /** Facet values. */ + public values: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]; - /** - * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. - * @param message ReplaceCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Facet dynamicFacet. */ + public dynamicFacet: boolean; - /** - * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. - * @param message ReplaceCatalogAttributeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Facet instance using the specified properties. + * @param [properties] Properties to set + * @returns Facet instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** - * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReplaceCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + /** + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReplaceCatalogAttributeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + /** + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. + * @param message Facet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ReplaceCatalogAttributeRequest message. - * @param message 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 Facet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** - * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReplaceCatalogAttributeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest; + /** + * Decodes a Facet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Facet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** - * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. - * @param message ReplaceCatalogAttributeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a Facet message. + * @param message 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 ReplaceCatalogAttributeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Facet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet; - /** - * Gets the default type url for ReplaceCatalogAttributeRequest - * @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 Facet message. Also converts values to other types if specified. + * @param message Facet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a CompletionService */ - class CompletionService extends $protobuf.rpc.Service { + /** + * Converts this Facet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Constructs a new CompletionService 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); + /** + * Gets the default type url for Facet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates new CompletionService 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): CompletionService; + namespace Facet { - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompleteQueryResponse - */ - public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest, callback: google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback): void; + /** Properties of a FacetValue. */ + interface IFacetValue { - /** - * Calls CompleteQuery. - * @param request CompleteQueryRequest message or plain object - * @returns Promise - */ - public completeQuery(request: google.cloud.retail.v2alpha.ICompleteQueryRequest): Promise; + /** FacetValue value */ + value?: (string|null); - /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest, callback: google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback): void; + /** FacetValue interval */ + interval?: (google.cloud.retail.v2alpha.IInterval|null); - /** - * Calls ImportCompletionData. - * @param request ImportCompletionDataRequest message or plain object - * @returns Promise - */ - public importCompletionData(request: google.cloud.retail.v2alpha.IImportCompletionDataRequest): Promise; - } + /** FacetValue count */ + count?: (number|Long|string|null); - namespace CompletionService { + /** FacetValue minValue */ + minValue?: (number|null); - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|completeQuery}. - * @param error Error, if any - * @param [response] CompleteQueryResponse - */ - type CompleteQueryCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.CompleteQueryResponse) => void; + /** FacetValue maxValue */ + maxValue?: (number|null); + } - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|importCompletionData}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportCompletionDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + /** Represents a FacetValue. */ + class FacetValue implements IFacetValue { - /** Properties of a CompleteQueryRequest. */ - interface ICompleteQueryRequest { + /** + * Constructs a new FacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue); - /** CompleteQueryRequest catalog */ - catalog?: (string|null); + /** FacetValue value. */ + public value?: (string|null); - /** CompleteQueryRequest query */ - query?: (string|null); + /** FacetValue interval. */ + public interval?: (google.cloud.retail.v2alpha.IInterval|null); - /** CompleteQueryRequest visitorId */ - visitorId?: (string|null); + /** FacetValue count. */ + public count: (number|Long|string); - /** CompleteQueryRequest languageCodes */ - languageCodes?: (string[]|null); + /** FacetValue minValue. */ + public minValue: number; - /** CompleteQueryRequest deviceType */ - deviceType?: (string|null); + /** FacetValue maxValue. */ + public maxValue: number; - /** CompleteQueryRequest dataset */ - dataset?: (string|null); + /** FacetValue facetValue. */ + public facetValue?: ("value"|"interval"); - /** CompleteQueryRequest maxSuggestions */ - maxSuggestions?: (number|null); + /** + * Creates a new FacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetValue instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** CompleteQueryRequest enableAttributeSuggestions */ - enableAttributeSuggestions?: (boolean|null); + /** + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** CompleteQueryRequest entity */ - entity?: (string|null); - } + /** + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. + * @param message FacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a CompleteQueryRequest. */ - class CompleteQueryRequest implements ICompleteQueryRequest { + /** + * Decodes a FacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** - * Constructs a new CompleteQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest); + /** + * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** CompleteQueryRequest catalog. */ - public catalog: string; + /** + * Verifies a FacetValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CompleteQueryRequest query. */ - public query: string; + /** + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; - /** CompleteQueryRequest visitorId. */ - public visitorId: string; + /** + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. + * @param message FacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CompleteQueryRequest languageCodes. */ - public languageCodes: string[]; + /** + * Converts this FacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** CompleteQueryRequest deviceType. */ - public deviceType: string; + /** + * Gets the default type url for FacetValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } - /** CompleteQueryRequest dataset. */ - public dataset: string; + /** Properties of a QueryExpansionInfo. */ + interface IQueryExpansionInfo { - /** CompleteQueryRequest maxSuggestions. */ - public maxSuggestions: number; + /** QueryExpansionInfo expandedQuery */ + expandedQuery?: (boolean|null); - /** CompleteQueryRequest enableAttributeSuggestions. */ - public enableAttributeSuggestions: boolean; + /** QueryExpansionInfo pinnedResultCount */ + pinnedResultCount?: (number|Long|string|null); + } - /** CompleteQueryRequest entity. */ - public entity: string; + /** Represents a QueryExpansionInfo. */ + class QueryExpansionInfo implements IQueryExpansionInfo { - /** - * Creates a new CompleteQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CompleteQueryRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryRequest): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** + * Constructs a new QueryExpansionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo); - /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryExpansionInfo expandedQuery. */ + public expandedQuery: boolean; - /** - * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. - * @param message CompleteQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryExpansionInfo pinnedResultCount. */ + public pinnedResultCount: (number|Long|string); - /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CompleteQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** + * Creates a new QueryExpansionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryExpansionInfo instance + */ + public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CompleteQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a CompleteQueryRequest message. - * @param message 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 QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. + * @param message QueryExpansionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** - * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompleteQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryRequest; + /** + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryExpansionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. - * @param message CompleteQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a QueryExpansionInfo message. + * @param message 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 CompleteQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryExpansionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; - /** - * Gets the default type url for CompleteQueryRequest - * @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 QueryExpansionInfo message. Also converts values to other types if specified. + * @param message QueryExpansionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a CompleteQueryResponse. */ - interface ICompleteQueryResponse { + /** + * Converts this QueryExpansionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** CompleteQueryResponse completionResults */ - completionResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]|null); + /** + * Gets the default type url for QueryExpansionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } - /** CompleteQueryResponse attributionToken */ - attributionToken?: (string|null); + /** Properties of an ExperimentInfo. */ + interface IExperimentInfo { - /** CompleteQueryResponse recentSearchResults */ - recentSearchResults?: (google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]|null); + /** ExperimentInfo servingConfigExperiment */ + servingConfigExperiment?: (google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null); - /** CompleteQueryResponse attributeResults */ - attributeResults?: ({ [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }|null); + /** ExperimentInfo experiment */ + experiment?: (string|null); } - /** Represents a CompleteQueryResponse. */ - class CompleteQueryResponse implements ICompleteQueryResponse { + /** Represents an ExperimentInfo. */ + class ExperimentInfo implements IExperimentInfo { /** - * Constructs a new CompleteQueryResponse. + * Constructs a new ExperimentInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse); - - /** CompleteQueryResponse completionResults. */ - public completionResults: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult[]; + constructor(properties?: google.cloud.retail.v2alpha.IExperimentInfo); - /** CompleteQueryResponse attributionToken. */ - public attributionToken: string; + /** ExperimentInfo servingConfigExperiment. */ + public servingConfigExperiment?: (google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null); - /** CompleteQueryResponse recentSearchResults. */ - public recentSearchResults: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult[]; + /** ExperimentInfo experiment. */ + public experiment: string; - /** CompleteQueryResponse attributeResults. */ - public attributeResults: { [k: string]: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult }; + /** ExperimentInfo experimentMetadata. */ + public experimentMetadata?: "servingConfigExperiment"; /** - * Creates a new CompleteQueryResponse instance using the specified properties. + * Creates a new ExperimentInfo instance using the specified properties. * @param [properties] Properties to set - * @returns CompleteQueryResponse instance + * @returns ExperimentInfo instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICompleteQueryResponse): google.cloud.retail.v2alpha.CompleteQueryResponse; + public static create(properties?: google.cloud.retail.v2alpha.IExperimentInfo): google.cloud.retail.v2alpha.ExperimentInfo; /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode + * Encodes the specified ExperimentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * @param message ExperimentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IExperimentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. - * @param message CompleteQueryResponse message or plain object to encode + * Encodes the specified ExperimentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * @param message ExperimentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICompleteQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IExperimentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * Decodes an ExperimentInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompleteQueryResponse + * @returns ExperimentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExperimentInfo; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * Decodes an ExperimentInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompleteQueryResponse + * @returns ExperimentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExperimentInfo; /** - * Verifies a CompleteQueryResponse message. + * Verifies an ExperimentInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExperimentInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompleteQueryResponse + * @returns ExperimentInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExperimentInfo; /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. - * @param message CompleteQueryResponse + * Creates a plain object from an ExperimentInfo message. Also converts values to other types if specified. + * @param message ExperimentInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ExperimentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompleteQueryResponse to JSON. + * Converts this ExperimentInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CompleteQueryResponse + * Gets the default type url for ExperimentInfo * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CompleteQueryResponse { - - /** Properties of a CompletionResult. */ - interface ICompletionResult { - - /** CompletionResult suggestion */ - suggestion?: (string|null); + namespace ExperimentInfo { - /** CompletionResult attributes */ - attributes?: ({ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }|null); + /** Properties of a ServingConfigExperiment. */ + interface IServingConfigExperiment { - /** CompletionResult facets */ - facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); + /** ServingConfigExperiment originalServingConfig */ + originalServingConfig?: (string|null); - /** CompletionResult totalProductCount */ - totalProductCount?: (number|null); + /** ServingConfigExperiment experimentServingConfig */ + experimentServingConfig?: (string|null); } - /** Represents a CompletionResult. */ - class CompletionResult implements ICompletionResult { + /** Represents a ServingConfigExperiment. */ + class ServingConfigExperiment implements IServingConfigExperiment { /** - * Constructs a new CompletionResult. + * Constructs a new ServingConfigExperiment. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult); - - /** CompletionResult suggestion. */ - public suggestion: string; - - /** CompletionResult attributes. */ - public attributes: { [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }; + constructor(properties?: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment); - /** CompletionResult facets. */ - public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; + /** ServingConfigExperiment originalServingConfig. */ + public originalServingConfig: string; - /** CompletionResult totalProductCount. */ - public totalProductCount: number; + /** ServingConfigExperiment experimentServingConfig. */ + public experimentServingConfig: string; /** - * Creates a new CompletionResult instance using the specified properties. + * Creates a new ServingConfigExperiment instance using the specified properties. * @param [properties] Properties to set - * @returns CompletionResult instance + * @returns ServingConfigExperiment instance */ - public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static create(properties?: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode + * Encodes the specified ServingConfigExperiment message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. + * @param message ServingConfigExperiment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @param message CompletionResult message or plain object to encode + * Encodes the specified ServingConfigExperiment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. + * @param message ServingConfigExperiment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompletionResult message from the specified reader or buffer. + * Decodes a ServingConfigExperiment message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompletionResult + * @returns ServingConfigExperiment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * Decodes a ServingConfigExperiment message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompletionResult + * @returns ServingConfigExperiment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; /** - * Verifies a CompletionResult message. + * Verifies a ServingConfigExperiment message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * Creates a ServingConfigExperiment message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompletionResult + * @returns ServingConfigExperiment */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @param message CompletionResult + * Creates a plain object from a ServingConfigExperiment message. Also converts values to other types if specified. + * @param message ServingConfigExperiment * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompletionResult to JSON. + * Converts this ServingConfigExperiment to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CompletionResult + * Gets the default type url for ServingConfigExperiment * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of a RecentSearchResult. */ - interface IRecentSearchResult { - - /** RecentSearchResult recentSearch */ - recentSearch?: (string|null); - } - - /** Represents a RecentSearchResult. */ - class RecentSearchResult implements IRecentSearchResult { + /** Properties of a Control. */ + interface IControl { - /** - * Constructs a new RecentSearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult); + /** Control facetSpec */ + facetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null); - /** RecentSearchResult recentSearch. */ - public recentSearch: string; + /** Control rule */ + rule?: (google.cloud.retail.v2alpha.IRule|null); - /** - * Creates a new RecentSearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns RecentSearchResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** Control name */ + name?: (string|null); - /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Control displayName */ + displayName?: (string|null); - /** - * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @param message RecentSearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Control associatedServingConfigIds */ + associatedServingConfigIds?: (string[]|null); - /** - * Decodes a RecentSearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** Control solutionTypes */ + solutionTypes?: (google.cloud.retail.v2alpha.SolutionType[]|null); - /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** Control searchSolutionUseCase */ + searchSolutionUseCase?: (google.cloud.retail.v2alpha.SearchSolutionUseCase[]|null); + } - /** - * Verifies a RecentSearchResult message. - * @param message 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 Control. */ + class Control implements IControl { - /** - * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RecentSearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult; + /** + * Constructs a new Control. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IControl); - /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @param message RecentSearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Control facetSpec. */ + public facetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null); - /** - * Converts this RecentSearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Control rule. */ + public rule?: (google.cloud.retail.v2alpha.IRule|null); - /** - * Gets the default type url for RecentSearchResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Control name. */ + public name: string; - /** Properties of an AttributeResult. */ - interface IAttributeResult { + /** Control displayName. */ + public displayName: string; - /** AttributeResult suggestions */ - suggestions?: (string[]|null); - } + /** Control associatedServingConfigIds. */ + public associatedServingConfigIds: string[]; - /** Represents an AttributeResult. */ - class AttributeResult implements IAttributeResult { + /** Control solutionTypes. */ + public solutionTypes: google.cloud.retail.v2alpha.SolutionType[]; - /** - * Constructs a new AttributeResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult); + /** Control searchSolutionUseCase. */ + public searchSolutionUseCase: google.cloud.retail.v2alpha.SearchSolutionUseCase[]; - /** AttributeResult suggestions. */ - public suggestions: string[]; + /** Control control. */ + public control?: ("facetSpec"|"rule"); - /** - * Creates a new AttributeResult instance using the specified properties. - * @param [properties] Properties to set - * @returns AttributeResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + /** + * Creates a new Control instance using the specified properties. + * @param [properties] Properties to set + * @returns Control instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IControl): google.cloud.retail.v2alpha.Control; - /** - * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. - * @param message AttributeResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * @param message Control message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IControl, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. - * @param message AttributeResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * @param message Control message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IControl, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AttributeResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttributeResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + /** + * Decodes a Control message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Control; - /** - * Decodes an AttributeResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttributeResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + /** + * Decodes a Control message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Control; - /** - * Verifies an AttributeResult message. - * @param message 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 Control message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttributeResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult; + /** + * Creates a Control message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Control + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Control; - /** - * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. - * @param message AttributeResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @param message Control + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Control, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this AttributeResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this Control to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for AttributeResult - * @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 Control + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a SearchService */ - class SearchService extends $protobuf.rpc.Service { + /** Represents a ControlService */ + class ControlService extends $protobuf.rpc.Service { /** - * Constructs a new SearchService service. + * Constructs a new ControlService service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -28903,2178 +34112,2455 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new SearchService service using the specified rpc implementation. + * Creates new ControlService 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): SearchService; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ControlService; /** - * Calls Search. - * @param request SearchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchResponse + * Calls CreateControl. + * @param request CreateControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control */ - public search(request: google.cloud.retail.v2alpha.ISearchRequest, callback: google.cloud.retail.v2alpha.SearchService.SearchCallback): void; + public createControl(request: google.cloud.retail.v2alpha.ICreateControlRequest, callback: google.cloud.retail.v2alpha.ControlService.CreateControlCallback): void; /** - * Calls Search. - * @param request SearchRequest message or plain object + * Calls CreateControl. + * @param request CreateControlRequest message or plain object * @returns Promise */ - public search(request: google.cloud.retail.v2alpha.ISearchRequest): Promise; + public createControl(request: google.cloud.retail.v2alpha.ICreateControlRequest): Promise; + + /** + * Calls DeleteControl. + * @param request DeleteControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteControl(request: google.cloud.retail.v2alpha.IDeleteControlRequest, callback: google.cloud.retail.v2alpha.ControlService.DeleteControlCallback): void; + + /** + * Calls DeleteControl. + * @param request DeleteControlRequest message or plain object + * @returns Promise + */ + public deleteControl(request: google.cloud.retail.v2alpha.IDeleteControlRequest): Promise; + + /** + * Calls UpdateControl. + * @param request UpdateControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control + */ + public updateControl(request: google.cloud.retail.v2alpha.IUpdateControlRequest, callback: google.cloud.retail.v2alpha.ControlService.UpdateControlCallback): void; + + /** + * Calls UpdateControl. + * @param request UpdateControlRequest message or plain object + * @returns Promise + */ + public updateControl(request: google.cloud.retail.v2alpha.IUpdateControlRequest): Promise; + + /** + * Calls GetControl. + * @param request GetControlRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Control + */ + public getControl(request: google.cloud.retail.v2alpha.IGetControlRequest, callback: google.cloud.retail.v2alpha.ControlService.GetControlCallback): void; + + /** + * Calls GetControl. + * @param request GetControlRequest message or plain object + * @returns Promise + */ + public getControl(request: google.cloud.retail.v2alpha.IGetControlRequest): Promise; + + /** + * Calls ListControls. + * @param request ListControlsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListControlsResponse + */ + public listControls(request: google.cloud.retail.v2alpha.IListControlsRequest, callback: google.cloud.retail.v2alpha.ControlService.ListControlsCallback): void; + + /** + * Calls ListControls. + * @param request ListControlsRequest message or plain object + * @returns Promise + */ + public listControls(request: google.cloud.retail.v2alpha.IListControlsRequest): Promise; } - namespace SearchService { + namespace ControlService { /** - * Callback as used by {@link google.cloud.retail.v2alpha.SearchService|search}. + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|createControl}. * @param error Error, if any - * @param [response] SearchResponse + * @param [response] Control */ - type SearchCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.SearchResponse) => void; - } + type CreateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - /** Properties of a SearchRequest. */ - interface ISearchRequest { + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|deleteControl}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteControlCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** SearchRequest placement */ - placement?: (string|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|updateControl}. + * @param error Error, if any + * @param [response] Control + */ + type UpdateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - /** SearchRequest branch */ - branch?: (string|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|getControl}. + * @param error Error, if any + * @param [response] Control + */ + type GetControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - /** SearchRequest query */ - query?: (string|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|listControls}. + * @param error Error, if any + * @param [response] ListControlsResponse + */ + type ListControlsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListControlsResponse) => void; + } - /** SearchRequest visitorId */ - visitorId?: (string|null); + /** Properties of a CreateControlRequest. */ + interface ICreateControlRequest { - /** SearchRequest userInfo */ - userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** CreateControlRequest parent */ + parent?: (string|null); - /** SearchRequest pageSize */ - pageSize?: (number|null); + /** CreateControlRequest control */ + control?: (google.cloud.retail.v2alpha.IControl|null); - /** SearchRequest pageToken */ - pageToken?: (string|null); + /** CreateControlRequest controlId */ + controlId?: (string|null); + } - /** SearchRequest offset */ - offset?: (number|null); + /** Represents a CreateControlRequest. */ + class CreateControlRequest implements ICreateControlRequest { - /** SearchRequest filter */ - filter?: (string|null); + /** + * Constructs a new CreateControlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICreateControlRequest); - /** SearchRequest canonicalFilter */ - canonicalFilter?: (string|null); + /** CreateControlRequest parent. */ + public parent: string; - /** SearchRequest orderBy */ - orderBy?: (string|null); + /** CreateControlRequest control. */ + public control?: (google.cloud.retail.v2alpha.IControl|null); - /** SearchRequest facetSpecs */ - facetSpecs?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]|null); + /** CreateControlRequest controlId. */ + public controlId: string; - /** SearchRequest dynamicFacetSpec */ - dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); + /** + * Creates a new CreateControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICreateControlRequest): google.cloud.retail.v2alpha.CreateControlRequest; - /** SearchRequest boostSpec */ - boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); + /** + * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * @param message CreateControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest queryExpansionSpec */ - queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); + /** + * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * @param message CreateControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest relevanceThreshold */ - relevanceThreshold?: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null); + /** + * Decodes a CreateControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateControlRequest; - /** SearchRequest variantRollupKeys */ - variantRollupKeys?: (string[]|null); + /** + * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateControlRequest; - /** SearchRequest pageCategories */ - pageCategories?: (string[]|null); + /** + * Verifies a CreateControlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SearchRequest searchMode */ - searchMode?: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode|null); + /** + * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateControlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateControlRequest; - /** SearchRequest personalizationSpec */ - personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); + /** + * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. + * @param message CreateControlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CreateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchRequest labels */ - labels?: ({ [k: string]: string }|null); + /** + * Converts this CreateControlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** SearchRequest spellCorrectionSpec */ - spellCorrectionSpec?: (google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null); + /** + * Gets the default type url for CreateControlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** SearchRequest entity */ - entity?: (string|null); + /** Properties of an UpdateControlRequest. */ + interface IUpdateControlRequest { + + /** UpdateControlRequest control */ + control?: (google.cloud.retail.v2alpha.IControl|null); + + /** UpdateControlRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a SearchRequest. */ - class SearchRequest implements ISearchRequest { + /** Represents an UpdateControlRequest. */ + class UpdateControlRequest implements IUpdateControlRequest { /** - * Constructs a new SearchRequest. + * Constructs a new UpdateControlRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISearchRequest); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateControlRequest); - /** SearchRequest placement. */ - public placement: string; + /** UpdateControlRequest control. */ + public control?: (google.cloud.retail.v2alpha.IControl|null); - /** SearchRequest branch. */ - public branch: string; + /** UpdateControlRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** SearchRequest query. */ - public query: string; + /** + * Creates a new UpdateControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IUpdateControlRequest): google.cloud.retail.v2alpha.UpdateControlRequest; - /** SearchRequest visitorId. */ - public visitorId: string; + /** + * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * @param message UpdateControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest userInfo. */ - public userInfo?: (google.cloud.retail.v2alpha.IUserInfo|null); + /** + * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * @param message UpdateControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest pageSize. */ - public pageSize: number; + /** + * Decodes an UpdateControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateControlRequest; - /** SearchRequest pageToken. */ - public pageToken: string; + /** + * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateControlRequest; - /** SearchRequest offset. */ - public offset: number; + /** + * Verifies an UpdateControlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SearchRequest filter. */ - public filter: string; + /** + * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateControlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateControlRequest; - /** SearchRequest canonicalFilter. */ - public canonicalFilter: string; + /** + * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. + * @param message UpdateControlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.UpdateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchRequest orderBy. */ - public orderBy: string; + /** + * Converts this UpdateControlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** SearchRequest facetSpecs. */ - public facetSpecs: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec[]; + /** + * Gets the default type url for UpdateControlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** SearchRequest dynamicFacetSpec. */ - public dynamicFacetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null); + /** Properties of a DeleteControlRequest. */ + interface IDeleteControlRequest { - /** SearchRequest boostSpec. */ - public boostSpec?: (google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null); + /** DeleteControlRequest name */ + name?: (string|null); + } - /** SearchRequest queryExpansionSpec. */ - public queryExpansionSpec?: (google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null); + /** Represents a DeleteControlRequest. */ + class DeleteControlRequest implements IDeleteControlRequest { - /** SearchRequest relevanceThreshold. */ - public relevanceThreshold: (google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|keyof typeof google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold); + /** + * Constructs a new DeleteControlRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IDeleteControlRequest); - /** SearchRequest variantRollupKeys. */ - public variantRollupKeys: string[]; + /** DeleteControlRequest name. */ + public name: string; - /** SearchRequest pageCategories. */ - public pageCategories: string[]; + /** + * Creates a new DeleteControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IDeleteControlRequest): google.cloud.retail.v2alpha.DeleteControlRequest; - /** SearchRequest searchMode. */ - public searchMode: (google.cloud.retail.v2alpha.SearchRequest.SearchMode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SearchMode); + /** + * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. + * @param message DeleteControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest personalizationSpec. */ - public personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); + /** + * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. + * @param message DeleteControlRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SearchRequest labels. */ - public labels: { [k: string]: string }; + /** + * Decodes a DeleteControlRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteControlRequest; - /** SearchRequest spellCorrectionSpec. */ - public spellCorrectionSpec?: (google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null); + /** + * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteControlRequest; - /** SearchRequest entity. */ - public entity: string; + /** + * Verifies a DeleteControlRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SearchRequest _spellCorrectionSpec. */ - public _spellCorrectionSpec?: "spellCorrectionSpec"; + /** + * Creates a DeleteControlRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteControlRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteControlRequest; /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. + * @param message DeleteControlRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.DeleteControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteControlRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteControlRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetControlRequest. */ + interface IGetControlRequest { + + /** GetControlRequest name */ + name?: (string|null); + } + + /** Represents a GetControlRequest. */ + class GetControlRequest implements IGetControlRequest { + + /** + * Constructs a new GetControlRequest. * @param [properties] Properties to set - * @returns SearchRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISearchRequest): google.cloud.retail.v2alpha.SearchRequest; + constructor(properties?: google.cloud.retail.v2alpha.IGetControlRequest); + + /** GetControlRequest name. */ + public name: string; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Creates a new GetControlRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetControlRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IGetControlRequest): google.cloud.retail.v2alpha.GetControlRequest; + + /** + * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * @param message GetControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. - * @param message SearchRequest message or plain object to encode + * Encodes the specified GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * @param message GetControlRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a GetControlRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchRequest + * @returns GetControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetControlRequest; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchRequest + * @returns GetControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetControlRequest; /** - * Verifies a SearchRequest message. + * Verifies a GetControlRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetControlRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchRequest + * @returns GetControlRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetControlRequest; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. - * @param message SearchRequest + * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. + * @param message GetControlRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchRequest to JSON. + * Converts this GetControlRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SearchRequest + * Gets the default type url for GetControlRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SearchRequest { - - /** Properties of a FacetSpec. */ - interface IFacetSpec { - - /** FacetSpec facetKey */ - facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - - /** FacetSpec limit */ - limit?: (number|null); - - /** FacetSpec excludedFilterKeys */ - excludedFilterKeys?: (string[]|null); - - /** FacetSpec enableDynamicPosition */ - enableDynamicPosition?: (boolean|null); - } - - /** Represents a FacetSpec. */ - class FacetSpec implements IFacetSpec { - - /** - * Constructs a new FacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec); - - /** FacetSpec facetKey. */ - public facetKey?: (google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null); - - /** FacetSpec limit. */ - public limit: number; - - /** FacetSpec excludedFilterKeys. */ - public excludedFilterKeys: string[]; - - /** FacetSpec enableDynamicPosition. */ - public enableDynamicPosition: boolean; - - /** - * Creates a new FacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. - * @param message FacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Verifies a FacetSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec; - - /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. - * @param message FacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FacetSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FacetSpec { - - /** Properties of a FacetKey. */ - interface IFacetKey { - - /** FacetKey key */ - key?: (string|null); - - /** FacetKey intervals */ - intervals?: (google.cloud.retail.v2alpha.IInterval[]|null); - - /** FacetKey restrictedValues */ - restrictedValues?: (string[]|null); - - /** FacetKey prefixes */ - prefixes?: (string[]|null); - - /** FacetKey contains */ - contains?: (string[]|null); - - /** FacetKey caseInsensitive */ - caseInsensitive?: (boolean|null); - - /** FacetKey orderBy */ - orderBy?: (string|null); - - /** FacetKey query */ - query?: (string|null); - - /** FacetKey returnMinMax */ - returnMinMax?: (boolean|null); - } - - /** Represents a FacetKey. */ - class FacetKey implements IFacetKey { - - /** - * Constructs a new FacetKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey); - - /** FacetKey key. */ - public key: string; - - /** FacetKey intervals. */ - public intervals: google.cloud.retail.v2alpha.IInterval[]; - - /** FacetKey restrictedValues. */ - public restrictedValues: string[]; - - /** FacetKey prefixes. */ - public prefixes: string[]; - - /** FacetKey contains. */ - public contains: string[]; - - /** FacetKey caseInsensitive. */ - public caseInsensitive: boolean; - - /** FacetKey orderBy. */ - public orderBy: string; - - /** FacetKey query. */ - public query: string; - - /** FacetKey returnMinMax. */ - public returnMinMax: boolean; - - /** - * Creates a new FacetKey instance using the specified properties. - * @param [properties] Properties to set - * @returns FacetKey instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @param message FacetKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - - /** - * Verifies a FacetKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FacetKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey; - - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @param message FacetKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FacetKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FacetKey - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DynamicFacetSpec. */ - interface IDynamicFacetSpec { - - /** DynamicFacetSpec mode */ - mode?: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null); - } - - /** Represents a DynamicFacetSpec. */ - class DynamicFacetSpec implements IDynamicFacetSpec { - - /** - * Constructs a new DynamicFacetSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec); - - /** DynamicFacetSpec mode. */ - public mode: (google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode); - - /** - * Creates a new DynamicFacetSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns DynamicFacetSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - - /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. - * @param message DynamicFacetSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - - /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DynamicFacetSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - - /** - * Verifies a DynamicFacetSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DynamicFacetSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec; - - /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. - * @param message DynamicFacetSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DynamicFacetSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DynamicFacetSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DynamicFacetSpec { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - DISABLED = 1, - ENABLED = 2 - } - } - - /** Properties of a BoostSpec. */ - interface IBoostSpec { + /** Properties of a ListControlsRequest. */ + interface IListControlsRequest { - /** BoostSpec conditionBoostSpecs */ - conditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + /** ListControlsRequest parent */ + parent?: (string|null); - /** BoostSpec skipBoostSpecValidation */ - skipBoostSpecValidation?: (boolean|null); - } + /** ListControlsRequest pageSize */ + pageSize?: (number|null); - /** Represents a BoostSpec. */ - class BoostSpec implements IBoostSpec { + /** ListControlsRequest pageToken */ + pageToken?: (string|null); - /** - * Constructs a new BoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec); + /** ListControlsRequest filter */ + filter?: (string|null); + } - /** BoostSpec conditionBoostSpecs. */ - public conditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; + /** Represents a ListControlsRequest. */ + class ListControlsRequest implements IListControlsRequest { - /** BoostSpec skipBoostSpecValidation. */ - public skipBoostSpecValidation?: (boolean|null); + /** + * Constructs a new ListControlsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListControlsRequest); - /** BoostSpec _skipBoostSpecValidation. */ - public _skipBoostSpecValidation?: "skipBoostSpecValidation"; + /** ListControlsRequest parent. */ + public parent: string; - /** - * Creates a new BoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns BoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** ListControlsRequest pageSize. */ + public pageSize: number; - /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListControlsRequest pageToken. */ + public pageToken: string; - /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. - * @param message BoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListControlsRequest filter. */ + public filter: string; - /** - * Decodes a BoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** + * Creates a new ListControlsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListControlsRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListControlsRequest): google.cloud.retail.v2alpha.ListControlsRequest; - /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** + * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. + * @param message ListControlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a BoostSpec message. - * @param message 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 ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. + * @param message ListControlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec; + /** + * Decodes a ListControlsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListControlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListControlsRequest; - /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. - * @param message BoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListControlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListControlsRequest; - /** - * Converts this BoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies a ListControlsRequest message. + * @param message 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 BoostSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a ListControlsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListControlsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListControlsRequest; - namespace BoostSpec { + /** + * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. + * @param message ListControlsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListControlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a ConditionBoostSpec. */ - interface IConditionBoostSpec { + /** + * Converts this ListControlsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ConditionBoostSpec condition */ - condition?: (string|null); + /** + * Gets the default type url for ListControlsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ConditionBoostSpec boost */ - boost?: (number|null); - } + /** Properties of a ListControlsResponse. */ + interface IListControlsResponse { - /** Represents a ConditionBoostSpec. */ - class ConditionBoostSpec implements IConditionBoostSpec { + /** ListControlsResponse controls */ + controls?: (google.cloud.retail.v2alpha.IControl[]|null); - /** - * Constructs a new ConditionBoostSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec); + /** ListControlsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** ConditionBoostSpec condition. */ - public condition: string; + /** Represents a ListControlsResponse. */ + class ListControlsResponse implements IListControlsResponse { - /** ConditionBoostSpec boost. */ - public boost: number; + /** + * Constructs a new ListControlsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListControlsResponse); - /** - * Creates a new ConditionBoostSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns ConditionBoostSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** ListControlsResponse controls. */ + public controls: google.cloud.retail.v2alpha.IControl[]; - /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListControlsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. - * @param message ConditionBoostSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListControlsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListControlsResponse instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListControlsResponse): google.cloud.retail.v2alpha.ListControlsResponse; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. + * @param message ListControlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConditionBoostSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Encodes the specified ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. + * @param message ListControlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ConditionBoostSpec message. - * @param message 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 ListControlsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListControlsResponse; - /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConditionBoostSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec; + /** + * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListControlsResponse; - /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. - * @param message ConditionBoostSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListControlsResponse message. + * @param message 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 ConditionBoostSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListControlsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListControlsResponse; - /** - * Gets the default type url for ConditionBoostSpec - * @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 ListControlsResponse message. Also converts values to other types if specified. + * @param message ListControlsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListControlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a QueryExpansionSpec. */ - interface IQueryExpansionSpec { + /** + * Converts this ListControlsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** QueryExpansionSpec condition */ - condition?: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null); + /** + * Gets the default type url for ListControlsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** QueryExpansionSpec pinUnexpandedResults */ - pinUnexpandedResults?: (boolean|null); - } + /** Properties of a MerchantCenterAccountLink. */ + interface IMerchantCenterAccountLink { - /** Represents a QueryExpansionSpec. */ - class QueryExpansionSpec implements IQueryExpansionSpec { + /** MerchantCenterAccountLink name */ + name?: (string|null); - /** - * Constructs a new QueryExpansionSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec); + /** MerchantCenterAccountLink id */ + id?: (string|null); - /** QueryExpansionSpec condition. */ - public condition: (google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|keyof typeof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition); + /** MerchantCenterAccountLink merchantCenterAccountId */ + merchantCenterAccountId?: (number|Long|string|null); - /** QueryExpansionSpec pinUnexpandedResults. */ - public pinUnexpandedResults: boolean; + /** MerchantCenterAccountLink branchId */ + branchId?: (string|null); - /** - * Creates a new QueryExpansionSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryExpansionSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** MerchantCenterAccountLink feedLabel */ + feedLabel?: (string|null); - /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** MerchantCenterAccountLink languageCode */ + languageCode?: (string|null); - /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. - * @param message QueryExpansionSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** MerchantCenterAccountLink feedFilters */ + feedFilters?: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter[]|null); - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** MerchantCenterAccountLink state */ + state?: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|keyof typeof google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|null); - /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryExpansionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** MerchantCenterAccountLink projectId */ + projectId?: (string|null); - /** - * Verifies a QueryExpansionSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MerchantCenterAccountLink source */ + source?: (string|null); + } - /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryExpansionSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec; + /** Represents a MerchantCenterAccountLink. */ + class MerchantCenterAccountLink implements IMerchantCenterAccountLink { - /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. - * @param message QueryExpansionSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new MerchantCenterAccountLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterAccountLink); - /** - * Converts this QueryExpansionSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** MerchantCenterAccountLink name. */ + public name: string; - /** - * Gets the default type url for QueryExpansionSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** MerchantCenterAccountLink id. */ + public id: string; - namespace QueryExpansionSpec { + /** MerchantCenterAccountLink merchantCenterAccountId. */ + public merchantCenterAccountId: (number|Long|string); - /** Condition enum. */ - enum Condition { - CONDITION_UNSPECIFIED = 0, - DISABLED = 1, - AUTO = 3 - } - } + /** MerchantCenterAccountLink branchId. */ + public branchId: string; - /** Properties of a PersonalizationSpec. */ - interface IPersonalizationSpec { + /** MerchantCenterAccountLink feedLabel. */ + public feedLabel: string; - /** PersonalizationSpec mode */ - mode?: (google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|null); - } + /** MerchantCenterAccountLink languageCode. */ + public languageCode: string; - /** Represents a PersonalizationSpec. */ - class PersonalizationSpec implements IPersonalizationSpec { + /** MerchantCenterAccountLink feedFilters. */ + public feedFilters: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter[]; - /** - * Constructs a new PersonalizationSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec); + /** MerchantCenterAccountLink state. */ + public state: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|keyof typeof google.cloud.retail.v2alpha.MerchantCenterAccountLink.State); - /** PersonalizationSpec mode. */ - public mode: (google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode); + /** MerchantCenterAccountLink projectId. */ + public projectId: string; - /** - * Creates a new PersonalizationSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns PersonalizationSpec instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; + /** MerchantCenterAccountLink source. */ + public source: string; - /** - * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. - * @param message PersonalizationSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new MerchantCenterAccountLink instance using the specified properties. + * @param [properties] Properties to set + * @returns MerchantCenterAccountLink instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterAccountLink): google.cloud.retail.v2alpha.MerchantCenterAccountLink; - /** - * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. - * @param message PersonalizationSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified MerchantCenterAccountLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. + * @param message MerchantCenterAccountLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterAccountLink, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a PersonalizationSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PersonalizationSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; + /** + * Encodes the specified MerchantCenterAccountLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. + * @param message MerchantCenterAccountLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterAccountLink, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PersonalizationSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; + /** + * Decodes a MerchantCenterAccountLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MerchantCenterAccountLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.MerchantCenterAccountLink; - /** - * Verifies a PersonalizationSpec message. - * @param message 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 MerchantCenterAccountLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MerchantCenterAccountLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.MerchantCenterAccountLink; - /** - * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PersonalizationSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec; + /** + * Verifies a MerchantCenterAccountLink message. + * @param message Plain object 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 PersonalizationSpec message. Also converts values to other types if specified. - * @param message PersonalizationSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a MerchantCenterAccountLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MerchantCenterAccountLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterAccountLink; + + /** + * Creates a plain object from a MerchantCenterAccountLink message. Also converts values to other types if specified. + * @param message MerchantCenterAccountLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this PersonalizationSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this MerchantCenterAccountLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for PersonalizationSpec - * @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 MerchantCenterAccountLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - namespace PersonalizationSpec { + namespace MerchantCenterAccountLink { - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - AUTO = 1, - DISABLED = 2 - } - } + /** Properties of a MerchantCenterFeedFilter. */ + interface IMerchantCenterFeedFilter { - /** Properties of a SpellCorrectionSpec. */ - interface ISpellCorrectionSpec { + /** MerchantCenterFeedFilter primaryFeedId */ + primaryFeedId?: (number|Long|string|null); - /** SpellCorrectionSpec mode */ - mode?: (google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|null); + /** MerchantCenterFeedFilter primaryFeedName */ + primaryFeedName?: (string|null); } - /** Represents a SpellCorrectionSpec. */ - class SpellCorrectionSpec implements ISpellCorrectionSpec { + /** Represents a MerchantCenterFeedFilter. */ + class MerchantCenterFeedFilter implements IMerchantCenterFeedFilter { /** - * Constructs a new SpellCorrectionSpec. + * Constructs a new MerchantCenterFeedFilter. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec); + constructor(properties?: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter); - /** SpellCorrectionSpec mode. */ - public mode: (google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|keyof typeof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode); + /** MerchantCenterFeedFilter primaryFeedId. */ + public primaryFeedId: (number|Long|string); + + /** MerchantCenterFeedFilter primaryFeedName. */ + public primaryFeedName: string; /** - * Creates a new SpellCorrectionSpec instance using the specified properties. + * Creates a new MerchantCenterFeedFilter instance using the specified properties. * @param [properties] Properties to set - * @returns SpellCorrectionSpec instance + * @returns MerchantCenterFeedFilter instance */ - public static create(properties?: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; + public static create(properties?: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; /** - * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. - * @param message SpellCorrectionSpec message or plain object to encode + * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. + * @param message MerchantCenterFeedFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. - * @param message SpellCorrectionSpec message or plain object to encode + * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. + * @param message MerchantCenterFeedFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpellCorrectionSpec message from the specified reader or buffer. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpellCorrectionSpec + * @returns MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; /** - * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpellCorrectionSpec + * @returns MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; /** - * Verifies a SpellCorrectionSpec message. + * Verifies a MerchantCenterFeedFilter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpellCorrectionSpec + * @returns MerchantCenterFeedFilter */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; /** - * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. - * @param message SpellCorrectionSpec + * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. + * @param message MerchantCenterFeedFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpellCorrectionSpec to JSON. + * Converts this MerchantCenterFeedFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SpellCorrectionSpec + * Gets the default type url for MerchantCenterFeedFilter * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SpellCorrectionSpec { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - SUGGESTION_ONLY = 1, - AUTO = 2 - } + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3 } + } - /** RelevanceThreshold enum. */ - enum RelevanceThreshold { - RELEVANCE_THRESHOLD_UNSPECIFIED = 0, - HIGH = 1, - MEDIUM = 2, - LOW = 3, - LOWEST = 4 - } + /** Properties of a CreateMerchantCenterAccountLinkMetadata. */ + interface ICreateMerchantCenterAccountLinkMetadata { - /** SearchMode enum. */ - enum SearchMode { - SEARCH_MODE_UNSPECIFIED = 0, - PRODUCT_SEARCH_ONLY = 1, - FACETED_SEARCH_ONLY = 2 - } + /** CreateMerchantCenterAccountLinkMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateMerchantCenterAccountLinkMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } - /** Properties of a SearchResponse. */ - interface ISearchResponse { + /** Represents a CreateMerchantCenterAccountLinkMetadata. */ + class CreateMerchantCenterAccountLinkMetadata implements ICreateMerchantCenterAccountLinkMetadata { - /** SearchResponse results */ - results?: (google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]|null); + /** + * Constructs a new CreateMerchantCenterAccountLinkMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata); + + /** CreateMerchantCenterAccountLinkMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateMerchantCenterAccountLinkMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateMerchantCenterAccountLinkMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMerchantCenterAccountLinkMetadata instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + + /** + * Encodes the specified CreateMerchantCenterAccountLinkMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. + * @param message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMerchantCenterAccountLinkMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. + * @param message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMerchantCenterAccountLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + + /** + * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMerchantCenterAccountLinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + + /** + * Verifies a CreateMerchantCenterAccountLinkMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMerchantCenterAccountLinkMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMerchantCenterAccountLinkMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + + /** + * Creates a plain object from a CreateMerchantCenterAccountLinkMetadata message. Also converts values to other types if specified. + * @param message CreateMerchantCenterAccountLinkMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMerchantCenterAccountLinkMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMerchantCenterAccountLinkMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a MerchantCenterAccountLinkService */ + class MerchantCenterAccountLinkService extends $protobuf.rpc.Service { + + /** + * Constructs a new MerchantCenterAccountLinkService 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 MerchantCenterAccountLinkService 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): MerchantCenterAccountLinkService; + + /** + * Calls ListMerchantCenterAccountLinks. + * @param request ListMerchantCenterAccountLinksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMerchantCenterAccountLinksResponse + */ + public listMerchantCenterAccountLinks(request: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.ListMerchantCenterAccountLinksCallback): void; + + /** + * Calls ListMerchantCenterAccountLinks. + * @param request ListMerchantCenterAccountLinksRequest message or plain object + * @returns Promise + */ + public listMerchantCenterAccountLinks(request: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest): Promise; + + /** + * Calls CreateMerchantCenterAccountLink. + * @param request CreateMerchantCenterAccountLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.CreateMerchantCenterAccountLinkCallback): void; + + /** + * Calls CreateMerchantCenterAccountLink. + * @param request CreateMerchantCenterAccountLinkRequest message or plain object + * @returns Promise + */ + public createMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest): Promise; + + /** + * Calls DeleteMerchantCenterAccountLink. + * @param request DeleteMerchantCenterAccountLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.DeleteMerchantCenterAccountLinkCallback): void; + + /** + * Calls DeleteMerchantCenterAccountLink. + * @param request DeleteMerchantCenterAccountLinkRequest message or plain object + * @returns Promise + */ + public deleteMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest): Promise; + } + + namespace MerchantCenterAccountLinkService { + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|listMerchantCenterAccountLinks}. + * @param error Error, if any + * @param [response] ListMerchantCenterAccountLinksResponse + */ + type ListMerchantCenterAccountLinksCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|createMerchantCenterAccountLink}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMerchantCenterAccountLinkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|deleteMerchantCenterAccountLink}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMerchantCenterAccountLinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListMerchantCenterAccountLinksRequest. */ + interface IListMerchantCenterAccountLinksRequest { + + /** ListMerchantCenterAccountLinksRequest parent */ + parent?: (string|null); + } + + /** Represents a ListMerchantCenterAccountLinksRequest. */ + class ListMerchantCenterAccountLinksRequest implements IListMerchantCenterAccountLinksRequest { + + /** + * Constructs a new ListMerchantCenterAccountLinksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest); + + /** ListMerchantCenterAccountLinksRequest parent. */ + public parent: string; + + /** + * Creates a new ListMerchantCenterAccountLinksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMerchantCenterAccountLinksRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + + /** + * Encodes the specified ListMerchantCenterAccountLinksRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * @param message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMerchantCenterAccountLinksRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * @param message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMerchantCenterAccountLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + + /** + * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMerchantCenterAccountLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + + /** + * Verifies a ListMerchantCenterAccountLinksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMerchantCenterAccountLinksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMerchantCenterAccountLinksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + + /** + * Creates a plain object from a ListMerchantCenterAccountLinksRequest message. Also converts values to other types if specified. + * @param message ListMerchantCenterAccountLinksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMerchantCenterAccountLinksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMerchantCenterAccountLinksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMerchantCenterAccountLinksResponse. */ + interface IListMerchantCenterAccountLinksResponse { + + /** ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks */ + merchantCenterAccountLinks?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink[]|null); + } + + /** Represents a ListMerchantCenterAccountLinksResponse. */ + class ListMerchantCenterAccountLinksResponse implements IListMerchantCenterAccountLinksResponse { + + /** + * Constructs a new ListMerchantCenterAccountLinksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse); + + /** ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks. */ + public merchantCenterAccountLinks: google.cloud.retail.v2alpha.IMerchantCenterAccountLink[]; + + /** + * Creates a new ListMerchantCenterAccountLinksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMerchantCenterAccountLinksResponse instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + + /** + * Encodes the specified ListMerchantCenterAccountLinksResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. + * @param message ListMerchantCenterAccountLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMerchantCenterAccountLinksResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. + * @param message ListMerchantCenterAccountLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMerchantCenterAccountLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + + /** + * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMerchantCenterAccountLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + + /** + * Verifies a ListMerchantCenterAccountLinksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMerchantCenterAccountLinksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMerchantCenterAccountLinksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + + /** + * Creates a plain object from a ListMerchantCenterAccountLinksResponse message. Also converts values to other types if specified. + * @param message ListMerchantCenterAccountLinksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMerchantCenterAccountLinksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** SearchResponse facets */ - facets?: (google.cloud.retail.v2alpha.SearchResponse.IFacet[]|null); + /** + * Gets the default type url for ListMerchantCenterAccountLinksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** SearchResponse totalSize */ - totalSize?: (number|null); + /** Properties of a CreateMerchantCenterAccountLinkRequest. */ + interface ICreateMerchantCenterAccountLinkRequest { - /** SearchResponse correctedQuery */ - correctedQuery?: (string|null); + /** CreateMerchantCenterAccountLinkRequest parent */ + parent?: (string|null); - /** SearchResponse attributionToken */ - attributionToken?: (string|null); + /** CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink */ + merchantCenterAccountLink?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null); + } - /** SearchResponse nextPageToken */ - nextPageToken?: (string|null); + /** Represents a CreateMerchantCenterAccountLinkRequest. */ + class CreateMerchantCenterAccountLinkRequest implements ICreateMerchantCenterAccountLinkRequest { - /** SearchResponse queryExpansionInfo */ - queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); + /** + * Constructs a new CreateMerchantCenterAccountLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest); - /** SearchResponse redirectUri */ - redirectUri?: (string|null); + /** CreateMerchantCenterAccountLinkRequest parent. */ + public parent: string; - /** SearchResponse appliedControls */ - appliedControls?: (string[]|null); + /** CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink. */ + public merchantCenterAccountLink?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null); - /** SearchResponse invalidConditionBoostSpecs */ - invalidConditionBoostSpecs?: (google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]|null); + /** + * Creates a new CreateMerchantCenterAccountLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMerchantCenterAccountLinkRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; - /** SearchResponse experimentInfo */ - experimentInfo?: (google.cloud.retail.v2alpha.IExperimentInfo[]|null); - } + /** + * Encodes the specified CreateMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. + * @param message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a SearchResponse. */ - class SearchResponse implements ISearchResponse { + /** + * Encodes the specified CreateMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. + * @param message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new SearchResponse. - * @param [properties] Properties to set + * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMerchantCenterAccountLinkRequest + * @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.retail.v2alpha.ISearchResponse); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; - /** SearchResponse results. */ - public results: google.cloud.retail.v2alpha.SearchResponse.ISearchResult[]; + /** + * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMerchantCenterAccountLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; - /** SearchResponse facets. */ - public facets: google.cloud.retail.v2alpha.SearchResponse.IFacet[]; + /** + * Verifies a CreateMerchantCenterAccountLinkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SearchResponse totalSize. */ - public totalSize: number; + /** + * Creates a CreateMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMerchantCenterAccountLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; - /** SearchResponse correctedQuery. */ - public correctedQuery: string; + /** + * Creates a plain object from a CreateMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. + * @param message CreateMerchantCenterAccountLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SearchResponse attributionToken. */ - public attributionToken: string; + /** + * Converts this CreateMerchantCenterAccountLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** SearchResponse nextPageToken. */ - public nextPageToken: string; + /** + * Gets the default type url for CreateMerchantCenterAccountLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** SearchResponse queryExpansionInfo. */ - public queryExpansionInfo?: (google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null); + /** Properties of a DeleteMerchantCenterAccountLinkRequest. */ + interface IDeleteMerchantCenterAccountLinkRequest { - /** SearchResponse redirectUri. */ - public redirectUri: string; + /** DeleteMerchantCenterAccountLinkRequest name */ + name?: (string|null); + } - /** SearchResponse appliedControls. */ - public appliedControls: string[]; + /** Represents a DeleteMerchantCenterAccountLinkRequest. */ + class DeleteMerchantCenterAccountLinkRequest implements IDeleteMerchantCenterAccountLinkRequest { - /** SearchResponse invalidConditionBoostSpecs. */ - public invalidConditionBoostSpecs: google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec[]; + /** + * Constructs a new DeleteMerchantCenterAccountLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest); - /** SearchResponse experimentInfo. */ - public experimentInfo: google.cloud.retail.v2alpha.IExperimentInfo[]; + /** DeleteMerchantCenterAccountLinkRequest name. */ + public name: string; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new DeleteMerchantCenterAccountLinkRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SearchResponse instance + * @returns DeleteMerchantCenterAccountLinkRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISearchResponse): google.cloud.retail.v2alpha.SearchResponse; + public static create(properties?: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified DeleteMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. + * @param message DeleteMerchantCenterAccountLinkRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. - * @param message SearchResponse message or plain object to encode + * Encodes the specified DeleteMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. + * @param message DeleteMerchantCenterAccountLinkRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISearchResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchResponse + * @returns DeleteMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchResponse + * @returns DeleteMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; /** - * Verifies a SearchResponse message. + * Verifies a DeleteMerchantCenterAccountLinkRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchResponse + * @returns DeleteMerchantCenterAccountLinkRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. - * @param message SearchResponse + * Creates a plain object from a DeleteMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. + * @param message DeleteMerchantCenterAccountLinkRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchResponse to JSON. + * Converts this DeleteMerchantCenterAccountLinkRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SearchResponse + * Gets the default type url for DeleteMerchantCenterAccountLinkRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SearchResponse { + /** Properties of a Model. */ + interface IModel { - /** Properties of a SearchResult. */ - interface ISearchResult { + /** Model pageOptimizationConfig */ + pageOptimizationConfig?: (google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null); - /** SearchResult id */ - id?: (string|null); + /** Model name */ + name?: (string|null); - /** SearchResult product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** Model displayName */ + displayName?: (string|null); - /** SearchResult matchingVariantCount */ - matchingVariantCount?: (number|null); + /** Model trainingState */ + trainingState?: (google.cloud.retail.v2alpha.Model.TrainingState|keyof typeof google.cloud.retail.v2alpha.Model.TrainingState|null); - /** SearchResult matchingVariantFields */ - matchingVariantFields?: ({ [k: string]: google.protobuf.IFieldMask }|null); + /** Model servingState */ + servingState?: (google.cloud.retail.v2alpha.Model.ServingState|keyof typeof google.cloud.retail.v2alpha.Model.ServingState|null); - /** SearchResult variantRollupValues */ - variantRollupValues?: ({ [k: string]: google.protobuf.IValue }|null); + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** SearchResult personalLabels */ - personalLabels?: (string[]|null); - } + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** Represents a SearchResult. */ - class SearchResult implements ISearchResult { + /** Model type */ + type?: (string|null); - /** - * Constructs a new SearchResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult); + /** Model optimizationObjective */ + optimizationObjective?: (string|null); - /** SearchResult id. */ - public id: string; + /** Model periodicTuningState */ + periodicTuningState?: (google.cloud.retail.v2alpha.Model.PeriodicTuningState|keyof typeof google.cloud.retail.v2alpha.Model.PeriodicTuningState|null); - /** SearchResult product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** Model lastTuneTime */ + lastTuneTime?: (google.protobuf.ITimestamp|null); - /** SearchResult matchingVariantCount. */ - public matchingVariantCount: number; + /** Model tuningOperation */ + tuningOperation?: (string|null); - /** SearchResult matchingVariantFields. */ - public matchingVariantFields: { [k: string]: google.protobuf.IFieldMask }; + /** Model dataState */ + dataState?: (google.cloud.retail.v2alpha.Model.DataState|keyof typeof google.cloud.retail.v2alpha.Model.DataState|null); - /** SearchResult variantRollupValues. */ - public variantRollupValues: { [k: string]: google.protobuf.IValue }; + /** Model filteringOption */ + filteringOption?: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption|null); - /** SearchResult personalLabels. */ - public personalLabels: string[]; + /** Model servingConfigLists */ + servingConfigLists?: (google.cloud.retail.v2alpha.Model.IServingConfigList[]|null); - /** - * Creates a new SearchResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SearchResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.ISearchResult): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** Model modelFeaturesConfig */ + modelFeaturesConfig?: (google.cloud.retail.v2alpha.Model.IModelFeaturesConfig|null); + } - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Model. */ + class Model implements IModel { - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @param message SearchResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.ISearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IModel); - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** Model pageOptimizationConfig. */ + public pageOptimizationConfig?: (google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null); - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** Model name. */ + public name: string; - /** - * Verifies a SearchResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Model displayName. */ + public displayName: string; - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SearchResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.SearchResult; + /** Model trainingState. */ + public trainingState: (google.cloud.retail.v2alpha.Model.TrainingState|keyof typeof google.cloud.retail.v2alpha.Model.TrainingState); - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @param message SearchResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.SearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Model servingState. */ + public servingState: (google.cloud.retail.v2alpha.Model.ServingState|keyof typeof google.cloud.retail.v2alpha.Model.ServingState); - /** - * Converts this SearchResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Gets the default type url for SearchResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** Properties of a Facet. */ - interface IFacet { + /** Model type. */ + public type: string; - /** Facet key */ - key?: (string|null); + /** Model optimizationObjective. */ + public optimizationObjective: string; - /** Facet values */ - values?: (google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]|null); + /** Model periodicTuningState. */ + public periodicTuningState: (google.cloud.retail.v2alpha.Model.PeriodicTuningState|keyof typeof google.cloud.retail.v2alpha.Model.PeriodicTuningState); - /** Facet dynamicFacet */ - dynamicFacet?: (boolean|null); + /** Model lastTuneTime. */ + public lastTuneTime?: (google.protobuf.ITimestamp|null); + + /** Model tuningOperation. */ + public tuningOperation: string; + + /** Model dataState. */ + public dataState: (google.cloud.retail.v2alpha.Model.DataState|keyof typeof google.cloud.retail.v2alpha.Model.DataState); + + /** Model filteringOption. */ + public filteringOption: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption); + + /** Model servingConfigLists. */ + public servingConfigLists: google.cloud.retail.v2alpha.Model.IServingConfigList[]; + + /** Model modelFeaturesConfig. */ + public modelFeaturesConfig?: (google.cloud.retail.v2alpha.Model.IModelFeaturesConfig|null); + + /** Model trainingConfig. */ + public trainingConfig?: "pageOptimizationConfig"; + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IModel): google.cloud.retail.v2alpha.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.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 { + + /** Properties of a PageOptimizationConfig. */ + interface IPageOptimizationConfig { + + /** PageOptimizationConfig pageOptimizationEventType */ + pageOptimizationEventType?: (string|null); + + /** PageOptimizationConfig panels */ + panels?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel[]|null); + + /** PageOptimizationConfig restriction */ + restriction?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|keyof typeof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|null); } - /** Represents a Facet. */ - class Facet implements IFacet { + /** Represents a PageOptimizationConfig. */ + class PageOptimizationConfig implements IPageOptimizationConfig { /** - * Constructs a new Facet. + * Constructs a new PageOptimizationConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet); + constructor(properties?: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig); - /** Facet key. */ - public key: string; + /** PageOptimizationConfig pageOptimizationEventType. */ + public pageOptimizationEventType: string; - /** Facet values. */ - public values: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue[]; + /** PageOptimizationConfig panels. */ + public panels: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel[]; - /** Facet dynamicFacet. */ - public dynamicFacet: boolean; + /** PageOptimizationConfig restriction. */ + public restriction: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|keyof typeof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction); /** - * Creates a new Facet instance using the specified properties. + * Creates a new PageOptimizationConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Facet instance + * @returns PageOptimizationConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IFacet): google.cloud.retail.v2alpha.SearchResponse.Facet; + public static create(properties?: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode + * Encodes the specified PageOptimizationConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. + * @param message PageOptimizationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @param message Facet message or plain object to encode + * Encodes the specified PageOptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. + * @param message PageOptimizationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IFacet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Facet message from the specified reader or buffer. + * Decodes a PageOptimizationConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Facet + * @returns PageOptimizationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.Facet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; /** - * Decodes a Facet message from the specified reader or buffer, length delimited. + * Decodes a PageOptimizationConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Facet + * @returns PageOptimizationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.Facet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; /** - * Verifies a Facet message. + * Verifies a PageOptimizationConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. + * Creates a PageOptimizationConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Facet + * @returns PageOptimizationConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @param message Facet + * Creates a plain object from a PageOptimizationConfig message. Also converts values to other types if specified. + * @param message PageOptimizationConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Facet to JSON. + * Converts this PageOptimizationConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Facet + * Gets the default type url for PageOptimizationConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Facet { - - /** Properties of a FacetValue. */ - interface IFacetValue { + namespace PageOptimizationConfig { - /** FacetValue value */ - value?: (string|null); + /** Properties of a Candidate. */ + interface ICandidate { - /** FacetValue interval */ - interval?: (google.cloud.retail.v2alpha.IInterval|null); + /** Candidate servingConfigId */ + servingConfigId?: (string|null); + } - /** FacetValue count */ - count?: (number|Long|string|null); + /** Represents a Candidate. */ + class Candidate implements ICandidate { - /** FacetValue minValue */ - minValue?: (number|null); + /** + * Constructs a new Candidate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate); - /** FacetValue maxValue */ - maxValue?: (number|null); - } + /** Candidate servingConfigId. */ + public servingConfigId?: (string|null); - /** Represents a FacetValue. */ - class FacetValue implements IFacetValue { + /** Candidate candidate. */ + public candidate?: "servingConfigId"; /** - * Constructs a new FacetValue. + * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set + * @returns Candidate instance */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue); + public static create(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - /** FacetValue value. */ - public value?: (string|null); + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. + * @param message Candidate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetValue interval. */ - public interval?: (google.cloud.retail.v2alpha.IInterval|null); + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. + * @param message Candidate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; - /** FacetValue count. */ - public count: (number|Long|string); + /** + * Decodes a Candidate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Candidate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - /** FacetValue minValue. */ - public minValue: number; + /** + * Decodes a Candidate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Candidate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - /** FacetValue maxValue. */ - public maxValue: number; + /** + * Verifies a Candidate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FacetValue facetValue. */ - public facetValue?: ("value"|"interval"); + /** + * Creates a Candidate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Candidate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; /** - * Creates a new FacetValue instance using the specified properties. + * Creates a plain object from a Candidate message. Also converts values to other types if specified. + * @param message Candidate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Candidate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Candidate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Panel. */ + interface IPanel { + + /** Panel displayName */ + displayName?: (string|null); + + /** Panel candidates */ + candidates?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate[]|null); + + /** Panel defaultCandidate */ + defaultCandidate?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null); + } + + /** Represents a Panel. */ + class Panel implements IPanel { + + /** + * Constructs a new Panel. * @param [properties] Properties to set - * @returns FacetValue instance */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + constructor(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel); + + /** Panel displayName. */ + public displayName: string; + + /** Panel candidates. */ + public candidates: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate[]; + + /** Panel defaultCandidate. */ + public defaultCandidate?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null); /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode + * Creates a new Panel instance using the specified properties. + * @param [properties] Properties to set + * @returns Panel instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; + + /** + * Encodes the specified Panel message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. + * @param message Panel message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @param message FacetValue message or plain object to encode + * Encodes the specified Panel message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. + * @param message Panel message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FacetValue message from the specified reader or buffer. + * Decodes a Panel message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FacetValue + * @returns Panel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. + * Decodes a Panel message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FacetValue + * @returns Panel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; /** - * Verifies a FacetValue message. + * Verifies a Panel message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. + * Creates a Panel message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FacetValue + * @returns Panel */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @param message FacetValue + * Creates a plain object from a Panel message. Also converts values to other types if specified. + * @param message Panel * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FacetValue to JSON. + * Converts this Panel to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FacetValue + * Gets the default type url for Panel * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Properties of a QueryExpansionInfo. */ - interface IQueryExpansionInfo { + /** Restriction enum. */ + enum Restriction { + RESTRICTION_UNSPECIFIED = 0, + NO_RESTRICTION = 1, + UNIQUE_SERVING_CONFIG_RESTRICTION = 2, + UNIQUE_MODEL_RESTRICTION = 3, + UNIQUE_MODEL_TYPE_RESTRICTION = 4 + } + } - /** QueryExpansionInfo expandedQuery */ - expandedQuery?: (boolean|null); + /** Properties of a ServingConfigList. */ + interface IServingConfigList { - /** QueryExpansionInfo pinnedResultCount */ - pinnedResultCount?: (number|Long|string|null); + /** ServingConfigList servingConfigIds */ + servingConfigIds?: (string[]|null); } - /** Represents a QueryExpansionInfo. */ - class QueryExpansionInfo implements IQueryExpansionInfo { + /** Represents a ServingConfigList. */ + class ServingConfigList implements IServingConfigList { /** - * Constructs a new QueryExpansionInfo. + * Constructs a new ServingConfigList. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo); - - /** QueryExpansionInfo expandedQuery. */ - public expandedQuery: boolean; + constructor(properties?: google.cloud.retail.v2alpha.Model.IServingConfigList); - /** QueryExpansionInfo pinnedResultCount. */ - public pinnedResultCount: (number|Long|string); + /** ServingConfigList servingConfigIds. */ + public servingConfigIds: string[]; /** - * Creates a new QueryExpansionInfo instance using the specified properties. + * Creates a new ServingConfigList instance using the specified properties. * @param [properties] Properties to set - * @returns QueryExpansionInfo instance + * @returns ServingConfigList instance */ - public static create(properties?: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + public static create(properties?: google.cloud.retail.v2alpha.Model.IServingConfigList): google.cloud.retail.v2alpha.Model.ServingConfigList; /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode + * Encodes the specified ServingConfigList message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. + * @param message ServingConfigList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.Model.IServingConfigList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @param message QueryExpansionInfo message or plain object to encode + * Encodes the specified ServingConfigList message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. + * @param message ServingConfigList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IServingConfigList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. + * Decodes a ServingConfigList message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryExpansionInfo + * @returns ServingConfigList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.ServingConfigList; /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. + * Decodes a ServingConfigList message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryExpansionInfo + * @returns ServingConfigList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.ServingConfigList; /** - * Verifies a QueryExpansionInfo message. + * Verifies a ServingConfigList message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ServingConfigList message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryExpansionInfo + * @returns ServingConfigList */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.ServingConfigList; /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @param message QueryExpansionInfo + * Creates a plain object from a ServingConfigList message. Also converts values to other types if specified. + * @param message ServingConfigList * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Model.ServingConfigList, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryExpansionInfo to JSON. + * Converts this ServingConfigList to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for QueryExpansionInfo + * Gets the default type url for ServingConfigList * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - - /** Properties of an ExperimentInfo. */ - interface IExperimentInfo { - - /** ExperimentInfo servingConfigExperiment */ - servingConfigExperiment?: (google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null); - - /** ExperimentInfo experiment */ - experiment?: (string|null); - } - - /** Represents an ExperimentInfo. */ - class ExperimentInfo implements IExperimentInfo { - - /** - * Constructs a new ExperimentInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IExperimentInfo); - - /** ExperimentInfo servingConfigExperiment. */ - public servingConfigExperiment?: (google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null); - - /** ExperimentInfo experiment. */ - public experiment: string; - - /** ExperimentInfo experimentMetadata. */ - public experimentMetadata?: "servingConfigExperiment"; - - /** - * Creates a new ExperimentInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ExperimentInfo instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IExperimentInfo): google.cloud.retail.v2alpha.ExperimentInfo; - - /** - * Encodes the specified ExperimentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. - * @param message ExperimentInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IExperimentInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExperimentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. - * @param message ExperimentInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IExperimentInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExperimentInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExperimentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExperimentInfo; - - /** - * Decodes an ExperimentInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExperimentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExperimentInfo; - - /** - * Verifies an ExperimentInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExperimentInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExperimentInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExperimentInfo; - - /** - * Creates a plain object from an ExperimentInfo message. Also converts values to other types if specified. - * @param message ExperimentInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.ExperimentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExperimentInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExperimentInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExperimentInfo { - - /** Properties of a ServingConfigExperiment. */ - interface IServingConfigExperiment { - /** ServingConfigExperiment originalServingConfig */ - originalServingConfig?: (string|null); + /** Properties of a FrequentlyBoughtTogetherFeaturesConfig. */ + interface IFrequentlyBoughtTogetherFeaturesConfig { - /** ServingConfigExperiment experimentServingConfig */ - experimentServingConfig?: (string|null); + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType */ + contextProductsType?: (google.cloud.retail.v2alpha.Model.ContextProductsType|keyof typeof google.cloud.retail.v2alpha.Model.ContextProductsType|null); } - /** Represents a ServingConfigExperiment. */ - class ServingConfigExperiment implements IServingConfigExperiment { + /** Represents a FrequentlyBoughtTogetherFeaturesConfig. */ + class FrequentlyBoughtTogetherFeaturesConfig implements IFrequentlyBoughtTogetherFeaturesConfig { /** - * Constructs a new ServingConfigExperiment. + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment); - - /** ServingConfigExperiment originalServingConfig. */ - public originalServingConfig: string; + constructor(properties?: google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig); - /** ServingConfigExperiment experimentServingConfig. */ - public experimentServingConfig: string; + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType. */ + public contextProductsType: (google.cloud.retail.v2alpha.Model.ContextProductsType|keyof typeof google.cloud.retail.v2alpha.Model.ContextProductsType); /** - * Creates a new ServingConfigExperiment instance using the specified properties. + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ServingConfigExperiment instance + * @returns FrequentlyBoughtTogetherFeaturesConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; + public static create(properties?: google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig): google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig; /** - * Encodes the specified ServingConfigExperiment message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. - * @param message ServingConfigExperiment message or plain object to encode + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServingConfigExperiment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. - * @param message ServingConfigExperiment message or plain object to encode + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServingConfigExperiment message from the specified reader or buffer. + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServingConfigExperiment + * @returns FrequentlyBoughtTogetherFeaturesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig; /** - * Decodes a ServingConfigExperiment message from the specified reader or buffer, length delimited. + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServingConfigExperiment + * @returns FrequentlyBoughtTogetherFeaturesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig; /** - * Verifies a ServingConfigExperiment message. + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServingConfigExperiment message from a plain object. Also converts values to their respective internal types. + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServingConfigExperiment + * @returns FrequentlyBoughtTogetherFeaturesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig; /** - * Creates a plain object from a ServingConfigExperiment message. Also converts values to other types if specified. - * @param message ServingConfigExperiment + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @param message FrequentlyBoughtTogetherFeaturesConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServingConfigExperiment to JSON. + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServingConfigExperiment + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - - /** Properties of a Control. */ - interface IControl { - - /** Control facetSpec */ - facetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null); - - /** Control rule */ - rule?: (google.cloud.retail.v2alpha.IRule|null); - - /** Control name */ - name?: (string|null); - /** Control displayName */ - displayName?: (string|null); - - /** Control associatedServingConfigIds */ - associatedServingConfigIds?: (string[]|null); - - /** Control solutionTypes */ - solutionTypes?: (google.cloud.retail.v2alpha.SolutionType[]|null); + /** Properties of a ModelFeaturesConfig. */ + interface IModelFeaturesConfig { - /** Control searchSolutionUseCase */ - searchSolutionUseCase?: (google.cloud.retail.v2alpha.SearchSolutionUseCase[]|null); - } - - /** Represents a Control. */ - class Control implements IControl { - - /** - * Constructs a new Control. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IControl); + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig */ + frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); + } - /** Control facetSpec. */ - public facetSpec?: (google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null); + /** Represents a ModelFeaturesConfig. */ + class ModelFeaturesConfig implements IModelFeaturesConfig { - /** Control rule. */ - public rule?: (google.cloud.retail.v2alpha.IRule|null); + /** + * Constructs a new ModelFeaturesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.Model.IModelFeaturesConfig); - /** Control name. */ - public name: string; + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig. */ + public frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); - /** Control displayName. */ - public displayName: string; + /** ModelFeaturesConfig typeDedicatedConfig. */ + public typeDedicatedConfig?: "frequentlyBoughtTogetherConfig"; - /** Control associatedServingConfigIds. */ - public associatedServingConfigIds: string[]; + /** + * Creates a new ModelFeaturesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelFeaturesConfig instance + */ + public static create(properties?: google.cloud.retail.v2alpha.Model.IModelFeaturesConfig): google.cloud.retail.v2alpha.Model.ModelFeaturesConfig; - /** Control solutionTypes. */ - public solutionTypes: google.cloud.retail.v2alpha.SolutionType[]; + /** + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Control searchSolutionUseCase. */ - public searchSolutionUseCase: google.cloud.retail.v2alpha.SearchSolutionUseCase[]; + /** + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Control control. */ - public control?: ("facetSpec"|"rule"); + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.ModelFeaturesConfig; - /** - * Creates a new Control instance using the specified properties. - * @param [properties] Properties to set - * @returns Control instance - */ - public static create(properties?: google.cloud.retail.v2alpha.IControl): google.cloud.retail.v2alpha.Control; + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.ModelFeaturesConfig; - /** - * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. - * @param message Control message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.IControl, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ModelFeaturesConfig message. + * @param message 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 Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. - * @param message Control message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IControl, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelFeaturesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.ModelFeaturesConfig; - /** - * Decodes a Control message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Control - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Control; + /** + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. + * @param message ModelFeaturesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.Model.ModelFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a Control message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Control - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Control; + /** + * Converts this ModelFeaturesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Verifies a Control message. - * @param message 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 ModelFeaturesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a Control message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Control - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Control; + /** ServingState enum. */ + enum ServingState { + SERVING_STATE_UNSPECIFIED = 0, + INACTIVE = 1, + ACTIVE = 2, + TUNED = 3 + } - /** - * Creates a plain object from a Control message. Also converts values to other types if specified. - * @param message Control - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Control, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** TrainingState enum. */ + enum TrainingState { + TRAINING_STATE_UNSPECIFIED = 0, + PAUSED = 1, + TRAINING = 2 + } - /** - * Converts this Control to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** PeriodicTuningState enum. */ + enum PeriodicTuningState { + PERIODIC_TUNING_STATE_UNSPECIFIED = 0, + PERIODIC_TUNING_DISABLED = 1, + ALL_TUNING_DISABLED = 3, + PERIODIC_TUNING_ENABLED = 2 + } - /** - * Gets the default type url for Control - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** DataState enum. */ + enum DataState { + DATA_STATE_UNSPECIFIED = 0, + DATA_OK = 1, + DATA_ERROR = 2 + } + + /** ContextProductsType enum. */ + enum ContextProductsType { + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0, + SINGLE_CONTEXT_PRODUCT = 1, + MULTIPLE_CONTEXT_PRODUCTS = 2 + } } - /** Represents a ControlService */ - class ControlService extends $protobuf.rpc.Service { + /** Represents a ModelService */ + class ModelService extends $protobuf.rpc.Service { /** - * Constructs a new ControlService 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 @@ -31082,2239 +36568,1790 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new ControlService service using the specified rpc implementation. + * 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): ControlService; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ModelService; /** - * Calls CreateControl. - * @param request CreateControlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Control + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public createControl(request: google.cloud.retail.v2alpha.ICreateControlRequest, callback: google.cloud.retail.v2alpha.ControlService.CreateControlCallback): void; + public createModel(request: google.cloud.retail.v2alpha.ICreateModelRequest, callback: google.cloud.retail.v2alpha.ModelService.CreateModelCallback): void; /** - * Calls CreateControl. - * @param request CreateControlRequest message or plain object + * Calls CreateModel. + * @param request CreateModelRequest message or plain object * @returns Promise */ - public createControl(request: google.cloud.retail.v2alpha.ICreateControlRequest): Promise; + public createModel(request: google.cloud.retail.v2alpha.ICreateModelRequest): Promise; /** - * Calls DeleteControl. - * @param request DeleteControlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public deleteControl(request: google.cloud.retail.v2alpha.IDeleteControlRequest, callback: google.cloud.retail.v2alpha.ControlService.DeleteControlCallback): void; + public getModel(request: google.cloud.retail.v2alpha.IGetModelRequest, callback: google.cloud.retail.v2alpha.ModelService.GetModelCallback): void; /** - * Calls DeleteControl. - * @param request DeleteControlRequest message or plain object + * Calls GetModel. + * @param request GetModelRequest message or plain object * @returns Promise */ - public deleteControl(request: google.cloud.retail.v2alpha.IDeleteControlRequest): Promise; + public getModel(request: google.cloud.retail.v2alpha.IGetModelRequest): Promise; /** - * Calls UpdateControl. - * @param request UpdateControlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Control + * Calls PauseModel. + * @param request PauseModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public updateControl(request: google.cloud.retail.v2alpha.IUpdateControlRequest, callback: google.cloud.retail.v2alpha.ControlService.UpdateControlCallback): void; + public pauseModel(request: google.cloud.retail.v2alpha.IPauseModelRequest, callback: google.cloud.retail.v2alpha.ModelService.PauseModelCallback): void; /** - * Calls UpdateControl. - * @param request UpdateControlRequest message or plain object + * Calls PauseModel. + * @param request PauseModelRequest message or plain object * @returns Promise */ - public updateControl(request: google.cloud.retail.v2alpha.IUpdateControlRequest): Promise; + public pauseModel(request: google.cloud.retail.v2alpha.IPauseModelRequest): Promise; /** - * Calls GetControl. - * @param request GetControlRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Control + * Calls ResumeModel. + * @param request ResumeModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public getControl(request: google.cloud.retail.v2alpha.IGetControlRequest, callback: google.cloud.retail.v2alpha.ControlService.GetControlCallback): void; + public resumeModel(request: google.cloud.retail.v2alpha.IResumeModelRequest, callback: google.cloud.retail.v2alpha.ModelService.ResumeModelCallback): void; /** - * Calls GetControl. - * @param request GetControlRequest message or plain object + * Calls ResumeModel. + * @param request ResumeModelRequest message or plain object * @returns Promise */ - public getControl(request: google.cloud.retail.v2alpha.IGetControlRequest): Promise; + public resumeModel(request: google.cloud.retail.v2alpha.IResumeModelRequest): Promise; /** - * Calls ListControls. - * @param request ListControlsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListControlsResponse + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public listControls(request: google.cloud.retail.v2alpha.IListControlsRequest, callback: google.cloud.retail.v2alpha.ControlService.ListControlsCallback): void; + public deleteModel(request: google.cloud.retail.v2alpha.IDeleteModelRequest, callback: google.cloud.retail.v2alpha.ModelService.DeleteModelCallback): void; /** - * Calls ListControls. - * @param request ListControlsRequest message or plain object + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object * @returns Promise */ - public listControls(request: google.cloud.retail.v2alpha.IListControlsRequest): Promise; - } - - namespace ControlService { - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|createControl}. - * @param error Error, if any - * @param [response] Control - */ - type CreateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|deleteControl}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteControlCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|updateControl}. - * @param error Error, if any - * @param [response] Control - */ - type UpdateControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|getControl}. - * @param error Error, if any - * @param [response] Control - */ - type GetControlCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Control) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|listControls}. - * @param error Error, if any - * @param [response] ListControlsResponse - */ - type ListControlsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListControlsResponse) => void; - } - - /** Properties of a CreateControlRequest. */ - interface ICreateControlRequest { - - /** CreateControlRequest parent */ - parent?: (string|null); - - /** CreateControlRequest control */ - control?: (google.cloud.retail.v2alpha.IControl|null); - - /** CreateControlRequest controlId */ - controlId?: (string|null); - } - - /** Represents a CreateControlRequest. */ - class CreateControlRequest implements ICreateControlRequest { - - /** - * Constructs a new CreateControlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateControlRequest); - - /** CreateControlRequest parent. */ - public parent: string; - - /** CreateControlRequest control. */ - public control?: (google.cloud.retail.v2alpha.IControl|null); - - /** CreateControlRequest controlId. */ - public controlId: string; - - /** - * Creates a new CreateControlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateControlRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateControlRequest): google.cloud.retail.v2alpha.CreateControlRequest; - - /** - * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. - * @param message CreateControlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. - * @param message CreateControlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateControlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateControlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateControlRequest; + public deleteModel(request: google.cloud.retail.v2alpha.IDeleteModelRequest): Promise; /** - * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateControlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateControlRequest; + public listModels(request: google.cloud.retail.v2alpha.IListModelsRequest, callback: google.cloud.retail.v2alpha.ModelService.ListModelsCallback): void; /** - * Verifies a CreateControlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listModels(request: google.cloud.retail.v2alpha.IListModelsRequest): Promise; /** - * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateControlRequest + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateControlRequest; + public updateModel(request: google.cloud.retail.v2alpha.IUpdateModelRequest, callback: google.cloud.retail.v2alpha.ModelService.UpdateModelCallback): void; /** - * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. - * @param message CreateControlRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2alpha.CreateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateModel(request: google.cloud.retail.v2alpha.IUpdateModelRequest): Promise; /** - * Converts this CreateControlRequest to JSON. - * @returns JSON object + * Calls TuneModel. + * @param request TuneModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; + public tuneModel(request: google.cloud.retail.v2alpha.ITuneModelRequest, callback: google.cloud.retail.v2alpha.ModelService.TuneModelCallback): void; /** - * Gets the default type url for CreateControlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls TuneModel. + * @param request TuneModelRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateControlRequest. */ - interface IUpdateControlRequest { - - /** UpdateControlRequest control */ - control?: (google.cloud.retail.v2alpha.IControl|null); - - /** UpdateControlRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + public tuneModel(request: google.cloud.retail.v2alpha.ITuneModelRequest): Promise; } - /** Represents an UpdateControlRequest. */ - class UpdateControlRequest implements IUpdateControlRequest { - - /** - * Constructs a new UpdateControlRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateControlRequest); - - /** UpdateControlRequest control. */ - public control?: (google.cloud.retail.v2alpha.IControl|null); - - /** UpdateControlRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + namespace ModelService { /** - * Creates a new UpdateControlRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateControlRequest instance + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|createModel}. + * @param error Error, if any + * @param [response] Operation */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateControlRequest): google.cloud.retail.v2alpha.UpdateControlRequest; + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. - * @param message UpdateControlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|getModel}. + * @param error Error, if any + * @param [response] Model */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; /** - * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. - * @param message UpdateControlRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|pauseModel}. + * @param error Error, if any + * @param [response] Model */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type PauseModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; /** - * Decodes an UpdateControlRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateControlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|resumeModel}. + * @param error Error, if any + * @param [response] Model */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateControlRequest; + type ResumeModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; /** - * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateControlRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|deleteModel}. + * @param error Error, if any + * @param [response] Empty */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateControlRequest; + type DeleteModelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Verifies an UpdateControlRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse */ - public static verify(message: { [k: string]: any }): (string|null); + type ListModelsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListModelsResponse) => void; /** - * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateControlRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|updateModel}. + * @param error Error, if any + * @param [response] Model */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateControlRequest; + type UpdateModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; /** - * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. - * @param message UpdateControlRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|tuneModel}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type TuneModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } - /** - * Converts this UpdateControlRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { - /** - * Gets the default type url for UpdateControlRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** CreateModelRequest parent */ + parent?: (string|null); - /** Properties of a DeleteControlRequest. */ - interface IDeleteControlRequest { + /** CreateModelRequest model */ + model?: (google.cloud.retail.v2alpha.IModel|null); - /** DeleteControlRequest name */ - name?: (string|null); + /** CreateModelRequest dryRun */ + dryRun?: (boolean|null); } - /** Represents a DeleteControlRequest. */ - class DeleteControlRequest implements IDeleteControlRequest { + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { /** - * Constructs a new DeleteControlRequest. + * Constructs a new CreateModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IDeleteControlRequest); + constructor(properties?: google.cloud.retail.v2alpha.ICreateModelRequest); + + /** CreateModelRequest parent. */ + public parent: string; - /** DeleteControlRequest name. */ - public name: string; + /** CreateModelRequest model. */ + public model?: (google.cloud.retail.v2alpha.IModel|null); + + /** CreateModelRequest dryRun. */ + public dryRun: boolean; /** - * Creates a new DeleteControlRequest instance using the specified properties. + * Creates a new CreateModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteControlRequest instance + * @returns CreateModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IDeleteControlRequest): google.cloud.retail.v2alpha.DeleteControlRequest; + public static create(properties?: google.cloud.retail.v2alpha.ICreateModelRequest): google.cloud.retail.v2alpha.CreateModelRequest; /** - * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. - * @param message DeleteControlRequest message or plain object to encode + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. - * @param message DeleteControlRequest message or plain object to encode + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IDeleteControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteControlRequest message from the specified reader or buffer. + * 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 DeleteControlRequest + * @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.retail.v2alpha.DeleteControlRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateModelRequest; /** - * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteControlRequest + * @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.retail.v2alpha.DeleteControlRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateModelRequest; /** - * Verifies a DeleteControlRequest message. + * 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 DeleteControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteControlRequest + * @returns CreateModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteControlRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateModelRequest; /** - * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. - * @param message DeleteControlRequest + * 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.retail.v2alpha.DeleteControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteControlRequest to JSON. + * Converts this CreateModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteControlRequest + * 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 GetControlRequest. */ - interface IGetControlRequest { + /** Properties of an UpdateModelRequest. */ + interface IUpdateModelRequest { - /** GetControlRequest name */ - name?: (string|null); + /** UpdateModelRequest model */ + model?: (google.cloud.retail.v2alpha.IModel|null); + + /** UpdateModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a GetControlRequest. */ - class GetControlRequest implements IGetControlRequest { + /** Represents an UpdateModelRequest. */ + class UpdateModelRequest implements IUpdateModelRequest { /** - * Constructs a new GetControlRequest. + * Constructs a new UpdateModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGetControlRequest); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateModelRequest); - /** GetControlRequest name. */ - public name: string; + /** UpdateModelRequest model. */ + public model?: (google.cloud.retail.v2alpha.IModel|null); + + /** UpdateModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new GetControlRequest instance using the specified properties. + * Creates a new UpdateModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetControlRequest instance + * @returns UpdateModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetControlRequest): google.cloud.retail.v2alpha.GetControlRequest; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateModelRequest): google.cloud.retail.v2alpha.UpdateModelRequest; /** - * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. - * @param message GetControlRequest message or plain object to encode + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. - * @param message GetControlRequest message or plain object to encode + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IGetControlRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetControlRequest message from the specified reader or buffer. + * 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 GetControlRequest + * @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.retail.v2alpha.GetControlRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateModelRequest; /** - * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetControlRequest + * @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.retail.v2alpha.GetControlRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateModelRequest; /** - * Verifies a GetControlRequest message. + * 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 a GetControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetControlRequest + * @returns UpdateModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetControlRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateModelRequest; /** - * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. - * @param message GetControlRequest + * 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.retail.v2alpha.GetControlRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetControlRequest to JSON. + * Converts this UpdateModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetControlRequest + * 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 ListControlsRequest. */ - interface IListControlsRequest { - - /** ListControlsRequest parent */ - parent?: (string|null); - - /** ListControlsRequest pageSize */ - pageSize?: (number|null); - - /** ListControlsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { - /** ListControlsRequest filter */ - filter?: (string|null); + /** GetModelRequest name */ + name?: (string|null); } - /** Represents a ListControlsRequest. */ - class ListControlsRequest implements IListControlsRequest { + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { /** - * Constructs a new ListControlsRequest. + * Constructs a new GetModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListControlsRequest); - - /** ListControlsRequest parent. */ - public parent: string; - - /** ListControlsRequest pageSize. */ - public pageSize: number; - - /** ListControlsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.cloud.retail.v2alpha.IGetModelRequest); - /** ListControlsRequest filter. */ - public filter: string; + /** GetModelRequest name. */ + public name: string; /** - * Creates a new ListControlsRequest instance using the specified properties. + * Creates a new GetModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListControlsRequest instance + * @returns GetModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListControlsRequest): google.cloud.retail.v2alpha.ListControlsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IGetModelRequest): google.cloud.retail.v2alpha.GetModelRequest; /** - * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. - * @param message ListControlsRequest message or plain object to encode + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. - * @param message ListControlsRequest message or plain object to encode + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IListControlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListControlsRequest message from the specified reader or buffer. + * 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 ListControlsRequest + * @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.retail.v2alpha.ListControlsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetModelRequest; /** - * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListControlsRequest + * @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.retail.v2alpha.ListControlsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetModelRequest; /** - * Verifies a ListControlsRequest message. + * 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 ListControlsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListControlsRequest + * @returns GetModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListControlsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetModelRequest; /** - * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. - * @param message ListControlsRequest + * 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.retail.v2alpha.ListControlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListControlsRequest to JSON. + * Converts this GetModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListControlsRequest + * 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 ListControlsResponse. */ - interface IListControlsResponse { - - /** ListControlsResponse controls */ - controls?: (google.cloud.retail.v2alpha.IControl[]|null); + /** Properties of a PauseModelRequest. */ + interface IPauseModelRequest { - /** ListControlsResponse nextPageToken */ - nextPageToken?: (string|null); + /** PauseModelRequest name */ + name?: (string|null); } - /** Represents a ListControlsResponse. */ - class ListControlsResponse implements IListControlsResponse { + /** Represents a PauseModelRequest. */ + class PauseModelRequest implements IPauseModelRequest { /** - * Constructs a new ListControlsResponse. + * Constructs a new PauseModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListControlsResponse); - - /** ListControlsResponse controls. */ - public controls: google.cloud.retail.v2alpha.IControl[]; + constructor(properties?: google.cloud.retail.v2alpha.IPauseModelRequest); - /** ListControlsResponse nextPageToken. */ - public nextPageToken: string; + /** PauseModelRequest name. */ + public name: string; /** - * Creates a new ListControlsResponse instance using the specified properties. + * Creates a new PauseModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListControlsResponse instance + * @returns PauseModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListControlsResponse): google.cloud.retail.v2alpha.ListControlsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IPauseModelRequest): google.cloud.retail.v2alpha.PauseModelRequest; /** - * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. - * @param message ListControlsResponse message or plain object to encode + * Encodes the specified PauseModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. + * @param message PauseModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPauseModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. - * @param message ListControlsResponse message or plain object to encode + * Encodes the specified PauseModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. + * @param message PauseModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListControlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPauseModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListControlsResponse message from the specified reader or buffer. + * Decodes a PauseModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListControlsResponse + * @returns PauseModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListControlsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PauseModelRequest; /** - * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. + * Decodes a PauseModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListControlsResponse + * @returns PauseModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListControlsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PauseModelRequest; /** - * Verifies a ListControlsResponse message. + * Verifies a PauseModelRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PauseModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListControlsResponse + * @returns PauseModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListControlsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PauseModelRequest; /** - * Creates a plain object from a ListControlsResponse message. Also converts values to other types if specified. - * @param message ListControlsResponse + * Creates a plain object from a PauseModelRequest message. Also converts values to other types if specified. + * @param message PauseModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListControlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PauseModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListControlsResponse to JSON. + * Converts this PauseModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListControlsResponse + * Gets the default type url for PauseModelRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MerchantCenterAccountLink. */ - interface IMerchantCenterAccountLink { + /** Properties of a ResumeModelRequest. */ + interface IResumeModelRequest { - /** MerchantCenterAccountLink name */ + /** ResumeModelRequest name */ name?: (string|null); - - /** MerchantCenterAccountLink id */ - id?: (string|null); - - /** MerchantCenterAccountLink merchantCenterAccountId */ - merchantCenterAccountId?: (number|Long|string|null); - - /** MerchantCenterAccountLink branchId */ - branchId?: (string|null); - - /** MerchantCenterAccountLink feedLabel */ - feedLabel?: (string|null); - - /** MerchantCenterAccountLink languageCode */ - languageCode?: (string|null); - - /** MerchantCenterAccountLink feedFilters */ - feedFilters?: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter[]|null); - - /** MerchantCenterAccountLink state */ - state?: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|keyof typeof google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|null); - - /** MerchantCenterAccountLink projectId */ - projectId?: (string|null); } - /** Represents a MerchantCenterAccountLink. */ - class MerchantCenterAccountLink implements IMerchantCenterAccountLink { + /** Represents a ResumeModelRequest. */ + class ResumeModelRequest implements IResumeModelRequest { /** - * Constructs a new MerchantCenterAccountLink. + * Constructs a new ResumeModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IMerchantCenterAccountLink); + constructor(properties?: google.cloud.retail.v2alpha.IResumeModelRequest); - /** MerchantCenterAccountLink name. */ + /** ResumeModelRequest name. */ public name: string; - /** MerchantCenterAccountLink id. */ - public id: string; - - /** MerchantCenterAccountLink merchantCenterAccountId. */ - public merchantCenterAccountId: (number|Long|string); - - /** MerchantCenterAccountLink branchId. */ - public branchId: string; - - /** MerchantCenterAccountLink feedLabel. */ - public feedLabel: string; - - /** MerchantCenterAccountLink languageCode. */ - public languageCode: string; - - /** MerchantCenterAccountLink feedFilters. */ - public feedFilters: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter[]; - - /** MerchantCenterAccountLink state. */ - public state: (google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|keyof typeof google.cloud.retail.v2alpha.MerchantCenterAccountLink.State); - - /** MerchantCenterAccountLink projectId. */ - public projectId: string; - /** - * Creates a new MerchantCenterAccountLink instance using the specified properties. + * Creates a new ResumeModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns MerchantCenterAccountLink instance + * @returns ResumeModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IMerchantCenterAccountLink): google.cloud.retail.v2alpha.MerchantCenterAccountLink; + public static create(properties?: google.cloud.retail.v2alpha.IResumeModelRequest): google.cloud.retail.v2alpha.ResumeModelRequest; /** - * Encodes the specified MerchantCenterAccountLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. - * @param message MerchantCenterAccountLink message or plain object to encode + * Encodes the specified ResumeModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. + * @param message ResumeModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IMerchantCenterAccountLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IResumeModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MerchantCenterAccountLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. - * @param message MerchantCenterAccountLink message or plain object to encode + * Encodes the specified ResumeModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. + * @param message ResumeModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IMerchantCenterAccountLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IResumeModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MerchantCenterAccountLink message from the specified reader or buffer. + * Decodes a ResumeModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MerchantCenterAccountLink + * @returns ResumeModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.MerchantCenterAccountLink; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ResumeModelRequest; /** - * Decodes a MerchantCenterAccountLink message from the specified reader or buffer, length delimited. + * Decodes a ResumeModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MerchantCenterAccountLink + * @returns ResumeModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.MerchantCenterAccountLink; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ResumeModelRequest; /** - * Verifies a MerchantCenterAccountLink message. + * Verifies a ResumeModelRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MerchantCenterAccountLink message from a plain object. Also converts values to their respective internal types. + * Creates a ResumeModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MerchantCenterAccountLink + * @returns ResumeModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterAccountLink; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ResumeModelRequest; /** - * Creates a plain object from a MerchantCenterAccountLink message. Also converts values to other types if specified. - * @param message MerchantCenterAccountLink + * Creates a plain object from a ResumeModelRequest message. Also converts values to other types if specified. + * @param message ResumeModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ResumeModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MerchantCenterAccountLink to JSON. + * Converts this ResumeModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MerchantCenterAccountLink + * Gets the default type url for ResumeModelRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MerchantCenterAccountLink { - - /** Properties of a MerchantCenterFeedFilter. */ - interface IMerchantCenterFeedFilter { + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { - /** MerchantCenterFeedFilter primaryFeedId */ - primaryFeedId?: (number|Long|string|null); + /** ListModelsRequest parent */ + parent?: (string|null); - /** MerchantCenterFeedFilter primaryFeedName */ - primaryFeedName?: (string|null); - } + /** ListModelsRequest pageSize */ + pageSize?: (number|null); - /** Represents a MerchantCenterFeedFilter. */ - class MerchantCenterFeedFilter implements IMerchantCenterFeedFilter { + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } - /** - * Constructs a new MerchantCenterFeedFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter); + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { - /** MerchantCenterFeedFilter primaryFeedId. */ - public primaryFeedId: (number|Long|string); + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IListModelsRequest); - /** MerchantCenterFeedFilter primaryFeedName. */ - public primaryFeedName: string; + /** ListModelsRequest parent. */ + public parent: string; - /** - * Creates a new MerchantCenterFeedFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns MerchantCenterFeedFilter instance - */ - public static create(properties?: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; + /** ListModelsRequest pageSize. */ + public pageSize: number; - /** - * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. - * @param message MerchantCenterFeedFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListModelsRequest pageToken. */ + public pageToken: string; - /** - * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. - * @param message MerchantCenterFeedFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IListModelsRequest): google.cloud.retail.v2alpha.ListModelsRequest; - /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MerchantCenterFeedFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MerchantCenterFeedFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a MerchantCenterFeedFilter message. - * @param message 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 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.retail.v2alpha.ListModelsRequest; - /** - * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MerchantCenterFeedFilter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter; + /** + * 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.retail.v2alpha.ListModelsRequest; - /** - * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. - * @param message MerchantCenterFeedFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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); - /** - * Converts this MerchantCenterFeedFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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.retail.v2alpha.ListModelsRequest; - /** - * Gets the default type url for MerchantCenterFeedFilter - * @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 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.retail.v2alpha.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - ACTIVE = 2, - FAILED = 3 - } - } + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a CreateMerchantCenterAccountLinkMetadata. */ - interface ICreateMerchantCenterAccountLinkMetadata { + /** + * 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; + } - /** CreateMerchantCenterAccountLinkMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { - /** CreateMerchantCenterAccountLinkMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** DeleteModelRequest name */ + name?: (string|null); } - /** Represents a CreateMerchantCenterAccountLinkMetadata. */ - class CreateMerchantCenterAccountLinkMetadata implements ICreateMerchantCenterAccountLinkMetadata { + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { /** - * Constructs a new CreateMerchantCenterAccountLinkMetadata. + * Constructs a new DeleteModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata); - - /** CreateMerchantCenterAccountLinkMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.retail.v2alpha.IDeleteModelRequest); - /** CreateMerchantCenterAccountLinkMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** DeleteModelRequest name. */ + public name: string; /** - * Creates a new CreateMerchantCenterAccountLinkMetadata instance using the specified properties. + * Creates a new DeleteModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateMerchantCenterAccountLinkMetadata instance + * @returns DeleteModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IDeleteModelRequest): google.cloud.retail.v2alpha.DeleteModelRequest; /** - * Encodes the specified CreateMerchantCenterAccountLinkMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. - * @param message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateMerchantCenterAccountLinkMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. - * @param message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer. + * 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 CreateMerchantCenterAccountLinkMetadata + * @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.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteModelRequest; /** - * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateMerchantCenterAccountLinkMetadata + * @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.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteModelRequest; /** - * Verifies a CreateMerchantCenterAccountLinkMetadata message. + * 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 CreateMerchantCenterAccountLinkMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateMerchantCenterAccountLinkMetadata + * @returns DeleteModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteModelRequest; /** - * Creates a plain object from a CreateMerchantCenterAccountLinkMetadata message. Also converts values to other types if specified. - * @param message CreateMerchantCenterAccountLinkMetadata + * 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.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateMerchantCenterAccountLinkMetadata to JSON. + * Converts this DeleteModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateMerchantCenterAccountLinkMetadata + * 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; } - /** Represents a MerchantCenterAccountLinkService */ - class MerchantCenterAccountLinkService extends $protobuf.rpc.Service { + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse models */ + models?: (google.cloud.retail.v2alpha.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { /** - * Constructs a new MerchantCenterAccountLinkService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.retail.v2alpha.IListModelsResponse); + + /** ListModelsResponse models. */ + public models: google.cloud.retail.v2alpha.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates new MerchantCenterAccountLinkService 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 ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MerchantCenterAccountLinkService; + public static create(properties?: google.cloud.retail.v2alpha.IListModelsResponse): google.cloud.retail.v2alpha.ListModelsResponse; /** - * Calls ListMerchantCenterAccountLinks. - * @param request ListMerchantCenterAccountLinksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListMerchantCenterAccountLinksResponse + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listMerchantCenterAccountLinks(request: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.ListMerchantCenterAccountLinksCallback): void; + public static encode(message: google.cloud.retail.v2alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListMerchantCenterAccountLinks. - * @param request ListMerchantCenterAccountLinksRequest message or plain object - * @returns Promise + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listMerchantCenterAccountLinks(request: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateMerchantCenterAccountLink. - * @param request CreateMerchantCenterAccountLinkRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * 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 createMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.CreateMerchantCenterAccountLinkCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListModelsResponse; /** - * Calls CreateMerchantCenterAccountLink. - * @param request CreateMerchantCenterAccountLinkRequest message or plain object - * @returns Promise + * 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 createMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListModelsResponse; /** - * Calls DeleteMerchantCenterAccountLink. - * @param request DeleteMerchantCenterAccountLinkRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, callback: google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.DeleteMerchantCenterAccountLinkCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteMerchantCenterAccountLink. - * @param request DeleteMerchantCenterAccountLinkRequest message or plain object - * @returns Promise + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse */ - public deleteMerchantCenterAccountLink(request: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest): Promise; - } - - namespace MerchantCenterAccountLinkService { + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListModelsResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|listMerchantCenterAccountLinks}. - * @param error Error, if any - * @param [response] ListMerchantCenterAccountLinksResponse + * 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 */ - type ListMerchantCenterAccountLinksCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse) => void; + public static toObject(message: google.cloud.retail.v2alpha.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|createMerchantCenterAccountLink}. - * @param error Error, if any - * @param [response] Operation + * Converts this ListModelsResponse to JSON. + * @returns JSON object */ - type CreateMerchantCenterAccountLinkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|deleteMerchantCenterAccountLink}. - * @param error Error, if any - * @param [response] Empty + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type DeleteMerchantCenterAccountLinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListMerchantCenterAccountLinksRequest. */ - interface IListMerchantCenterAccountLinksRequest { + /** Properties of a TuneModelRequest. */ + interface ITuneModelRequest { - /** ListMerchantCenterAccountLinksRequest parent */ - parent?: (string|null); + /** TuneModelRequest name */ + name?: (string|null); } - /** Represents a ListMerchantCenterAccountLinksRequest. */ - class ListMerchantCenterAccountLinksRequest implements IListMerchantCenterAccountLinksRequest { + /** Represents a TuneModelRequest. */ + class TuneModelRequest implements ITuneModelRequest { /** - * Constructs a new ListMerchantCenterAccountLinksRequest. + * Constructs a new TuneModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest); + constructor(properties?: google.cloud.retail.v2alpha.ITuneModelRequest); - /** ListMerchantCenterAccountLinksRequest parent. */ - public parent: string; + /** TuneModelRequest name. */ + public name: string; /** - * Creates a new ListMerchantCenterAccountLinksRequest instance using the specified properties. + * Creates a new TuneModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListMerchantCenterAccountLinksRequest instance + * @returns TuneModelRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + public static create(properties?: google.cloud.retail.v2alpha.ITuneModelRequest): google.cloud.retail.v2alpha.TuneModelRequest; /** - * Encodes the specified ListMerchantCenterAccountLinksRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. - * @param message ListMerchantCenterAccountLinksRequest message or plain object to encode + * Encodes the specified TuneModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * @param message TuneModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ITuneModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMerchantCenterAccountLinksRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. - * @param message ListMerchantCenterAccountLinksRequest message or plain object to encode + * Encodes the specified TuneModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * @param message TuneModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer. + * Decodes a TuneModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMerchantCenterAccountLinksRequest + * @returns TuneModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelRequest; /** - * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer, length delimited. + * Decodes a TuneModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMerchantCenterAccountLinksRequest + * @returns TuneModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelRequest; /** - * Verifies a ListMerchantCenterAccountLinksRequest message. + * Verifies a TuneModelRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListMerchantCenterAccountLinksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TuneModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMerchantCenterAccountLinksRequest + * @returns TuneModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelRequest; /** - * Creates a plain object from a ListMerchantCenterAccountLinksRequest message. Also converts values to other types if specified. - * @param message ListMerchantCenterAccountLinksRequest + * Creates a plain object from a TuneModelRequest message. Also converts values to other types if specified. + * @param message TuneModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.TuneModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMerchantCenterAccountLinksRequest to JSON. + * Converts this TuneModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListMerchantCenterAccountLinksRequest + * Gets the default type url for TuneModelRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListMerchantCenterAccountLinksResponse. */ - interface IListMerchantCenterAccountLinksResponse { + /** Properties of a CreateModelMetadata. */ + interface ICreateModelMetadata { - /** ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks */ - merchantCenterAccountLinks?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink[]|null); + /** CreateModelMetadata model */ + model?: (string|null); } - /** Represents a ListMerchantCenterAccountLinksResponse. */ - class ListMerchantCenterAccountLinksResponse implements IListMerchantCenterAccountLinksResponse { + /** Represents a CreateModelMetadata. */ + class CreateModelMetadata implements ICreateModelMetadata { /** - * Constructs a new ListMerchantCenterAccountLinksResponse. + * Constructs a new CreateModelMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse); + constructor(properties?: google.cloud.retail.v2alpha.ICreateModelMetadata); - /** ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks. */ - public merchantCenterAccountLinks: google.cloud.retail.v2alpha.IMerchantCenterAccountLink[]; + /** CreateModelMetadata model. */ + public model: string; /** - * Creates a new ListMerchantCenterAccountLinksResponse instance using the specified properties. + * Creates a new CreateModelMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListMerchantCenterAccountLinksResponse instance + * @returns CreateModelMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + public static create(properties?: google.cloud.retail.v2alpha.ICreateModelMetadata): google.cloud.retail.v2alpha.CreateModelMetadata; /** - * Encodes the specified ListMerchantCenterAccountLinksResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. - * @param message ListMerchantCenterAccountLinksResponse message or plain object to encode + * Encodes the specified CreateModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * @param message CreateModelMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICreateModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMerchantCenterAccountLinksResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. - * @param message ListMerchantCenterAccountLinksResponse message or plain object to encode + * Encodes the specified CreateModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * @param message CreateModelMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer. + * Decodes a CreateModelMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMerchantCenterAccountLinksResponse + * @returns CreateModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateModelMetadata; /** - * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateModelMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMerchantCenterAccountLinksResponse + * @returns CreateModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateModelMetadata; /** - * Verifies a ListMerchantCenterAccountLinksResponse message. + * Verifies a CreateModelMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListMerchantCenterAccountLinksResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMerchantCenterAccountLinksResponse + * @returns CreateModelMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateModelMetadata; /** - * Creates a plain object from a ListMerchantCenterAccountLinksResponse message. Also converts values to other types if specified. - * @param message ListMerchantCenterAccountLinksResponse + * Creates a plain object from a CreateModelMetadata message. Also converts values to other types if specified. + * @param message CreateModelMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CreateModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMerchantCenterAccountLinksResponse to JSON. + * Converts this CreateModelMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListMerchantCenterAccountLinksResponse + * Gets the default type url for CreateModelMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateMerchantCenterAccountLinkRequest. */ - interface ICreateMerchantCenterAccountLinkRequest { - - /** CreateMerchantCenterAccountLinkRequest parent */ - parent?: (string|null); + /** Properties of a TuneModelMetadata. */ + interface ITuneModelMetadata { - /** CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink */ - merchantCenterAccountLink?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null); + /** TuneModelMetadata model */ + model?: (string|null); } - /** Represents a CreateMerchantCenterAccountLinkRequest. */ - class CreateMerchantCenterAccountLinkRequest implements ICreateMerchantCenterAccountLinkRequest { + /** Represents a TuneModelMetadata. */ + class TuneModelMetadata implements ITuneModelMetadata { /** - * Constructs a new CreateMerchantCenterAccountLinkRequest. + * Constructs a new TuneModelMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest); - - /** CreateMerchantCenterAccountLinkRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.retail.v2alpha.ITuneModelMetadata); - /** CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink. */ - public merchantCenterAccountLink?: (google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null); + /** TuneModelMetadata model. */ + public model: string; /** - * Creates a new CreateMerchantCenterAccountLinkRequest instance using the specified properties. + * Creates a new TuneModelMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateMerchantCenterAccountLinkRequest instance + * @returns TuneModelMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; + public static create(properties?: google.cloud.retail.v2alpha.ITuneModelMetadata): google.cloud.retail.v2alpha.TuneModelMetadata; /** - * Encodes the specified CreateMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. - * @param message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * Encodes the specified TuneModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * @param message TuneModelMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ITuneModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. - * @param message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * Encodes the specified TuneModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * @param message TuneModelMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer. + * Decodes a TuneModelMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateMerchantCenterAccountLinkRequest + * @returns TuneModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelMetadata; /** - * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. + * Decodes a TuneModelMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateMerchantCenterAccountLinkRequest + * @returns TuneModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelMetadata; /** - * Verifies a CreateMerchantCenterAccountLinkRequest message. + * Verifies a TuneModelMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TuneModelMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateMerchantCenterAccountLinkRequest + * @returns TuneModelMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelMetadata; /** - * Creates a plain object from a CreateMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. - * @param message CreateMerchantCenterAccountLinkRequest + * Creates a plain object from a TuneModelMetadata message. Also converts values to other types if specified. + * @param message TuneModelMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.TuneModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateMerchantCenterAccountLinkRequest to JSON. + * Converts this TuneModelMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateMerchantCenterAccountLinkRequest + * Gets the default type url for TuneModelMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteMerchantCenterAccountLinkRequest. */ - interface IDeleteMerchantCenterAccountLinkRequest { - - /** DeleteMerchantCenterAccountLinkRequest name */ - name?: (string|null); + /** Properties of a TuneModelResponse. */ + interface ITuneModelResponse { } - /** Represents a DeleteMerchantCenterAccountLinkRequest. */ - class DeleteMerchantCenterAccountLinkRequest implements IDeleteMerchantCenterAccountLinkRequest { + /** Represents a TuneModelResponse. */ + class TuneModelResponse implements ITuneModelResponse { /** - * Constructs a new DeleteMerchantCenterAccountLinkRequest. + * Constructs a new TuneModelResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest); - - /** DeleteMerchantCenterAccountLinkRequest name. */ - public name: string; + constructor(properties?: google.cloud.retail.v2alpha.ITuneModelResponse); /** - * Creates a new DeleteMerchantCenterAccountLinkRequest instance using the specified properties. + * Creates a new TuneModelResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteMerchantCenterAccountLinkRequest instance + * @returns TuneModelResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; + public static create(properties?: google.cloud.retail.v2alpha.ITuneModelResponse): google.cloud.retail.v2alpha.TuneModelResponse; /** - * Encodes the specified DeleteMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. - * @param message DeleteMerchantCenterAccountLinkRequest message or plain object to encode + * Encodes the specified TuneModelResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * @param message TuneModelResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ITuneModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. - * @param message DeleteMerchantCenterAccountLinkRequest message or plain object to encode + /** + * Encodes the specified TuneModelResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * @param message TuneModelResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer. + * Decodes a TuneModelResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteMerchantCenterAccountLinkRequest + * @returns TuneModelResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelResponse; /** - * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. + * Decodes a TuneModelResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteMerchantCenterAccountLinkRequest + * @returns TuneModelResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelResponse; /** - * Verifies a DeleteMerchantCenterAccountLinkRequest message. + * Verifies a TuneModelResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TuneModelResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteMerchantCenterAccountLinkRequest + * @returns TuneModelResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelResponse; /** - * Creates a plain object from a DeleteMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. - * @param message DeleteMerchantCenterAccountLinkRequest + * Creates a plain object from a TuneModelResponse message. Also converts values to other types if specified. + * @param message TuneModelResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.TuneModelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteMerchantCenterAccountLinkRequest to JSON. + * Converts this TuneModelResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteMerchantCenterAccountLinkRequest + * Gets the default type url for TuneModelResponse * @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 { + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { - /** Model pageOptimizationConfig */ - pageOptimizationConfig?: (google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null); + /** + * 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); - /** Model name */ - name?: (string|null); + /** + * 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; - /** Model displayName */ - displayName?: (string|null); + /** + * 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.retail.v2alpha.IPredictRequest, callback: google.cloud.retail.v2alpha.PredictionService.PredictCallback): void; - /** Model trainingState */ - trainingState?: (google.cloud.retail.v2alpha.Model.TrainingState|keyof typeof google.cloud.retail.v2alpha.Model.TrainingState|null); + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.retail.v2alpha.IPredictRequest): Promise; + } - /** Model servingState */ - servingState?: (google.cloud.retail.v2alpha.Model.ServingState|keyof typeof google.cloud.retail.v2alpha.Model.ServingState|null); + namespace PredictionService { - /** Model createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.PredictResponse) => void; + } - /** Model updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Properties of a PredictRequest. */ + interface IPredictRequest { - /** Model type */ - type?: (string|null); + /** PredictRequest placement */ + placement?: (string|null); - /** Model optimizationObjective */ - optimizationObjective?: (string|null); + /** PredictRequest userEvent */ + userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - /** Model periodicTuningState */ - periodicTuningState?: (google.cloud.retail.v2alpha.Model.PeriodicTuningState|keyof typeof google.cloud.retail.v2alpha.Model.PeriodicTuningState|null); + /** PredictRequest pageSize */ + pageSize?: (number|null); - /** Model lastTuneTime */ - lastTuneTime?: (google.protobuf.ITimestamp|null); + /** PredictRequest pageToken */ + pageToken?: (string|null); - /** Model tuningOperation */ - tuningOperation?: (string|null); + /** PredictRequest filter */ + filter?: (string|null); - /** Model dataState */ - dataState?: (google.cloud.retail.v2alpha.Model.DataState|keyof typeof google.cloud.retail.v2alpha.Model.DataState|null); + /** PredictRequest validateOnly */ + validateOnly?: (boolean|null); - /** Model filteringOption */ - filteringOption?: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption|null); + /** PredictRequest params */ + params?: ({ [k: string]: google.protobuf.IValue }|null); - /** Model servingConfigLists */ - servingConfigLists?: (google.cloud.retail.v2alpha.Model.IServingConfigList[]|null); + /** PredictRequest labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a Model. */ - class Model implements IModel { + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { /** - * Constructs a new Model. + * Constructs a new PredictRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IModel); - - /** Model pageOptimizationConfig. */ - public pageOptimizationConfig?: (google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null); - - /** Model name. */ - public name: string; - - /** Model displayName. */ - public displayName: string; - - /** Model trainingState. */ - public trainingState: (google.cloud.retail.v2alpha.Model.TrainingState|keyof typeof google.cloud.retail.v2alpha.Model.TrainingState); - - /** Model servingState. */ - public servingState: (google.cloud.retail.v2alpha.Model.ServingState|keyof typeof google.cloud.retail.v2alpha.Model.ServingState); - - /** Model createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Model updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Model type. */ - public type: string; + constructor(properties?: google.cloud.retail.v2alpha.IPredictRequest); - /** Model optimizationObjective. */ - public optimizationObjective: string; + /** PredictRequest placement. */ + public placement: string; - /** Model periodicTuningState. */ - public periodicTuningState: (google.cloud.retail.v2alpha.Model.PeriodicTuningState|keyof typeof google.cloud.retail.v2alpha.Model.PeriodicTuningState); + /** PredictRequest userEvent. */ + public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - /** Model lastTuneTime. */ - public lastTuneTime?: (google.protobuf.ITimestamp|null); + /** PredictRequest pageSize. */ + public pageSize: number; - /** Model tuningOperation. */ - public tuningOperation: string; + /** PredictRequest pageToken. */ + public pageToken: string; - /** Model dataState. */ - public dataState: (google.cloud.retail.v2alpha.Model.DataState|keyof typeof google.cloud.retail.v2alpha.Model.DataState); + /** PredictRequest filter. */ + public filter: string; - /** Model filteringOption. */ - public filteringOption: (google.cloud.retail.v2alpha.RecommendationsFilteringOption|keyof typeof google.cloud.retail.v2alpha.RecommendationsFilteringOption); + /** PredictRequest validateOnly. */ + public validateOnly: boolean; - /** Model servingConfigLists. */ - public servingConfigLists: google.cloud.retail.v2alpha.Model.IServingConfigList[]; + /** PredictRequest params. */ + public params: { [k: string]: google.protobuf.IValue }; - /** Model trainingConfig. */ - public trainingConfig?: "pageOptimizationConfig"; + /** PredictRequest labels. */ + public labels: { [k: string]: string }; /** - * Creates a new Model instance using the specified properties. + * Creates a new PredictRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Model instance + * @returns PredictRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IModel): google.cloud.retail.v2alpha.Model; + public static create(properties?: google.cloud.retail.v2alpha.IPredictRequest): google.cloud.retail.v2alpha.PredictRequest; /** - * Encodes the specified Model message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. - * @param message Model message or plain object to encode + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. - * @param message Model message or plain object to encode + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Model message from the specified reader or buffer. + * 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 Model + * @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.retail.v2alpha.Model; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictRequest; /** - * Decodes a Model message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Model + * @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.retail.v2alpha.Model; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictRequest; /** - * Verifies a Model message. + * 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 Model message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Model + * @returns PredictRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictRequest; /** - * Creates a plain object from a Model message. Also converts values to other types if specified. - * @param message Model + * 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.retail.v2alpha.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Model to JSON. + * Converts this PredictRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Model + * 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; } - namespace Model { - - /** Properties of a PageOptimizationConfig. */ - interface IPageOptimizationConfig { - - /** PageOptimizationConfig pageOptimizationEventType */ - pageOptimizationEventType?: (string|null); - - /** PageOptimizationConfig panels */ - panels?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel[]|null); - - /** PageOptimizationConfig restriction */ - restriction?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|keyof typeof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|null); - } - - /** Represents a PageOptimizationConfig. */ - class PageOptimizationConfig implements IPageOptimizationConfig { - - /** - * Constructs a new PageOptimizationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig); - - /** PageOptimizationConfig pageOptimizationEventType. */ - public pageOptimizationEventType: string; - - /** PageOptimizationConfig panels. */ - public panels: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel[]; - - /** PageOptimizationConfig restriction. */ - public restriction: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|keyof typeof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction); - - /** - * Creates a new PageOptimizationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PageOptimizationConfig instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; - - /** - * Encodes the specified PageOptimizationConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. - * @param message PageOptimizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageOptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. - * @param message PageOptimizationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IPageOptimizationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PageOptimizationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PageOptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; - - /** - * Decodes a PageOptimizationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PageOptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; - - /** - * Verifies a PageOptimizationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PageOptimizationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PageOptimizationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig; - - /** - * Creates a plain object from a PageOptimizationConfig message. Also converts values to other types if specified. - * @param message PageOptimizationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PageOptimizationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PageOptimizationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PageOptimizationConfig { - - /** Properties of a Candidate. */ - interface ICandidate { - - /** Candidate servingConfigId */ - servingConfigId?: (string|null); - } - - /** Represents a Candidate. */ - class Candidate implements ICandidate { - - /** - * Constructs a new Candidate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate); - - /** Candidate servingConfigId. */ - public servingConfigId?: (string|null); - - /** Candidate candidate. */ - public candidate?: "servingConfigId"; - - /** - * Creates a new Candidate instance using the specified properties. - * @param [properties] Properties to set - * @returns Candidate instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - - /** - * Encodes the specified Candidate message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. - * @param message Candidate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. - * @param message Candidate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Candidate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Candidate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - - /** - * Decodes a Candidate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Candidate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - - /** - * Verifies a Candidate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Candidate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Candidate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate; - - /** - * Creates a plain object from a Candidate message. Also converts values to other types if specified. - * @param message Candidate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a PredictResponse. */ + interface IPredictResponse { - /** - * Converts this Candidate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** PredictResponse results */ + results?: (google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]|null); - /** - * Gets the default type url for Candidate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** PredictResponse attributionToken */ + attributionToken?: (string|null); - /** Properties of a Panel. */ - interface IPanel { + /** PredictResponse missingIds */ + missingIds?: (string[]|null); - /** Panel displayName */ - displayName?: (string|null); + /** PredictResponse validateOnly */ + validateOnly?: (boolean|null); + } - /** Panel candidates */ - candidates?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate[]|null); + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { - /** Panel defaultCandidate */ - defaultCandidate?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null); - } + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.IPredictResponse); - /** Represents a Panel. */ - class Panel implements IPanel { + /** PredictResponse results. */ + public results: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]; - /** - * Constructs a new Panel. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel); + /** PredictResponse attributionToken. */ + public attributionToken: string; - /** Panel displayName. */ - public displayName: string; + /** PredictResponse missingIds. */ + public missingIds: string[]; - /** Panel candidates. */ - public candidates: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate[]; + /** PredictResponse validateOnly. */ + public validateOnly: boolean; - /** Panel defaultCandidate. */ - public defaultCandidate?: (google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null); + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.cloud.retail.v2alpha.IPredictResponse): google.cloud.retail.v2alpha.PredictResponse; - /** - * Creates a new Panel instance using the specified properties. - * @param [properties] Properties to set - * @returns Panel instance - */ - public static create(properties?: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Panel message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. - * @param message Panel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Panel message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. - * @param message Panel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel, 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.retail.v2alpha.PredictResponse; - /** - * Decodes a Panel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Panel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; + /** + * 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.retail.v2alpha.PredictResponse; - /** - * Decodes a Panel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Panel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; + /** + * 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); - /** - * Verifies a Panel message. - * @param message Plain object 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.retail.v2alpha.PredictResponse; - /** - * Creates a Panel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Panel - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel; + /** + * 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.retail.v2alpha.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a Panel message. Also converts values to other types if specified. - * @param message Panel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this Panel 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; + } - /** - * Gets the default type url for Panel - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + namespace PredictResponse { - /** Restriction enum. */ - enum Restriction { - RESTRICTION_UNSPECIFIED = 0, - NO_RESTRICTION = 1, - UNIQUE_SERVING_CONFIG_RESTRICTION = 2, - UNIQUE_MODEL_RESTRICTION = 3, - UNIQUE_MODEL_TYPE_RESTRICTION = 4 - } - } + /** Properties of a PredictionResult. */ + interface IPredictionResult { - /** Properties of a ServingConfigList. */ - interface IServingConfigList { + /** PredictionResult id */ + id?: (string|null); - /** ServingConfigList servingConfigIds */ - servingConfigIds?: (string[]|null); + /** PredictionResult metadata */ + metadata?: ({ [k: string]: google.protobuf.IValue }|null); } - /** Represents a ServingConfigList. */ - class ServingConfigList implements IServingConfigList { + /** Represents a PredictionResult. */ + class PredictionResult implements IPredictionResult { /** - * Constructs a new ServingConfigList. + * Constructs a new PredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.Model.IServingConfigList); + constructor(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult); - /** ServingConfigList servingConfigIds. */ - public servingConfigIds: string[]; + /** PredictionResult id. */ + public id: string; + + /** PredictionResult metadata. */ + public metadata: { [k: string]: google.protobuf.IValue }; /** - * Creates a new ServingConfigList instance using the specified properties. + * Creates a new PredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns ServingConfigList instance + * @returns PredictionResult instance */ - public static create(properties?: google.cloud.retail.v2alpha.Model.IServingConfigList): google.cloud.retail.v2alpha.Model.ServingConfigList; + public static create(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; /** - * Encodes the specified ServingConfigList message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. - * @param message ServingConfigList message or plain object to encode + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.Model.IServingConfigList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServingConfigList message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. - * @param message ServingConfigList message or plain object to encode + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @param message PredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.Model.IServingConfigList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServingConfigList message from the specified reader or buffer. + * Decodes a PredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServingConfigList + * @returns PredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Model.ServingConfigList; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; /** - * Decodes a ServingConfigList message from the specified reader or buffer, length delimited. + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServingConfigList + * @returns PredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Model.ServingConfigList; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; /** - * Verifies a ServingConfigList message. + * Verifies a PredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServingConfigList message from a plain object. Also converts values to their respective internal types. + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServingConfigList + * @returns PredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Model.ServingConfigList; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; /** - * Creates a plain object from a ServingConfigList message. Also converts values to other types if specified. - * @param message ServingConfigList + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @param message PredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.Model.ServingConfigList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServingConfigList to JSON. + * Converts this PredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServingConfigList + * Gets the default type url for PredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - - /** ServingState enum. */ - enum ServingState { - SERVING_STATE_UNSPECIFIED = 0, - INACTIVE = 1, - ACTIVE = 2, - TUNED = 3 - } - - /** TrainingState enum. */ - enum TrainingState { - TRAINING_STATE_UNSPECIFIED = 0, - PAUSED = 1, - TRAINING = 2 - } - - /** PeriodicTuningState enum. */ - enum PeriodicTuningState { - PERIODIC_TUNING_STATE_UNSPECIFIED = 0, - PERIODIC_TUNING_DISABLED = 1, - ALL_TUNING_DISABLED = 3, - PERIODIC_TUNING_ENABLED = 2 - } - - /** DataState enum. */ - enum DataState { - DATA_STATE_UNSPECIFIED = 0, - DATA_OK = 1, - DATA_ERROR = 2 - } } - /** Represents a ModelService */ - class ModelService extends $protobuf.rpc.Service { + /** Represents a ProductService */ + class ProductService extends $protobuf.rpc.Service { /** - * Constructs a new ModelService service. + * Constructs a new ProductService service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -33322,4836 +38359,5071 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new ModelService service using the specified rpc implementation. + * Creates new ProductService 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; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ProductService; /** - * Calls CreateModel. - * @param request CreateModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public createModel(request: google.cloud.retail.v2alpha.ICreateModelRequest, callback: google.cloud.retail.v2alpha.ModelService.CreateModelCallback): void; + public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.CreateProductCallback): void; /** - * Calls CreateModel. - * @param request CreateModelRequest message or plain object + * Calls CreateProduct. + * @param request CreateProductRequest message or plain object * @returns Promise */ - public createModel(request: google.cloud.retail.v2alpha.ICreateModelRequest): Promise; + public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest): Promise; /** - * Calls GetModel. - * @param request GetModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Calls GetProduct. + * @param request GetProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public getModel(request: google.cloud.retail.v2alpha.IGetModelRequest, callback: google.cloud.retail.v2alpha.ModelService.GetModelCallback): void; + public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest, callback: google.cloud.retail.v2alpha.ProductService.GetProductCallback): void; /** - * Calls GetModel. - * @param request GetModelRequest message or plain object + * Calls GetProduct. + * @param request GetProductRequest message or plain object * @returns Promise */ - public getModel(request: google.cloud.retail.v2alpha.IGetModelRequest): Promise; + public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest): Promise; /** - * Calls PauseModel. - * @param request PauseModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse */ - public pauseModel(request: google.cloud.retail.v2alpha.IPauseModelRequest, callback: google.cloud.retail.v2alpha.ModelService.PauseModelCallback): void; + public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ListProductsCallback): void; /** - * Calls PauseModel. - * @param request PauseModelRequest message or plain object + * Calls ListProducts. + * @param request ListProductsRequest message or plain object * @returns Promise */ - public pauseModel(request: google.cloud.retail.v2alpha.IPauseModelRequest): Promise; + public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest): Promise; /** - * Calls ResumeModel. - * @param request ResumeModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Product */ - public resumeModel(request: google.cloud.retail.v2alpha.IResumeModelRequest, callback: google.cloud.retail.v2alpha.ModelService.ResumeModelCallback): void; + public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.UpdateProductCallback): void; /** - * Calls ResumeModel. - * @param request ResumeModelRequest message or plain object + * Calls UpdateProduct. + * @param request UpdateProductRequest message or plain object * @returns Promise */ - public resumeModel(request: google.cloud.retail.v2alpha.IResumeModelRequest): Promise; + public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest): Promise; /** - * Calls DeleteModel. - * @param request DeleteModelRequest message or plain object + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object * @param callback Node-style callback called with the error, if any, and Empty */ - public deleteModel(request: google.cloud.retail.v2alpha.IDeleteModelRequest, callback: google.cloud.retail.v2alpha.ModelService.DeleteModelCallback): void; + public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest, callback: google.cloud.retail.v2alpha.ProductService.DeleteProductCallback): void; /** - * Calls DeleteModel. - * @param request DeleteModelRequest message or plain object + * Calls DeleteProduct. + * @param request DeleteProductRequest message or plain object * @returns Promise */ - public deleteModel(request: google.cloud.retail.v2alpha.IDeleteModelRequest): Promise; + public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest): Promise; /** - * Calls ListModels. - * @param request ListModelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListModelsResponse + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public listModels(request: google.cloud.retail.v2alpha.IListModelsRequest, callback: google.cloud.retail.v2alpha.ModelService.ListModelsCallback): void; + public purgeProducts(request: google.cloud.retail.v2alpha.IPurgeProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.PurgeProductsCallback): void; /** - * Calls ListModels. - * @param request ListModelsRequest message or plain object + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object * @returns Promise */ - public listModels(request: google.cloud.retail.v2alpha.IListModelsRequest): Promise; + public purgeProducts(request: google.cloud.retail.v2alpha.IPurgeProductsRequest): Promise; /** - * Calls UpdateModel. - * @param request UpdateModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public updateModel(request: google.cloud.retail.v2alpha.IUpdateModelRequest, callback: google.cloud.retail.v2alpha.ModelService.UpdateModelCallback): void; + public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ImportProductsCallback): void; /** - * Calls UpdateModel. - * @param request UpdateModelRequest message or plain object + * Calls ImportProducts. + * @param request ImportProductsRequest message or plain object * @returns Promise */ - public updateModel(request: google.cloud.retail.v2alpha.IUpdateModelRequest): Promise; + public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest): Promise; /** - * Calls TuneModel. - * @param request TuneModelRequest message or plain object + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object * @param callback Node-style callback called with the error, if any, and Operation */ - public tuneModel(request: google.cloud.retail.v2alpha.ITuneModelRequest, callback: google.cloud.retail.v2alpha.ModelService.TuneModelCallback): void; + public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest, callback: google.cloud.retail.v2alpha.ProductService.SetInventoryCallback): void; /** - * Calls TuneModel. - * @param request TuneModelRequest message or plain object + * Calls SetInventory. + * @param request SetInventoryRequest message or plain object * @returns Promise */ - public tuneModel(request: google.cloud.retail.v2alpha.ITuneModelRequest): Promise; - } - - namespace ModelService { - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|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.retail.v2alpha.ModelService|getModel}. - * @param error Error, if any - * @param [response] Model - */ - type GetModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|pauseModel}. - * @param error Error, if any - * @param [response] Model - */ - type PauseModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|resumeModel}. - * @param error Error, if any - * @param [response] Model - */ - type ResumeModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|deleteModel}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteModelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|listModels}. - * @param error Error, if any - * @param [response] ListModelsResponse - */ - type ListModelsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListModelsResponse) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|updateModel}. - * @param error Error, if any - * @param [response] Model - */ - type UpdateModelCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Model) => void; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|tuneModel}. - * @param error Error, if any - * @param [response] Operation - */ - type TuneModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a CreateModelRequest. */ - interface ICreateModelRequest { - - /** CreateModelRequest parent */ - parent?: (string|null); - - /** CreateModelRequest model */ - model?: (google.cloud.retail.v2alpha.IModel|null); - - /** CreateModelRequest dryRun */ - dryRun?: (boolean|null); - } - - /** Represents a CreateModelRequest. */ - class CreateModelRequest implements ICreateModelRequest { - - /** - * Constructs a new CreateModelRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateModelRequest); - - /** CreateModelRequest parent. */ - public parent: string; - - /** CreateModelRequest model. */ - public model?: (google.cloud.retail.v2alpha.IModel|null); - - /** CreateModelRequest dryRun. */ - public dryRun: boolean; - - /** - * Creates a new CreateModelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateModelRequest instance - */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateModelRequest): google.cloud.retail.v2alpha.CreateModelRequest; - - /** - * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.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.retail.v2alpha.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest): Promise; /** - * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelRequest.verify|verify} messages. - * @param message CreateModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback): void; /** - * 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 + * Calls AddFulfillmentPlaces. + * @param request AddFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateModelRequest; + public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): Promise; /** - * 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 + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest 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.cloud.retail.v2alpha.CreateModelRequest; + public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback): void; /** - * Verifies a CreateModelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls RemoveFulfillmentPlaces. + * @param request RemoveFulfillmentPlacesRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): Promise; /** - * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateModelRequest + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateModelRequest; + public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback): void; /** - * 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 + * Calls AddLocalInventories. + * @param request AddLocalInventoriesRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.retail.v2alpha.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): Promise; /** - * Converts this CreateModelRequest to JSON. - * @returns JSON object + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; + public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback): void; /** - * Gets the default type url for CreateModelRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls RemoveLocalInventories. + * @param request RemoveLocalInventoriesRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateModelRequest. */ - interface IUpdateModelRequest { - - /** UpdateModelRequest model */ - model?: (google.cloud.retail.v2alpha.IModel|null); - - /** UpdateModelRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): Promise; } - /** Represents an UpdateModelRequest. */ - class UpdateModelRequest implements IUpdateModelRequest { + namespace ProductService { /** - * Constructs a new UpdateModelRequest. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|createProduct}. + * @param error Error, if any + * @param [response] Product */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateModelRequest); - - /** UpdateModelRequest model. */ - public model?: (google.cloud.retail.v2alpha.IModel|null); + type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; - /** UpdateModelRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|getProduct}. + * @param error Error, if any + * @param [response] Product + */ + type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; /** - * Creates a new UpdateModelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateModelRequest instance + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateModelRequest): google.cloud.retail.v2alpha.UpdateModelRequest; + type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListProductsResponse) => void; /** - * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. - * @param message UpdateModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|updateProduct}. + * @param error Error, if any + * @param [response] Product */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; /** - * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. - * @param message UpdateModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|deleteProduct}. + * @param error Error, if any + * @param [response] Empty */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * 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 + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|purgeProducts}. + * @param error Error, if any + * @param [response] Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateModelRequest; + type PurgeProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * 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 + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|importProducts}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateModelRequest; + type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies an UpdateModelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|setInventory}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateModelRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateModelRequest; + type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * 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 + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeFulfillmentPlaces}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this UpdateModelRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Gets the default type url for UpdateModelRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeLocalInventories}. + * @param error Error, if any + * @param [response] Operation */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of a GetModelRequest. */ - interface IGetModelRequest { + /** Properties of a CreateProductRequest. */ + interface ICreateProductRequest { - /** GetModelRequest name */ - name?: (string|null); + /** CreateProductRequest parent */ + parent?: (string|null); + + /** CreateProductRequest product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** CreateProductRequest productId */ + productId?: (string|null); } - /** Represents a GetModelRequest. */ - class GetModelRequest implements IGetModelRequest { + /** Represents a CreateProductRequest. */ + class CreateProductRequest implements ICreateProductRequest { /** - * Constructs a new GetModelRequest. + * Constructs a new CreateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGetModelRequest); + constructor(properties?: google.cloud.retail.v2alpha.ICreateProductRequest); - /** GetModelRequest name. */ - public name: string; + /** CreateProductRequest parent. */ + public parent: string; + + /** CreateProductRequest product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** CreateProductRequest productId. */ + public productId: string; /** - * Creates a new GetModelRequest instance using the specified properties. + * Creates a new CreateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetModelRequest instance + * @returns CreateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetModelRequest): google.cloud.retail.v2alpha.GetModelRequest; + public static create(properties?: google.cloud.retail.v2alpha.ICreateProductRequest): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetModelRequest.verify|verify} messages. - * @param message GetModelRequest message or plain object to encode + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetModelRequest.verify|verify} messages. - * @param message GetModelRequest message or plain object to encode + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * @param message CreateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetModelRequest message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetModelRequest + * @returns CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetModelRequest + * @returns CreateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Verifies a GetModelRequest message. + * Verifies a CreateProductRequest message. * @param message Plain object 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. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetModelRequest + * @returns CreateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateProductRequest; /** - * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. - * @param message GetModelRequest + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * @param message CreateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetModelRequest to JSON. + * Converts this CreateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetModelRequest + * Gets the default type url for CreateProductRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PauseModelRequest. */ - interface IPauseModelRequest { + /** Properties of a GetProductRequest. */ + interface IGetProductRequest { - /** PauseModelRequest name */ + /** GetProductRequest name */ name?: (string|null); } - /** Represents a PauseModelRequest. */ - class PauseModelRequest implements IPauseModelRequest { + /** Represents a GetProductRequest. */ + class GetProductRequest implements IGetProductRequest { /** - * Constructs a new PauseModelRequest. + * Constructs a new GetProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPauseModelRequest); + constructor(properties?: google.cloud.retail.v2alpha.IGetProductRequest); - /** PauseModelRequest name. */ + /** GetProductRequest name. */ public name: string; /** - * Creates a new PauseModelRequest instance using the specified properties. + * Creates a new GetProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PauseModelRequest instance + * @returns GetProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPauseModelRequest): google.cloud.retail.v2alpha.PauseModelRequest; + public static create(properties?: google.cloud.retail.v2alpha.IGetProductRequest): google.cloud.retail.v2alpha.GetProductRequest; /** - * Encodes the specified PauseModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. - * @param message PauseModelRequest message or plain object to encode + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPauseModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PauseModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. - * @param message PauseModelRequest message or plain object to encode + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * @param message GetProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPauseModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PauseModelRequest message from the specified reader or buffer. + * Decodes a GetProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PauseModelRequest + * @returns GetProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PauseModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetProductRequest; /** - * Decodes a PauseModelRequest message from the specified reader or buffer, length delimited. + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PauseModelRequest + * @returns GetProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PauseModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetProductRequest; /** - * Verifies a PauseModelRequest message. + * Verifies a GetProductRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PauseModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PauseModelRequest + * @returns GetProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PauseModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetProductRequest; /** - * Creates a plain object from a PauseModelRequest message. Also converts values to other types if specified. - * @param message PauseModelRequest + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * @param message GetProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PauseModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PauseModelRequest to JSON. + * Converts this GetProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PauseModelRequest + * Gets the default type url for GetProductRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ResumeModelRequest. */ - interface IResumeModelRequest { + /** Properties of an UpdateProductRequest. */ + interface IUpdateProductRequest { - /** ResumeModelRequest name */ - name?: (string|null); + /** UpdateProductRequest product */ + product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** UpdateProductRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProductRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a ResumeModelRequest. */ - class ResumeModelRequest implements IResumeModelRequest { + /** Represents an UpdateProductRequest. */ + class UpdateProductRequest implements IUpdateProductRequest { /** - * Constructs a new ResumeModelRequest. + * Constructs a new UpdateProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IResumeModelRequest); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest); - /** ResumeModelRequest name. */ - public name: string; + /** UpdateProductRequest product. */ + public product?: (google.cloud.retail.v2alpha.IProduct|null); + + /** UpdateProductRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateProductRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new ResumeModelRequest instance using the specified properties. + * Creates a new UpdateProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ResumeModelRequest instance + * @returns UpdateProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IResumeModelRequest): google.cloud.retail.v2alpha.ResumeModelRequest; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Encodes the specified ResumeModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. - * @param message ResumeModelRequest message or plain object to encode + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IResumeModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResumeModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. - * @param message ResumeModelRequest message or plain object to encode + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * @param message UpdateProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IResumeModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResumeModelRequest message from the specified reader or buffer. + * Decodes an UpdateProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResumeModelRequest + * @returns UpdateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ResumeModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Decodes a ResumeModelRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResumeModelRequest + * @returns UpdateProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ResumeModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Verifies a ResumeModelRequest message. + * Verifies an UpdateProductRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResumeModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResumeModelRequest + * @returns UpdateProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ResumeModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateProductRequest; /** - * Creates a plain object from a ResumeModelRequest message. Also converts values to other types if specified. - * @param message ResumeModelRequest + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * @param message UpdateProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ResumeModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResumeModelRequest to JSON. + * Converts this UpdateProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResumeModelRequest + * Gets the default type url for UpdateProductRequest * @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); + /** Properties of a DeleteProductRequest. */ + interface IDeleteProductRequest { - /** ListModelsRequest pageSize */ - pageSize?: (number|null); + /** DeleteProductRequest name */ + name?: (string|null); - /** ListModelsRequest pageToken */ - pageToken?: (string|null); + /** DeleteProductRequest force */ + force?: (boolean|null); } - /** Represents a ListModelsRequest. */ - class ListModelsRequest implements IListModelsRequest { + /** Represents a DeleteProductRequest. */ + class DeleteProductRequest implements IDeleteProductRequest { /** - * Constructs a new ListModelsRequest. + * Constructs a new DeleteProductRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListModelsRequest); - - /** ListModelsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest); - /** ListModelsRequest pageSize. */ - public pageSize: number; + /** DeleteProductRequest name. */ + public name: string; - /** ListModelsRequest pageToken. */ - public pageToken: string; + /** DeleteProductRequest force. */ + public force: boolean; /** - * Creates a new ListModelsRequest instance using the specified properties. + * Creates a new DeleteProductRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListModelsRequest instance + * @returns DeleteProductRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListModelsRequest): google.cloud.retail.v2alpha.ListModelsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. - * @param message ListModelsRequest message or plain object to encode + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. - * @param message ListModelsRequest message or plain object to encode + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * @param message DeleteProductRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListModelsRequest message from the specified reader or buffer. + * Decodes a DeleteProductRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListModelsRequest + * @returns DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListModelsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListModelsRequest + * @returns DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListModelsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Verifies a ListModelsRequest message. + * Verifies a DeleteProductRequest message. * @param message Plain object 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. + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListModelsRequest + * @returns DeleteProductRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListModelsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteProductRequest; /** - * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. - * @param message ListModelsRequest + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * @param message DeleteProductRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListModelsRequest to JSON. + * Converts this DeleteProductRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListModelsRequest + * Gets the default type url for DeleteProductRequest * @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 { + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { - /** DeleteModelRequest name */ - name?: (string|null); + /** ListProductsRequest parent */ + parent?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + + /** ListProductsRequest filter */ + filter?: (string|null); + + /** ListProductsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** ListProductsRequest requireTotalSize */ + requireTotalSize?: (boolean|null); } - /** Represents a DeleteModelRequest. */ - class DeleteModelRequest implements IDeleteModelRequest { + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { /** - * Constructs a new DeleteModelRequest. + * Constructs a new ListProductsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IDeleteModelRequest); + constructor(properties?: google.cloud.retail.v2alpha.IListProductsRequest); - /** DeleteModelRequest name. */ - public name: string; + /** ListProductsRequest parent. */ + public parent: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** ListProductsRequest filter. */ + public filter: string; + + /** ListProductsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** ListProductsRequest requireTotalSize. */ + public requireTotalSize: boolean; /** - * Creates a new DeleteModelRequest instance using the specified properties. + * Creates a new ListProductsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteModelRequest instance + * @returns ListProductsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IDeleteModelRequest): google.cloud.retail.v2alpha.DeleteModelRequest; + public static create(properties?: google.cloud.retail.v2alpha.IListProductsRequest): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. - * @param message DeleteModelRequest message or plain object to encode + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. - * @param message DeleteModelRequest message or plain object to encode + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer. + * Decodes a ListProductsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteModelRequest + * @returns ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteModelRequest + * @returns ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Verifies a DeleteModelRequest message. + * Verifies a ListProductsRequest message. * @param message Plain object 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. + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteModelRequest + * @returns ListProductsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsRequest; /** - * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. - * @param message DeleteModelRequest + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteModelRequest to JSON. + * Converts this ListProductsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteModelRequest + * Gets the default type url for ListProductsRequest * @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 { + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { - /** ListModelsResponse models */ - models?: (google.cloud.retail.v2alpha.IModel[]|null); + /** ListProductsResponse products */ + products?: (google.cloud.retail.v2alpha.IProduct[]|null); - /** ListModelsResponse nextPageToken */ + /** ListProductsResponse nextPageToken */ nextPageToken?: (string|null); + + /** ListProductsResponse totalSize */ + totalSize?: (number|null); } - /** Represents a ListModelsResponse. */ - class ListModelsResponse implements IListModelsResponse { + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { /** - * Constructs a new ListModelsResponse. + * Constructs a new ListProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListModelsResponse); + constructor(properties?: google.cloud.retail.v2alpha.IListProductsResponse); - /** ListModelsResponse models. */ - public models: google.cloud.retail.v2alpha.IModel[]; + /** ListProductsResponse products. */ + public products: google.cloud.retail.v2alpha.IProduct[]; - /** ListModelsResponse nextPageToken. */ + /** ListProductsResponse nextPageToken. */ public nextPageToken: string; + /** ListProductsResponse totalSize. */ + public totalSize: number; + /** - * Creates a new ListModelsResponse instance using the specified properties. + * Creates a new ListProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListModelsResponse instance + * @returns ListProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListModelsResponse): google.cloud.retail.v2alpha.ListModelsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IListProductsResponse): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. - * @param message ListModelsResponse message or plain object to encode + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. - * @param message ListModelsResponse message or plain object to encode + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListModelsResponse message from the specified reader or buffer. + * Decodes a ListProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListModelsResponse + * @returns ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListModelsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListModelsResponse + * @returns ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListModelsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Verifies a ListModelsResponse message. + * Verifies a ListProductsResponse message. * @param message Plain object 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. + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListModelsResponse + * @returns ListProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListModelsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsResponse; /** - * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. - * @param message ListModelsResponse + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListModelsResponse to JSON. + * Converts this ListProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListModelsResponse + * Gets the default type url for ListProductsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TuneModelRequest. */ - interface ITuneModelRequest { + /** Properties of a SetInventoryRequest. */ + interface ISetInventoryRequest { - /** TuneModelRequest name */ - name?: (string|null); + /** SetInventoryRequest inventory */ + inventory?: (google.cloud.retail.v2alpha.IProduct|null); + + /** SetInventoryRequest setMask */ + setMask?: (google.protobuf.IFieldMask|null); + + /** SetInventoryRequest setTime */ + setTime?: (google.protobuf.ITimestamp|null); + + /** SetInventoryRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a TuneModelRequest. */ - class TuneModelRequest implements ITuneModelRequest { + /** Represents a SetInventoryRequest. */ + class SetInventoryRequest implements ISetInventoryRequest { /** - * Constructs a new TuneModelRequest. + * Constructs a new SetInventoryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ITuneModelRequest); + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest); - /** TuneModelRequest name. */ - public name: string; + /** SetInventoryRequest inventory. */ + public inventory?: (google.cloud.retail.v2alpha.IProduct|null); + + /** SetInventoryRequest setMask. */ + public setMask?: (google.protobuf.IFieldMask|null); + + /** SetInventoryRequest setTime. */ + public setTime?: (google.protobuf.ITimestamp|null); + + /** SetInventoryRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new TuneModelRequest instance using the specified properties. + * Creates a new SetInventoryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TuneModelRequest instance + * @returns SetInventoryRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ITuneModelRequest): google.cloud.retail.v2alpha.TuneModelRequest; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Encodes the specified TuneModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. - * @param message TuneModelRequest message or plain object to encode + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ITuneModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TuneModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. - * @param message TuneModelRequest message or plain object to encode + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * @param message SetInventoryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TuneModelRequest message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TuneModelRequest + * @returns SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Decodes a TuneModelRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TuneModelRequest + * @returns SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Verifies a TuneModelRequest message. + * Verifies a SetInventoryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TuneModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TuneModelRequest + * @returns SetInventoryRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryRequest; /** - * Creates a plain object from a TuneModelRequest message. Also converts values to other types if specified. - * @param message TuneModelRequest + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * @param message SetInventoryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.TuneModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TuneModelRequest to JSON. + * Converts this SetInventoryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TuneModelRequest + * Gets the default type url for SetInventoryRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateModelMetadata. */ - interface ICreateModelMetadata { - - /** CreateModelMetadata model */ - model?: (string|null); + /** Properties of a SetInventoryMetadata. */ + interface ISetInventoryMetadata { } - /** Represents a CreateModelMetadata. */ - class CreateModelMetadata implements ICreateModelMetadata { + /** Represents a SetInventoryMetadata. */ + class SetInventoryMetadata implements ISetInventoryMetadata { /** - * Constructs a new CreateModelMetadata. + * Constructs a new SetInventoryMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateModelMetadata); - - /** CreateModelMetadata model. */ - public model: string; + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata); /** - * Creates a new CreateModelMetadata instance using the specified properties. + * Creates a new SetInventoryMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateModelMetadata instance + * @returns SetInventoryMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateModelMetadata): google.cloud.retail.v2alpha.CreateModelMetadata; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Encodes the specified CreateModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. - * @param message CreateModelMetadata message or plain object to encode + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICreateModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. - * @param message CreateModelMetadata message or plain object to encode + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @param message SetInventoryMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateModelMetadata message from the specified reader or buffer. + * Decodes a SetInventoryMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateModelMetadata + * @returns SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateModelMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Decodes a CreateModelMetadata message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateModelMetadata + * @returns SetInventoryMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateModelMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Verifies a CreateModelMetadata message. + * Verifies a SetInventoryMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateModelMetadata + * @returns SetInventoryMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateModelMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryMetadata; /** - * Creates a plain object from a CreateModelMetadata message. Also converts values to other types if specified. - * @param message CreateModelMetadata + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * @param message SetInventoryMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CreateModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateModelMetadata to JSON. + * Converts this SetInventoryMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateModelMetadata + * Gets the default type url for SetInventoryMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TuneModelMetadata. */ - interface ITuneModelMetadata { - - /** TuneModelMetadata model */ - model?: (string|null); + /** Properties of a SetInventoryResponse. */ + interface ISetInventoryResponse { } - /** Represents a TuneModelMetadata. */ - class TuneModelMetadata implements ITuneModelMetadata { + /** Represents a SetInventoryResponse. */ + class SetInventoryResponse implements ISetInventoryResponse { /** - * Constructs a new TuneModelMetadata. + * Constructs a new SetInventoryResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ITuneModelMetadata); - - /** TuneModelMetadata model. */ - public model: string; + constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse); /** - * Creates a new TuneModelMetadata instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TuneModelMetadata instance + * @returns SetInventoryResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.ITuneModelMetadata): google.cloud.retail.v2alpha.TuneModelMetadata; + public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Encodes the specified TuneModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. - * @param message TuneModelMetadata message or plain object to encode + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ITuneModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TuneModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. - * @param message TuneModelMetadata message or plain object to encode + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * @param message SetInventoryResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TuneModelMetadata message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TuneModelMetadata + * @returns SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Decodes a TuneModelMetadata message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TuneModelMetadata + * @returns SetInventoryResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Verifies a TuneModelMetadata message. + * Verifies a SetInventoryResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TuneModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TuneModelMetadata + * @returns SetInventoryResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryResponse; /** - * Creates a plain object from a TuneModelMetadata message. Also converts values to other types if specified. - * @param message TuneModelMetadata + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. + * @param message SetInventoryResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.TuneModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TuneModelMetadata to JSON. + * Converts this SetInventoryResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TuneModelMetadata + * Gets the default type url for SetInventoryResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TuneModelResponse. */ - interface ITuneModelResponse { + /** Properties of an AddFulfillmentPlacesRequest. */ + interface IAddFulfillmentPlacesRequest { + + /** AddFulfillmentPlacesRequest product */ + product?: (string|null); + + /** AddFulfillmentPlacesRequest type */ + type?: (string|null); + + /** AddFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); + + /** AddFulfillmentPlacesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); + + /** AddFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a TuneModelResponse. */ - class TuneModelResponse implements ITuneModelResponse { + /** Represents an AddFulfillmentPlacesRequest. */ + class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { /** - * Constructs a new TuneModelResponse. + * Constructs a new AddFulfillmentPlacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ITuneModelResponse); + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest); + + /** AddFulfillmentPlacesRequest product. */ + public product: string; + + /** AddFulfillmentPlacesRequest type. */ + public type: string; + + /** AddFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; + + /** AddFulfillmentPlacesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); + + /** AddFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new TuneModelResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TuneModelResponse instance + * @returns AddFulfillmentPlacesRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ITuneModelResponse): google.cloud.retail.v2alpha.TuneModelResponse; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Encodes the specified TuneModelResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. - * @param message TuneModelResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ITuneModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TuneModelResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. - * @param message TuneModelResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * @param message AddFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ITuneModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TuneModelResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TuneModelResponse + * @returns AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.TuneModelResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Decodes a TuneModelResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TuneModelResponse + * @returns AddFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.TuneModelResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Verifies a TuneModelResponse message. + * Verifies an AddFulfillmentPlacesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TuneModelResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TuneModelResponse + * @returns AddFulfillmentPlacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.TuneModelResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; /** - * Creates a plain object from a TuneModelResponse message. Also converts values to other types if specified. - * @param message TuneModelResponse + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.TuneModelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TuneModelResponse to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TuneModelResponse + * Gets the default type url for AddFulfillmentPlacesRequest * @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.retail.v2alpha.IPredictRequest, callback: google.cloud.retail.v2alpha.PredictionService.PredictCallback): void; - - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @returns Promise - */ - public predict(request: google.cloud.retail.v2alpha.IPredictRequest): Promise; - } - - namespace PredictionService { - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService|predict}. - * @param error Error, if any - * @param [response] PredictResponse - */ - type PredictCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.PredictResponse) => void; - } - - /** Properties of a PredictRequest. */ - interface IPredictRequest { - - /** PredictRequest placement */ - placement?: (string|null); - - /** PredictRequest userEvent */ - userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - - /** PredictRequest pageSize */ - pageSize?: (number|null); - - /** PredictRequest pageToken */ - pageToken?: (string|null); - - /** PredictRequest filter */ - filter?: (string|null); - - /** PredictRequest validateOnly */ - validateOnly?: (boolean|null); - - /** PredictRequest params */ - params?: ({ [k: string]: google.protobuf.IValue }|null); - - /** PredictRequest labels */ - labels?: ({ [k: string]: string }|null); + /** Properties of an AddFulfillmentPlacesMetadata. */ + interface IAddFulfillmentPlacesMetadata { } - /** Represents a PredictRequest. */ - class PredictRequest implements IPredictRequest { + /** Represents an AddFulfillmentPlacesMetadata. */ + class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { /** - * Constructs a new PredictRequest. + * Constructs a new AddFulfillmentPlacesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPredictRequest); - - /** PredictRequest placement. */ - public placement: string; - - /** PredictRequest userEvent. */ - public userEvent?: (google.cloud.retail.v2alpha.IUserEvent|null); - - /** PredictRequest pageSize. */ - public pageSize: number; - - /** PredictRequest pageToken. */ - public pageToken: string; - - /** PredictRequest filter. */ - public filter: string; - - /** PredictRequest validateOnly. */ - public validateOnly: boolean; - - /** PredictRequest params. */ - public params: { [k: string]: google.protobuf.IValue }; - - /** PredictRequest labels. */ - public labels: { [k: string]: string }; + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata); /** - * Creates a new PredictRequest instance using the specified properties. + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PredictRequest instance + * @returns AddFulfillmentPlacesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPredictRequest): google.cloud.retail.v2alpha.PredictRequest; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @param message AddFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictRequest + * @returns AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictRequest + * @returns AddFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Verifies a PredictRequest message. + * Verifies an AddFulfillmentPlacesMetadata message. * @param message Plain object 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. + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictRequest + * @returns AddFulfillmentPlacesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. - * @param message PredictRequest + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictRequest to JSON. + * Converts this AddFulfillmentPlacesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PredictRequest + * Gets the default type url for AddFulfillmentPlacesMetadata * @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 results */ - results?: (google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]|null); - - /** PredictResponse attributionToken */ - attributionToken?: (string|null); - - /** PredictResponse missingIds */ - missingIds?: (string[]|null); - - /** PredictResponse validateOnly */ - validateOnly?: (boolean|null); + /** Properties of an AddFulfillmentPlacesResponse. */ + interface IAddFulfillmentPlacesResponse { } - /** Represents a PredictResponse. */ - class PredictResponse implements IPredictResponse { + /** Represents an AddFulfillmentPlacesResponse. */ + class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { /** - * Constructs a new PredictResponse. + * Constructs a new AddFulfillmentPlacesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPredictResponse); - - /** PredictResponse results. */ - public results: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult[]; - - /** PredictResponse attributionToken. */ - public attributionToken: string; - - /** PredictResponse missingIds. */ - public missingIds: string[]; - - /** PredictResponse validateOnly. */ - public validateOnly: boolean; + constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse); /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PredictResponse instance + * @returns AddFulfillmentPlacesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPredictResponse): google.cloud.retail.v2alpha.PredictResponse; + public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @param message AddFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictResponse + * @returns AddFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictResponse + * @returns AddFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Verifies a PredictResponse message. + * Verifies an AddFulfillmentPlacesResponse message. * @param message Plain object 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. + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictResponse + * @returns AddFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. - * @param message PredictResponse + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message AddFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictResponse to JSON. + * Converts this AddFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PredictResponse + * Gets the default type url for AddFulfillmentPlacesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace PredictResponse { - - /** Properties of a PredictionResult. */ - interface IPredictionResult { - - /** PredictionResult id */ - id?: (string|null); - - /** PredictionResult metadata */ - metadata?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a PredictionResult. */ - class PredictionResult implements IPredictionResult { - - /** - * Constructs a new PredictionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult); - - /** PredictionResult id. */ - public id: string; - - /** PredictionResult metadata. */ - public metadata: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new PredictionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns PredictionResult instance - */ - public static create(properties?: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; - - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @param message PredictionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.PredictResponse.IPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; - - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; + /** Properties of an AddLocalInventoriesRequest. */ + interface IAddLocalInventoriesRequest { - /** - * Verifies a PredictionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** AddLocalInventoriesRequest product */ + product?: (string|null); - /** - * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PredictionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PredictResponse.PredictionResult; + /** AddLocalInventoriesRequest localInventories */ + localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @param message PredictionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.retail.v2alpha.PredictResponse.PredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** AddLocalInventoriesRequest addMask */ + addMask?: (google.protobuf.IFieldMask|null); - /** - * Converts this PredictionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** AddLocalInventoriesRequest addTime */ + addTime?: (google.protobuf.ITimestamp|null); - /** - * Gets the default type url for PredictionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** AddLocalInventoriesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a ProductService */ - class ProductService extends $protobuf.rpc.Service { + /** Represents an AddLocalInventoriesRequest. */ + class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { /** - * Constructs a new ProductService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new AddLocalInventoriesRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest); - /** - * Creates new ProductService 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): ProductService; + /** AddLocalInventoriesRequest product. */ + public product: string; - /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product - */ - public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.CreateProductCallback): void; + /** AddLocalInventoriesRequest localInventories. */ + public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; - /** - * Calls CreateProduct. - * @param request CreateProductRequest message or plain object - * @returns Promise - */ - public createProduct(request: google.cloud.retail.v2alpha.ICreateProductRequest): Promise; + /** AddLocalInventoriesRequest addMask. */ + public addMask?: (google.protobuf.IFieldMask|null); - /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product - */ - public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest, callback: google.cloud.retail.v2alpha.ProductService.GetProductCallback): void; + /** AddLocalInventoriesRequest addTime. */ + public addTime?: (google.protobuf.ITimestamp|null); + + /** AddLocalInventoriesRequest allowMissing. */ + public allowMissing: boolean; /** - * Calls GetProduct. - * @param request GetProductRequest message or plain object - * @returns Promise + * Creates a new AddLocalInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddLocalInventoriesRequest instance */ - public getProduct(request: google.cloud.retail.v2alpha.IGetProductRequest): Promise; + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProductsResponse + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ListProductsCallback): void; + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListProducts. - * @param request ListProductsRequest message or plain object - * @returns Promise + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @param message AddLocalInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listProducts(request: google.cloud.retail.v2alpha.IListProductsRequest): Promise; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Product + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest, callback: google.cloud.retail.v2alpha.ProductService.UpdateProductCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; /** - * Calls UpdateProduct. - * @param request UpdateProductRequest message or plain object - * @returns Promise + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateProduct(request: google.cloud.retail.v2alpha.IUpdateProductRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Verifies an AddLocalInventoriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest, callback: google.cloud.retail.v2alpha.ProductService.DeleteProductCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteProduct. - * @param request DeleteProductRequest message or plain object - * @returns Promise + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddLocalInventoriesRequest */ - public deleteProduct(request: google.cloud.retail.v2alpha.IDeleteProductRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; /** - * Calls PurgeProducts. - * @param request PurgeProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message AddLocalInventoriesRequest + * @param [options] Conversion options + * @returns Plain object */ - public purgeProducts(request: google.cloud.retail.v2alpha.IPurgeProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.PurgeProductsCallback): void; + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls PurgeProducts. - * @param request PurgeProductsRequest message or plain object - * @returns Promise + * Converts this AddLocalInventoriesRequest to JSON. + * @returns JSON object */ - public purgeProducts(request: google.cloud.retail.v2alpha.IPurgeProductsRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for AddLocalInventoriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest, callback: google.cloud.retail.v2alpha.ProductService.ImportProductsCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddLocalInventoriesMetadata. */ + interface IAddLocalInventoriesMetadata { + } + + /** Represents an AddLocalInventoriesMetadata. */ + class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { /** - * Calls ImportProducts. - * @param request ImportProductsRequest message or plain object - * @returns Promise + * Constructs a new AddLocalInventoriesMetadata. + * @param [properties] Properties to set */ - public importProducts(request: google.cloud.retail.v2alpha.IImportProductsRequest): Promise; + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata); /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AddLocalInventoriesMetadata instance */ - public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest, callback: google.cloud.retail.v2alpha.ProductService.SetInventoryCallback): void; + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; /** - * Calls SetInventory. - * @param request SetInventoryRequest message or plain object - * @returns Promise + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public setInventory(request: google.cloud.retail.v2alpha.ISetInventoryRequest): Promise; + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @param message AddLocalInventoriesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback): void; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls AddFulfillmentPlaces. - * @param request AddFulfillmentPlacesRequest message or plain object - * @returns Promise + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public addFulfillmentPlaces(request: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; /** - * Calls RemoveFulfillmentPlaces. - * @param request RemoveFulfillmentPlacesRequest message or plain object - * @returns Promise + * Verifies an AddLocalInventoriesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public removeFulfillmentPlaces(request: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls AddLocalInventories. - * @param request AddLocalInventoriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddLocalInventoriesMetadata */ - public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; /** - * Calls AddLocalInventories. - * @param request AddLocalInventoriesRequest message or plain object - * @returns Promise + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message AddLocalInventoriesMetadata + * @param [options] Conversion options + * @returns Plain object */ - public addLocalInventories(request: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): Promise; + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RemoveLocalInventories. - * @param request RemoveLocalInventoriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this AddLocalInventoriesMetadata to JSON. + * @returns JSON object */ - public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, callback: google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls RemoveLocalInventories. - * @param request RemoveLocalInventoriesRequest message or plain object - * @returns Promise + * Gets the default type url for AddLocalInventoriesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public removeLocalInventories(request: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ProductService { + /** Properties of an AddLocalInventoriesResponse. */ + interface IAddLocalInventoriesResponse { + } - /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|createProduct}. - * @param error Error, if any - * @param [response] Product - */ - type CreateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + /** Represents an AddLocalInventoriesResponse. */ + class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|getProduct}. - * @param error Error, if any - * @param [response] Product + * Constructs a new AddLocalInventoriesResponse. + * @param [properties] Properties to set */ - type GetProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse); /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|listProducts}. - * @param error Error, if any - * @param [response] ListProductsResponse + * Creates a new AddLocalInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddLocalInventoriesResponse instance */ - type ListProductsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListProductsResponse) => void; + public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|updateProduct}. - * @param error Error, if any - * @param [response] Product + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateProductCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Product) => void; + public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|deleteProduct}. - * @param error Error, if any - * @param [response] Empty + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * @param message AddLocalInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|purgeProducts}. - * @param error Error, if any - * @param [response] Operation + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type PurgeProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|importProducts}. - * @param error Error, if any - * @param [response] Operation + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddLocalInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ImportProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|setInventory}. - * @param error Error, if any - * @param [response] Operation + * Verifies an AddLocalInventoriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type SetInventoryCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddLocalInventoriesResponse */ - type AddFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeFulfillmentPlaces}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message AddLocalInventoriesResponse + * @param [options] Conversion options + * @returns Plain object */ - type RemoveFulfillmentPlacesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addLocalInventories}. - * @param error Error, if any - * @param [response] Operation + * Converts this AddLocalInventoriesResponse to JSON. + * @returns JSON object */ - type AddLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeLocalInventories}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for AddLocalInventoriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type RemoveLocalInventoriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateProductRequest. */ - interface ICreateProductRequest { + /** Properties of a RemoveLocalInventoriesRequest. */ + interface IRemoveLocalInventoriesRequest { - /** CreateProductRequest parent */ - parent?: (string|null); + /** RemoveLocalInventoriesRequest product */ + product?: (string|null); - /** CreateProductRequest product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); + /** RemoveLocalInventoriesRequest placeIds */ + placeIds?: (string[]|null); - /** CreateProductRequest productId */ - productId?: (string|null); + /** RemoveLocalInventoriesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a CreateProductRequest. */ - class CreateProductRequest implements ICreateProductRequest { + /** Represents a RemoveLocalInventoriesRequest. */ + class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { /** - * Constructs a new CreateProductRequest. + * Constructs a new RemoveLocalInventoriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ICreateProductRequest); + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest); - /** CreateProductRequest parent. */ - public parent: string; + /** RemoveLocalInventoriesRequest product. */ + public product: string; - /** CreateProductRequest product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); + /** RemoveLocalInventoriesRequest placeIds. */ + public placeIds: string[]; - /** CreateProductRequest productId. */ - public productId: string; + /** RemoveLocalInventoriesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveLocalInventoriesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateProductRequest instance + * @returns RemoveLocalInventoriesRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ICreateProductRequest): google.cloud.retail.v2alpha.CreateProductRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. - * @param message CreateProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * @param message RemoveLocalInventoriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ICreateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateProductRequest + * @returns RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.CreateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateProductRequest + * @returns RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.CreateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Verifies a CreateProductRequest message. + * Verifies a RemoveLocalInventoriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateProductRequest + * @returns RemoveLocalInventoriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.CreateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. - * @param message CreateProductRequest + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.CreateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateProductRequest to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateProductRequest + * Gets the default type url for RemoveLocalInventoriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetProductRequest. */ - interface IGetProductRequest { - - /** GetProductRequest name */ - name?: (string|null); + /** Properties of a RemoveLocalInventoriesMetadata. */ + interface IRemoveLocalInventoriesMetadata { } - /** Represents a GetProductRequest. */ - class GetProductRequest implements IGetProductRequest { + /** Represents a RemoveLocalInventoriesMetadata. */ + class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { /** - * Constructs a new GetProductRequest. + * Constructs a new RemoveLocalInventoriesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IGetProductRequest); - - /** GetProductRequest name. */ - public name: string; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata); /** - * Creates a new GetProductRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns GetProductRequest instance + * @returns RemoveLocalInventoriesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IGetProductRequest): google.cloud.retail.v2alpha.GetProductRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. - * @param message GetProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * @param message RemoveLocalInventoriesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetProductRequest + * @returns RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetProductRequest + * @returns RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Verifies a GetProductRequest message. + * Verifies a RemoveLocalInventoriesMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetProductRequest + * @returns RemoveLocalInventoriesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. - * @param message GetProductRequest + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.GetProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetProductRequest to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetProductRequest + * Gets the default type url for RemoveLocalInventoriesMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateProductRequest. */ - interface IUpdateProductRequest { - - /** UpdateProductRequest product */ - product?: (google.cloud.retail.v2alpha.IProduct|null); - - /** UpdateProductRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateProductRequest allowMissing */ - allowMissing?: (boolean|null); + /** Properties of a RemoveLocalInventoriesResponse. */ + interface IRemoveLocalInventoriesResponse { } - /** Represents an UpdateProductRequest. */ - class UpdateProductRequest implements IUpdateProductRequest { + /** Represents a RemoveLocalInventoriesResponse. */ + class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { /** - * Constructs a new UpdateProductRequest. + * Constructs a new RemoveLocalInventoriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest); - - /** UpdateProductRequest product. */ - public product?: (google.cloud.retail.v2alpha.IProduct|null); - - /** UpdateProductRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateProductRequest allowMissing. */ - public allowMissing: boolean; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse); /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateProductRequest instance + * @returns RemoveLocalInventoriesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IUpdateProductRequest): google.cloud.retail.v2alpha.UpdateProductRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. - * @param message UpdateProductRequest message or plain object to encode + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * @param message RemoveLocalInventoriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateProductRequest + * @returns RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateProductRequest + * @returns RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Verifies an UpdateProductRequest message. + * Verifies a RemoveLocalInventoriesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateProductRequest + * @returns RemoveLocalInventoriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. - * @param message UpdateProductRequest + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * @param message RemoveLocalInventoriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.UpdateProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateProductRequest + * Gets the default type url for RemoveLocalInventoriesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteProductRequest. */ - interface IDeleteProductRequest { + /** Properties of a RemoveFulfillmentPlacesRequest. */ + interface IRemoveFulfillmentPlacesRequest { - /** DeleteProductRequest name */ - name?: (string|null); + /** RemoveFulfillmentPlacesRequest product */ + product?: (string|null); - /** DeleteProductRequest force */ - force?: (boolean|null); + /** RemoveFulfillmentPlacesRequest type */ + type?: (string|null); + + /** RemoveFulfillmentPlacesRequest placeIds */ + placeIds?: (string[]|null); + + /** RemoveFulfillmentPlacesRequest removeTime */ + removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveFulfillmentPlacesRequest allowMissing */ + allowMissing?: (boolean|null); } - /** Represents a DeleteProductRequest. */ - class DeleteProductRequest implements IDeleteProductRequest { + /** Represents a RemoveFulfillmentPlacesRequest. */ + class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { /** - * Constructs a new DeleteProductRequest. + * Constructs a new RemoveFulfillmentPlacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest); + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest); - /** DeleteProductRequest name. */ - public name: string; + /** RemoveFulfillmentPlacesRequest product. */ + public product: string; - /** DeleteProductRequest force. */ - public force: boolean; + /** RemoveFulfillmentPlacesRequest type. */ + public type: string; + + /** RemoveFulfillmentPlacesRequest placeIds. */ + public placeIds: string[]; + + /** RemoveFulfillmentPlacesRequest removeTime. */ + public removeTime?: (google.protobuf.ITimestamp|null); + + /** RemoveFulfillmentPlacesRequest allowMissing. */ + public allowMissing: boolean; /** - * Creates a new DeleteProductRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteProductRequest instance + * @returns RemoveFulfillmentPlacesRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IDeleteProductRequest): google.cloud.retail.v2alpha.DeleteProductRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. - * @param message DeleteProductRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * @param message RemoveFulfillmentPlacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IDeleteProductRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteProductRequest + * @returns RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.DeleteProductRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteProductRequest + * @returns RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.DeleteProductRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Verifies a DeleteProductRequest message. + * Verifies a RemoveFulfillmentPlacesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteProductRequest + * @returns RemoveFulfillmentPlacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.DeleteProductRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. - * @param message DeleteProductRequest + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.DeleteProductRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteProductRequest to JSON. + * Converts this RemoveFulfillmentPlacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteProductRequest + * Gets the default type url for RemoveFulfillmentPlacesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListProductsRequest. */ - interface IListProductsRequest { - - /** ListProductsRequest parent */ - parent?: (string|null); - - /** ListProductsRequest pageSize */ - pageSize?: (number|null); - - /** ListProductsRequest pageToken */ - pageToken?: (string|null); - - /** ListProductsRequest filter */ - filter?: (string|null); - - /** ListProductsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - - /** ListProductsRequest requireTotalSize */ - requireTotalSize?: (boolean|null); + /** Properties of a RemoveFulfillmentPlacesMetadata. */ + interface IRemoveFulfillmentPlacesMetadata { } - /** Represents a ListProductsRequest. */ - class ListProductsRequest implements IListProductsRequest { + /** Represents a RemoveFulfillmentPlacesMetadata. */ + class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { /** - * Constructs a new ListProductsRequest. + * Constructs a new RemoveFulfillmentPlacesMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListProductsRequest); - - /** ListProductsRequest parent. */ - public parent: string; - - /** ListProductsRequest pageSize. */ - public pageSize: number; - - /** ListProductsRequest pageToken. */ - public pageToken: string; - - /** ListProductsRequest filter. */ - public filter: string; - - /** ListProductsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** ListProductsRequest requireTotalSize. */ - public requireTotalSize: boolean; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata); /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsRequest instance + * @returns RemoveFulfillmentPlacesMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListProductsRequest): google.cloud.retail.v2alpha.ListProductsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. - * @param message ListProductsRequest message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsRequest + * @returns RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsRequest + * @returns RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Verifies a ListProductsRequest message. + * Verifies a RemoveFulfillmentPlacesMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsRequest + * @returns RemoveFulfillmentPlacesMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. - * @param message ListProductsRequest + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsRequest to JSON. + * Converts this RemoveFulfillmentPlacesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListProductsRequest + * Gets the default type url for RemoveFulfillmentPlacesMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProductsResponse. */ - interface IListProductsResponse { - - /** ListProductsResponse products */ - products?: (google.cloud.retail.v2alpha.IProduct[]|null); - - /** ListProductsResponse nextPageToken */ - nextPageToken?: (string|null); + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ListProductsResponse totalSize */ - totalSize?: (number|null); + /** Properties of a RemoveFulfillmentPlacesResponse. */ + interface IRemoveFulfillmentPlacesResponse { } - /** Represents a ListProductsResponse. */ - class ListProductsResponse implements IListProductsResponse { + /** Represents a RemoveFulfillmentPlacesResponse. */ + class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { /** - * Constructs a new ListProductsResponse. + * Constructs a new RemoveFulfillmentPlacesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IListProductsResponse); - - /** ListProductsResponse products. */ - public products: google.cloud.retail.v2alpha.IProduct[]; - - /** ListProductsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListProductsResponse totalSize. */ - public totalSize: number; + constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse); /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListProductsResponse instance + * @returns RemoveFulfillmentPlacesResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IListProductsResponse): google.cloud.retail.v2alpha.ListProductsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. - * @param message ListProductsResponse message or plain object to encode + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * @param message RemoveFulfillmentPlacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListProductsResponse + * @returns RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListProductsResponse + * @returns RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Verifies a ListProductsResponse message. + * Verifies a RemoveFulfillmentPlacesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListProductsResponse + * @returns RemoveFulfillmentPlacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. - * @param message ListProductsResponse + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @param message RemoveFulfillmentPlacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListProductsResponse to JSON. + * Converts this RemoveFulfillmentPlacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListProductsResponse + * Gets the default type url for RemoveFulfillmentPlacesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SetInventoryRequest. */ - interface ISetInventoryRequest { - - /** SetInventoryRequest inventory */ - inventory?: (google.cloud.retail.v2alpha.IProduct|null); - - /** SetInventoryRequest setMask */ - setMask?: (google.protobuf.IFieldMask|null); - - /** SetInventoryRequest setTime */ - setTime?: (google.protobuf.ITimestamp|null); - - /** SetInventoryRequest allowMissing */ - allowMissing?: (boolean|null); + /** Properties of a PurgeMetadata. */ + interface IPurgeMetadata { } - /** Represents a SetInventoryRequest. */ - class SetInventoryRequest implements ISetInventoryRequest { + /** Represents a PurgeMetadata. */ + class PurgeMetadata implements IPurgeMetadata { /** - * Constructs a new SetInventoryRequest. + * Constructs a new PurgeMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest); - - /** SetInventoryRequest inventory. */ - public inventory?: (google.cloud.retail.v2alpha.IProduct|null); - - /** SetInventoryRequest setMask. */ - public setMask?: (google.protobuf.IFieldMask|null); - - /** SetInventoryRequest setTime. */ - public setTime?: (google.protobuf.ITimestamp|null); - - /** SetInventoryRequest allowMissing. */ - public allowMissing: boolean; + constructor(properties?: google.cloud.retail.v2alpha.IPurgeMetadata); /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new PurgeMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryRequest instance + * @returns PurgeMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryRequest): google.cloud.retail.v2alpha.SetInventoryRequest; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeMetadata): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. - * @param message SetInventoryRequest message or plain object to encode + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * @param message PurgeMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes a PurgeMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryRequest + * @returns PurgeMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryRequest + * @returns PurgeMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Verifies a SetInventoryRequest message. + * Verifies a PurgeMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryRequest + * @returns PurgeMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeMetadata; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. - * @param message SetInventoryRequest + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * @param message PurgeMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this PurgeMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SetInventoryRequest + * Gets the default type url for PurgeMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SetInventoryMetadata. */ - interface ISetInventoryMetadata { + /** Properties of a PurgeProductsMetadata. */ + interface IPurgeProductsMetadata { + + /** PurgeProductsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** PurgeProductsMetadata failureCount */ + failureCount?: (number|Long|string|null); } - /** Represents a SetInventoryMetadata. */ - class SetInventoryMetadata implements ISetInventoryMetadata { + /** Represents a PurgeProductsMetadata. */ + class PurgeProductsMetadata implements IPurgeProductsMetadata { /** - * Constructs a new SetInventoryMetadata. + * Constructs a new PurgeProductsMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsMetadata); + + /** PurgeProductsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount. */ + public successCount: (number|Long|string); + + /** PurgeProductsMetadata failureCount. */ + public failureCount: (number|Long|string); /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * Creates a new PurgeProductsMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryMetadata instance + * @returns PurgeProductsMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryMetadata): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsMetadata): google.cloud.retail.v2alpha.PurgeProductsMetadata; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. - * @param message SetInventoryMetadata message or plain object to encode + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryMetadata + * @returns PurgeProductsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsMetadata; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryMetadata + * @returns PurgeProductsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsMetadata; /** - * Verifies a SetInventoryMetadata message. + * Verifies a PurgeProductsMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryMetadata + * @returns PurgeProductsMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsMetadata; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. - * @param message SetInventoryMetadata + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * @param message PurgeProductsMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryMetadata to JSON. + * Converts this PurgeProductsMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SetInventoryMetadata + * Gets the default type url for PurgeProductsMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SetInventoryResponse. */ - interface ISetInventoryResponse { + /** Properties of a PurgeProductsRequest. */ + interface IPurgeProductsRequest { + + /** PurgeProductsRequest parent */ + parent?: (string|null); + + /** PurgeProductsRequest filter */ + filter?: (string|null); + + /** PurgeProductsRequest force */ + force?: (boolean|null); } - /** Represents a SetInventoryResponse. */ - class SetInventoryResponse implements ISetInventoryResponse { + /** Represents a PurgeProductsRequest. */ + class PurgeProductsRequest implements IPurgeProductsRequest { /** - * Constructs a new SetInventoryResponse. + * Constructs a new PurgeProductsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsRequest); + + /** PurgeProductsRequest parent. */ + public parent: string; + + /** PurgeProductsRequest filter. */ + public filter: string; + + /** PurgeProductsRequest force. */ + public force: boolean; /** - * Creates a new SetInventoryResponse instance using the specified properties. + * Creates a new PurgeProductsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SetInventoryResponse instance + * @returns PurgeProductsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.ISetInventoryResponse): google.cloud.retail.v2alpha.SetInventoryResponse; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsRequest): google.cloud.retail.v2alpha.PurgeProductsRequest; /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. - * @param message SetInventoryResponse message or plain object to encode + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.ISetInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. + * Decodes a PurgeProductsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetInventoryResponse + * @returns PurgeProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.SetInventoryResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsRequest; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetInventoryResponse + * @returns PurgeProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.SetInventoryResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsRequest; /** - * Verifies a SetInventoryResponse message. + * Verifies a PurgeProductsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetInventoryResponse + * @returns PurgeProductsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.SetInventoryResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsRequest; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. - * @param message SetInventoryResponse + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @param message PurgeProductsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.SetInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetInventoryResponse to JSON. + * Converts this PurgeProductsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SetInventoryResponse + * Gets the default type url for PurgeProductsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddFulfillmentPlacesRequest. */ - interface IAddFulfillmentPlacesRequest { - - /** AddFulfillmentPlacesRequest product */ - product?: (string|null); - - /** AddFulfillmentPlacesRequest type */ - type?: (string|null); - - /** AddFulfillmentPlacesRequest placeIds */ - placeIds?: (string[]|null); + /** Properties of a PurgeProductsResponse. */ + interface IPurgeProductsResponse { - /** AddFulfillmentPlacesRequest addTime */ - addTime?: (google.protobuf.ITimestamp|null); + /** PurgeProductsResponse purgeCount */ + purgeCount?: (number|Long|string|null); - /** AddFulfillmentPlacesRequest allowMissing */ - allowMissing?: (boolean|null); + /** PurgeProductsResponse purgeSample */ + purgeSample?: (string[]|null); } - /** Represents an AddFulfillmentPlacesRequest. */ - class AddFulfillmentPlacesRequest implements IAddFulfillmentPlacesRequest { + /** Represents a PurgeProductsResponse. */ + class PurgeProductsResponse implements IPurgeProductsResponse { /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new PurgeProductsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest); - - /** AddFulfillmentPlacesRequest product. */ - public product: string; - - /** AddFulfillmentPlacesRequest type. */ - public type: string; - - /** AddFulfillmentPlacesRequest placeIds. */ - public placeIds: string[]; + constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsResponse); - /** AddFulfillmentPlacesRequest addTime. */ - public addTime?: (google.protobuf.ITimestamp|null); + /** PurgeProductsResponse purgeCount. */ + public purgeCount: (number|Long|string); - /** AddFulfillmentPlacesRequest allowMissing. */ - public allowMissing: boolean; + /** PurgeProductsResponse purgeSample. */ + public purgeSample: string[]; /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * Creates a new PurgeProductsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesRequest instance + * @returns PurgeProductsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsResponse): google.cloud.retail.v2alpha.PurgeProductsResponse; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. - * @param message AddFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a PurgeProductsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesRequest + * @returns PurgeProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsResponse; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesRequest + * @returns PurgeProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsResponse; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies a PurgeProductsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesRequest + * @returns PurgeProductsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsResponse; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesRequest + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * @param message PurgeProductsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this PurgeProductsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddFulfillmentPlacesRequest + * Gets the default type url for PurgeProductsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddFulfillmentPlacesMetadata. */ - interface IAddFulfillmentPlacesMetadata { + /** Properties of a PurgeUserEventsRequest. */ + interface IPurgeUserEventsRequest { + + /** PurgeUserEventsRequest parent */ + parent?: (string|null); + + /** PurgeUserEventsRequest filter */ + filter?: (string|null); + + /** PurgeUserEventsRequest force */ + force?: (boolean|null); } - /** Represents an AddFulfillmentPlacesMetadata. */ - class AddFulfillmentPlacesMetadata implements IAddFulfillmentPlacesMetadata { + /** Represents a PurgeUserEventsRequest. */ + class PurgeUserEventsRequest implements IPurgeUserEventsRequest { /** - * Constructs a new AddFulfillmentPlacesMetadata. + * Constructs a new PurgeUserEventsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest); + + /** PurgeUserEventsRequest parent. */ + public parent: string; + + /** PurgeUserEventsRequest filter. */ + public filter: string; + + /** PurgeUserEventsRequest force. */ + public force: boolean; /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new PurgeUserEventsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesMetadata instance + * @returns PurgeUserEventsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. - * @param message AddFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * @param message PurgeUserEventsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesMetadata + * @returns PurgeUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesMetadata + * @returns PurgeUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Verifies an AddFulfillmentPlacesMetadata message. + * Verifies a PurgeUserEventsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesMetadata + * @returns PurgeUserEventsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsRequest; /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesMetadata + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * @param message PurgeUserEventsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesMetadata to JSON. + * Converts this PurgeUserEventsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddFulfillmentPlacesMetadata + * Gets the default type url for PurgeUserEventsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddFulfillmentPlacesResponse. */ - interface IAddFulfillmentPlacesResponse { + /** Properties of a PurgeUserEventsResponse. */ + interface IPurgeUserEventsResponse { + + /** PurgeUserEventsResponse purgedEventsCount */ + purgedEventsCount?: (number|Long|string|null); } - /** Represents an AddFulfillmentPlacesResponse. */ - class AddFulfillmentPlacesResponse implements IAddFulfillmentPlacesResponse { + /** Represents a PurgeUserEventsResponse. */ + class PurgeUserEventsResponse implements IPurgeUserEventsResponse { /** - * Constructs a new AddFulfillmentPlacesResponse. + * Constructs a new PurgeUserEventsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse); + constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse); + + /** PurgeUserEventsResponse purgedEventsCount. */ + public purgedEventsCount: (number|Long|string); /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. + * Creates a new PurgeUserEventsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AddFulfillmentPlacesResponse instance + * @returns PurgeUserEventsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. - * @param message AddFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * @param message PurgeUserEventsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddFulfillmentPlacesResponse + * @returns PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddFulfillmentPlacesResponse + * @returns PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Verifies an AddFulfillmentPlacesResponse message. + * Verifies a PurgeUserEventsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddFulfillmentPlacesResponse + * @returns PurgeUserEventsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsResponse; /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message AddFulfillmentPlacesResponse + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * @param message PurgeUserEventsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddFulfillmentPlacesResponse to JSON. + * Converts this PurgeUserEventsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddFulfillmentPlacesResponse + * Gets the default type url for PurgeUserEventsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddLocalInventoriesRequest. */ - interface IAddLocalInventoriesRequest { - - /** AddLocalInventoriesRequest product */ - product?: (string|null); - - /** AddLocalInventoriesRequest localInventories */ - localInventories?: (google.cloud.retail.v2alpha.ILocalInventory[]|null); + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { - /** AddLocalInventoriesRequest addMask */ - addMask?: (google.protobuf.IFieldMask|null); + /** LoggingConfig name */ + name?: (string|null); - /** AddLocalInventoriesRequest addTime */ - addTime?: (google.protobuf.ITimestamp|null); + /** LoggingConfig defaultLogGenerationRule */ + defaultLogGenerationRule?: (google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null); - /** AddLocalInventoriesRequest allowMissing */ - allowMissing?: (boolean|null); + /** LoggingConfig serviceLogGenerationRules */ + serviceLogGenerationRules?: (google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule[]|null); } - /** Represents an AddLocalInventoriesRequest. */ - class AddLocalInventoriesRequest implements IAddLocalInventoriesRequest { + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { /** - * Constructs a new AddLocalInventoriesRequest. + * Constructs a new LoggingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest); - - /** AddLocalInventoriesRequest product. */ - public product: string; - - /** AddLocalInventoriesRequest localInventories. */ - public localInventories: google.cloud.retail.v2alpha.ILocalInventory[]; + constructor(properties?: google.cloud.retail.v2alpha.ILoggingConfig); - /** AddLocalInventoriesRequest addMask. */ - public addMask?: (google.protobuf.IFieldMask|null); + /** LoggingConfig name. */ + public name: string; - /** AddLocalInventoriesRequest addTime. */ - public addTime?: (google.protobuf.ITimestamp|null); + /** LoggingConfig defaultLogGenerationRule. */ + public defaultLogGenerationRule?: (google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null); - /** AddLocalInventoriesRequest allowMissing. */ - public allowMissing: boolean; + /** LoggingConfig serviceLogGenerationRules. */ + public serviceLogGenerationRules: google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule[]; /** - * Creates a new AddLocalInventoriesRequest instance using the specified properties. + * Creates a new LoggingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns AddLocalInventoriesRequest instance + * @returns LoggingConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + public static create(properties?: google.cloud.retail.v2alpha.ILoggingConfig): google.cloud.retail.v2alpha.LoggingConfig; /** - * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @param message AddLocalInventoriesRequest message or plain object to encode + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. - * @param message AddLocalInventoriesRequest message or plain object to encode + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. + * Decodes a LoggingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesRequest + * @returns LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LoggingConfig; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesRequest + * @returns LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LoggingConfig; /** - * Verifies an AddLocalInventoriesRequest message. + * Verifies a LoggingConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddLocalInventoriesRequest + * @returns LoggingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LoggingConfig; /** - * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. - * @param message AddLocalInventoriesRequest + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddLocalInventoriesRequest to JSON. + * Converts this LoggingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddLocalInventoriesRequest + * Gets the default type url for LoggingConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddLocalInventoriesMetadata. */ - interface IAddLocalInventoriesMetadata { + namespace LoggingConfig { + + /** Properties of a LogGenerationRule. */ + interface ILogGenerationRule { + + /** LogGenerationRule loggingLevel */ + loggingLevel?: (google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel|keyof typeof google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel|null); + + /** LogGenerationRule infoLogSampleRate */ + infoLogSampleRate?: (number|null); + } + + /** Represents a LogGenerationRule. */ + class LogGenerationRule implements ILogGenerationRule { + + /** + * Constructs a new LogGenerationRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule); + + /** LogGenerationRule loggingLevel. */ + public loggingLevel: (google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel|keyof typeof google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel); + + /** LogGenerationRule infoLogSampleRate. */ + public infoLogSampleRate?: (number|null); + + /** LogGenerationRule _infoLogSampleRate. */ + public _infoLogSampleRate?: "infoLogSampleRate"; + + /** + * Creates a new LogGenerationRule instance using the specified properties. + * @param [properties] Properties to set + * @returns LogGenerationRule instance + */ + public static create(properties?: google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule): google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule; + + /** + * Encodes the specified LogGenerationRule message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify|verify} messages. + * @param message LogGenerationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogGenerationRule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify|verify} messages. + * @param message LogGenerationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogGenerationRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule; + + /** + * Decodes a LogGenerationRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule; + + /** + * Verifies a LogGenerationRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogGenerationRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogGenerationRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule; + + /** + * Creates a plain object from a LogGenerationRule message. Also converts values to other types if specified. + * @param message LogGenerationRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogGenerationRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogGenerationRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceLogGenerationRule. */ + interface IServiceLogGenerationRule { + + /** ServiceLogGenerationRule serviceName */ + serviceName?: (string|null); + + /** ServiceLogGenerationRule logGenerationRule */ + logGenerationRule?: (google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null); + } + + /** Represents a ServiceLogGenerationRule. */ + class ServiceLogGenerationRule implements IServiceLogGenerationRule { + + /** + * Constructs a new ServiceLogGenerationRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule); + + /** ServiceLogGenerationRule serviceName. */ + public serviceName: string; + + /** ServiceLogGenerationRule logGenerationRule. */ + public logGenerationRule?: (google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null); + + /** + * Creates a new ServiceLogGenerationRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLogGenerationRule instance + */ + public static create(properties?: google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule): google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule; + + /** + * Encodes the specified ServiceLogGenerationRule message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.verify|verify} messages. + * @param message ServiceLogGenerationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLogGenerationRule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.verify|verify} messages. + * @param message ServiceLogGenerationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLogGenerationRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule; + + /** + * Decodes a ServiceLogGenerationRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule; + + /** + * Verifies a ServiceLogGenerationRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLogGenerationRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLogGenerationRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule; + + /** + * Creates a plain object from a ServiceLogGenerationRule message. Also converts values to other types if specified. + * @param message ServiceLogGenerationRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLogGenerationRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceLogGenerationRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LoggingLevel enum. */ + enum LoggingLevel { + LOGGING_LEVEL_UNSPECIFIED = 0, + LOGGING_DISABLED = 1, + LOG_ERRORS_AND_ABOVE = 2, + LOG_WARNINGS_AND_ABOVE = 3, + LOG_ALL = 4 + } } - /** Represents an AddLocalInventoriesMetadata. */ - class AddLocalInventoriesMetadata implements IAddLocalInventoriesMetadata { + /** Properties of a Project. */ + interface IProject { + + /** Project name */ + name?: (string|null); + + /** Project enrolledSolutions */ + enrolledSolutions?: (google.cloud.retail.v2alpha.SolutionType[]|null); + } + + /** Represents a Project. */ + class Project implements IProject { /** - * Constructs a new AddLocalInventoriesMetadata. + * Constructs a new Project. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IProject); + + /** Project name. */ + public name: string; + + /** Project enrolledSolutions. */ + public enrolledSolutions: google.cloud.retail.v2alpha.SolutionType[]; /** - * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * Creates a new Project instance using the specified properties. * @param [properties] Properties to set - * @returns AddLocalInventoriesMetadata instance + * @returns Project instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IProject): google.cloud.retail.v2alpha.Project; /** - * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. - * @param message AddLocalInventoriesMetadata message or plain object to encode + * Encodes the specified Project message. Does not implicitly {@link google.cloud.retail.v2alpha.Project.verify|verify} messages. + * @param message Project message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IProject, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. - * @param message AddLocalInventoriesMetadata message or plain object to encode + * Encodes the specified Project message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Project.verify|verify} messages. + * @param message Project message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IProject, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a Project message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesMetadata + * @returns Project * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.Project; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a Project message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesMetadata + * @returns Project * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.Project; /** - * Verifies an AddLocalInventoriesMetadata message. + * Verifies a Project message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Project message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddLocalInventoriesMetadata + * @returns Project */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.Project; /** - * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. - * @param message AddLocalInventoriesMetadata + * Creates a plain object from a Project message. Also converts values to other types if specified. + * @param message Project * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.Project, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddLocalInventoriesMetadata to JSON. + * Converts this Project to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddLocalInventoriesMetadata + * Gets the default type url for Project * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AddLocalInventoriesResponse. */ - interface IAddLocalInventoriesResponse { + /** Properties of an AlertConfig. */ + interface IAlertConfig { + + /** AlertConfig name */ + name?: (string|null); + + /** AlertConfig alertPolicies */ + alertPolicies?: (google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy[]|null); } - /** Represents an AddLocalInventoriesResponse. */ - class AddLocalInventoriesResponse implements IAddLocalInventoriesResponse { + /** Represents an AlertConfig. */ + class AlertConfig implements IAlertConfig { /** - * Constructs a new AddLocalInventoriesResponse. + * Constructs a new AlertConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse); + constructor(properties?: google.cloud.retail.v2alpha.IAlertConfig); + + /** AlertConfig name. */ + public name: string; + + /** AlertConfig alertPolicies. */ + public alertPolicies: google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy[]; /** - * Creates a new AddLocalInventoriesResponse instance using the specified properties. + * Creates a new AlertConfig instance using the specified properties. * @param [properties] Properties to set - * @returns AddLocalInventoriesResponse instance + * @returns AlertConfig instance */ - public static create(properties?: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + public static create(properties?: google.cloud.retail.v2alpha.IAlertConfig): google.cloud.retail.v2alpha.AlertConfig; /** - * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. - * @param message AddLocalInventoriesResponse message or plain object to encode + * Encodes the specified AlertConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.verify|verify} messages. + * @param message AlertConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAlertConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. - * @param message AddLocalInventoriesResponse message or plain object to encode + * Encodes the specified AlertConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.verify|verify} messages. + * @param message AlertConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IAddLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAlertConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. + * Decodes an AlertConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AddLocalInventoriesResponse + * @returns AlertConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AlertConfig; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes an AlertConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AddLocalInventoriesResponse + * @returns AlertConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AlertConfig; /** - * Verifies an AddLocalInventoriesResponse message. + * Verifies an AlertConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AlertConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AddLocalInventoriesResponse + * @returns AlertConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AddLocalInventoriesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AlertConfig; /** - * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. - * @param message AddLocalInventoriesResponse + * Creates a plain object from an AlertConfig message. Also converts values to other types if specified. + * @param message AlertConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.AddLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AlertConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AddLocalInventoriesResponse to JSON. + * Converts this AlertConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AddLocalInventoriesResponse + * Gets the default type url for AlertConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveLocalInventoriesRequest. */ - interface IRemoveLocalInventoriesRequest { + namespace AlertConfig { - /** RemoveLocalInventoriesRequest product */ - product?: (string|null); + /** Properties of an AlertPolicy. */ + interface IAlertPolicy { - /** RemoveLocalInventoriesRequest placeIds */ - placeIds?: (string[]|null); + /** AlertPolicy alertGroup */ + alertGroup?: (string|null); - /** RemoveLocalInventoriesRequest removeTime */ - removeTime?: (google.protobuf.ITimestamp|null); + /** AlertPolicy enrollStatus */ + enrollStatus?: (google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus|keyof typeof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus|null); - /** RemoveLocalInventoriesRequest allowMissing */ - allowMissing?: (boolean|null); + /** AlertPolicy recipients */ + recipients?: (google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient[]|null); + } + + /** Represents an AlertPolicy. */ + class AlertPolicy implements IAlertPolicy { + + /** + * Constructs a new AlertPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy); + + /** AlertPolicy alertGroup. */ + public alertGroup: string; + + /** AlertPolicy enrollStatus. */ + public enrollStatus: (google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus|keyof typeof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus); + + /** AlertPolicy recipients. */ + public recipients: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient[]; + + /** + * Creates a new AlertPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AlertPolicy instance + */ + public static create(properties?: google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy; + + /** + * Encodes the specified AlertPolicy message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.verify|verify} messages. + * @param message AlertPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.verify|verify} messages. + * @param message AlertPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AlertPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AlertPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy; + + /** + * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AlertPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy; + + /** + * Verifies an AlertPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AlertPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AlertPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy; + + /** + * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. + * @param message AlertPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AlertPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AlertPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AlertPolicy { + + /** Properties of a Recipient. */ + interface IRecipient { + + /** Recipient emailAddress */ + emailAddress?: (string|null); + } + + /** Represents a Recipient. */ + class Recipient implements IRecipient { + + /** + * Constructs a new Recipient. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient); + + /** Recipient emailAddress. */ + public emailAddress: string; + + /** + * Creates a new Recipient instance using the specified properties. + * @param [properties] Properties to set + * @returns Recipient instance + */ + public static create(properties?: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient; + + /** + * Encodes the specified Recipient message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.verify|verify} messages. + * @param message Recipient message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Recipient message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.verify|verify} messages. + * @param message Recipient message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Recipient message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Recipient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient; + + /** + * Decodes a Recipient message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Recipient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient; + + /** + * Verifies a Recipient message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Recipient message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Recipient + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient; + + /** + * Creates a plain object from a Recipient message. Also converts values to other types if specified. + * @param message Recipient + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Recipient to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Recipient + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** EnrollStatus enum. */ + enum EnrollStatus { + ENROLL_STATUS_UNSPECIFIED = 0, + ENROLLED = 1, + DECLINED = 2 + } + } } - /** Represents a RemoveLocalInventoriesRequest. */ - class RemoveLocalInventoriesRequest implements IRemoveLocalInventoriesRequest { + /** Represents a ProjectService */ + class ProjectService extends $protobuf.rpc.Service { /** - * Constructs a new RemoveLocalInventoriesRequest. - * @param [properties] Properties to set + * Constructs a new ProjectService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** RemoveLocalInventoriesRequest product. */ - public product: string; + /** + * Creates new ProjectService 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): ProjectService; - /** RemoveLocalInventoriesRequest placeIds. */ - public placeIds: string[]; + /** + * Calls GetProject. + * @param request GetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Project + */ + public getProject(request: google.cloud.retail.v2alpha.IGetProjectRequest, callback: google.cloud.retail.v2alpha.ProjectService.GetProjectCallback): void; - /** RemoveLocalInventoriesRequest removeTime. */ - public removeTime?: (google.protobuf.ITimestamp|null); + /** + * Calls GetProject. + * @param request GetProjectRequest message or plain object + * @returns Promise + */ + public getProject(request: google.cloud.retail.v2alpha.IGetProjectRequest): Promise; + + /** + * Calls AcceptTerms. + * @param request AcceptTermsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Project + */ + public acceptTerms(request: google.cloud.retail.v2alpha.IAcceptTermsRequest, callback: google.cloud.retail.v2alpha.ProjectService.AcceptTermsCallback): void; + + /** + * Calls AcceptTerms. + * @param request AcceptTermsRequest message or plain object + * @returns Promise + */ + public acceptTerms(request: google.cloud.retail.v2alpha.IAcceptTermsRequest): Promise; + + /** + * Calls EnrollSolution. + * @param request EnrollSolutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enrollSolution(request: google.cloud.retail.v2alpha.IEnrollSolutionRequest, callback: google.cloud.retail.v2alpha.ProjectService.EnrollSolutionCallback): void; + + /** + * Calls EnrollSolution. + * @param request EnrollSolutionRequest message or plain object + * @returns Promise + */ + public enrollSolution(request: google.cloud.retail.v2alpha.IEnrollSolutionRequest): Promise; + + /** + * Calls ListEnrolledSolutions. + * @param request ListEnrolledSolutionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnrolledSolutionsResponse + */ + public listEnrolledSolutions(request: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, callback: google.cloud.retail.v2alpha.ProjectService.ListEnrolledSolutionsCallback): void; + + /** + * Calls ListEnrolledSolutions. + * @param request ListEnrolledSolutionsRequest message or plain object + * @returns Promise + */ + public listEnrolledSolutions(request: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest): Promise; + + /** + * Calls GetLoggingConfig. + * @param request GetLoggingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LoggingConfig + */ + public getLoggingConfig(request: google.cloud.retail.v2alpha.IGetLoggingConfigRequest, callback: google.cloud.retail.v2alpha.ProjectService.GetLoggingConfigCallback): void; + + /** + * Calls GetLoggingConfig. + * @param request GetLoggingConfigRequest message or plain object + * @returns Promise + */ + public getLoggingConfig(request: google.cloud.retail.v2alpha.IGetLoggingConfigRequest): Promise; + + /** + * Calls UpdateLoggingConfig. + * @param request UpdateLoggingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LoggingConfig + */ + public updateLoggingConfig(request: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, callback: google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfigCallback): void; + + /** + * Calls UpdateLoggingConfig. + * @param request UpdateLoggingConfigRequest message or plain object + * @returns Promise + */ + public updateLoggingConfig(request: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest): Promise; + + /** + * Calls GetAlertConfig. + * @param request GetAlertConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AlertConfig + */ + public getAlertConfig(request: google.cloud.retail.v2alpha.IGetAlertConfigRequest, callback: google.cloud.retail.v2alpha.ProjectService.GetAlertConfigCallback): void; - /** RemoveLocalInventoriesRequest allowMissing. */ - public allowMissing: boolean; + /** + * Calls GetAlertConfig. + * @param request GetAlertConfigRequest message or plain object + * @returns Promise + */ + public getAlertConfig(request: google.cloud.retail.v2alpha.IGetAlertConfigRequest): Promise; /** - * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RemoveLocalInventoriesRequest instance + * Calls UpdateAlertConfig. + * @param request UpdateAlertConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AlertConfig */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + public updateAlertConfig(request: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, callback: google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfigCallback): void; /** - * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. - * @param message RemoveLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls UpdateAlertConfig. + * @param request UpdateAlertConfigRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public updateAlertConfig(request: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest): Promise; + } + + namespace ProjectService { /** - * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. - * @param message RemoveLocalInventoriesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getProject}. + * @param error Error, if any + * @param [response] Project */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetProjectCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Project) => void; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|acceptTerms}. + * @param error Error, if any + * @param [response] Project */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + type AcceptTermsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.Project) => void; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|enrollSolution}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + type EnrollSolutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies a RemoveLocalInventoriesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|listEnrolledSolutions}. + * @param error Error, if any + * @param [response] ListEnrolledSolutionsResponse */ - public static verify(message: { [k: string]: any }): (string|null); + type ListEnrolledSolutionsCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse) => void; /** - * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RemoveLocalInventoriesRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getLoggingConfig}. + * @param error Error, if any + * @param [response] LoggingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest; + type GetLoggingConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.LoggingConfig) => void; /** - * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|updateLoggingConfig}. + * @param error Error, if any + * @param [response] LoggingConfig */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateLoggingConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.LoggingConfig) => void; /** - * Converts this RemoveLocalInventoriesRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getAlertConfig}. + * @param error Error, if any + * @param [response] AlertConfig */ - public toJSON(): { [k: string]: any }; + type GetAlertConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AlertConfig) => void; /** - * Gets the default type url for RemoveLocalInventoriesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|updateAlertConfig}. + * @param error Error, if any + * @param [response] AlertConfig */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type UpdateAlertConfigCallback = (error: (Error|null), response?: google.cloud.retail.v2alpha.AlertConfig) => void; } - /** Properties of a RemoveLocalInventoriesMetadata. */ - interface IRemoveLocalInventoriesMetadata { + /** Properties of a GetProjectRequest. */ + interface IGetProjectRequest { + + /** GetProjectRequest name */ + name?: (string|null); } - /** Represents a RemoveLocalInventoriesMetadata. */ - class RemoveLocalInventoriesMetadata implements IRemoveLocalInventoriesMetadata { + /** Represents a GetProjectRequest. */ + class GetProjectRequest implements IGetProjectRequest { /** - * Constructs a new RemoveLocalInventoriesMetadata. + * Constructs a new GetProjectRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IGetProjectRequest); + + /** GetProjectRequest name. */ + public name: string; /** - * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. + * Creates a new GetProjectRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveLocalInventoriesMetadata instance + * @returns GetProjectRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IGetProjectRequest): google.cloud.retail.v2alpha.GetProjectRequest; /** - * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. - * @param message RemoveLocalInventoriesMetadata message or plain object to encode + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProjectRequest.verify|verify} messages. + * @param message GetProjectRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. - * @param message RemoveLocalInventoriesMetadata message or plain object to encode + * Encodes the specified GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProjectRequest.verify|verify} messages. + * @param message GetProjectRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a GetProjectRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesMetadata + * @returns GetProjectRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetProjectRequest; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetProjectRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesMetadata + * @returns GetProjectRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetProjectRequest; /** - * Verifies a RemoveLocalInventoriesMetadata message. + * Verifies a GetProjectRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetProjectRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveLocalInventoriesMetadata + * @returns GetProjectRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetProjectRequest; /** - * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesMetadata + * Creates a plain object from a GetProjectRequest message. Also converts values to other types if specified. + * @param message GetProjectRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveLocalInventoriesMetadata to JSON. + * Converts this GetProjectRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveLocalInventoriesMetadata + * Gets the default type url for GetProjectRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveLocalInventoriesResponse. */ - interface IRemoveLocalInventoriesResponse { + /** Properties of an AcceptTermsRequest. */ + interface IAcceptTermsRequest { + + /** AcceptTermsRequest project */ + project?: (string|null); } - /** Represents a RemoveLocalInventoriesResponse. */ - class RemoveLocalInventoriesResponse implements IRemoveLocalInventoriesResponse { + /** Represents an AcceptTermsRequest. */ + class AcceptTermsRequest implements IAcceptTermsRequest { /** - * Constructs a new RemoveLocalInventoriesResponse. + * Constructs a new AcceptTermsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse); + constructor(properties?: google.cloud.retail.v2alpha.IAcceptTermsRequest); + + /** AcceptTermsRequest project. */ + public project: string; /** - * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. + * Creates a new AcceptTermsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveLocalInventoriesResponse instance + * @returns AcceptTermsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + public static create(properties?: google.cloud.retail.v2alpha.IAcceptTermsRequest): google.cloud.retail.v2alpha.AcceptTermsRequest; /** - * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. - * @param message RemoveLocalInventoriesResponse message or plain object to encode + * Encodes the specified AcceptTermsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AcceptTermsRequest.verify|verify} messages. + * @param message AcceptTermsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IAcceptTermsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. - * @param message RemoveLocalInventoriesResponse message or plain object to encode + * Encodes the specified AcceptTermsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AcceptTermsRequest.verify|verify} messages. + * @param message AcceptTermsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IAcceptTermsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. + * Decodes an AcceptTermsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveLocalInventoriesResponse + * @returns AcceptTermsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.AcceptTermsRequest; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes an AcceptTermsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveLocalInventoriesResponse + * @returns AcceptTermsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.AcceptTermsRequest; /** - * Verifies a RemoveLocalInventoriesResponse message. + * Verifies an AcceptTermsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AcceptTermsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveLocalInventoriesResponse + * @returns AcceptTermsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.AcceptTermsRequest; /** - * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. - * @param message RemoveLocalInventoriesResponse + * Creates a plain object from an AcceptTermsRequest message. Also converts values to other types if specified. + * @param message AcceptTermsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.AcceptTermsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveLocalInventoriesResponse to JSON. + * Converts this AcceptTermsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveLocalInventoriesResponse + * Gets the default type url for AcceptTermsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveFulfillmentPlacesRequest. */ - interface IRemoveFulfillmentPlacesRequest { - - /** RemoveFulfillmentPlacesRequest product */ - product?: (string|null); - - /** RemoveFulfillmentPlacesRequest type */ - type?: (string|null); - - /** RemoveFulfillmentPlacesRequest placeIds */ - placeIds?: (string[]|null); + /** Properties of an EnrollSolutionRequest. */ + interface IEnrollSolutionRequest { - /** RemoveFulfillmentPlacesRequest removeTime */ - removeTime?: (google.protobuf.ITimestamp|null); + /** EnrollSolutionRequest project */ + project?: (string|null); - /** RemoveFulfillmentPlacesRequest allowMissing */ - allowMissing?: (boolean|null); + /** EnrollSolutionRequest solution */ + solution?: (google.cloud.retail.v2alpha.SolutionType|keyof typeof google.cloud.retail.v2alpha.SolutionType|null); } - /** Represents a RemoveFulfillmentPlacesRequest. */ - class RemoveFulfillmentPlacesRequest implements IRemoveFulfillmentPlacesRequest { + /** Represents an EnrollSolutionRequest. */ + class EnrollSolutionRequest implements IEnrollSolutionRequest { /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new EnrollSolutionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest); - - /** RemoveFulfillmentPlacesRequest product. */ - public product: string; + constructor(properties?: google.cloud.retail.v2alpha.IEnrollSolutionRequest); - /** RemoveFulfillmentPlacesRequest type. */ - public type: string; - - /** RemoveFulfillmentPlacesRequest placeIds. */ - public placeIds: string[]; - - /** RemoveFulfillmentPlacesRequest removeTime. */ - public removeTime?: (google.protobuf.ITimestamp|null); + /** EnrollSolutionRequest project. */ + public project: string; - /** RemoveFulfillmentPlacesRequest allowMissing. */ - public allowMissing: boolean; + /** EnrollSolutionRequest solution. */ + public solution: (google.cloud.retail.v2alpha.SolutionType|keyof typeof google.cloud.retail.v2alpha.SolutionType); /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new EnrollSolutionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesRequest instance + * @returns EnrollSolutionRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static create(properties?: google.cloud.retail.v2alpha.IEnrollSolutionRequest): google.cloud.retail.v2alpha.EnrollSolutionRequest; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified EnrollSolutionRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionRequest.verify|verify} messages. + * @param message EnrollSolutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IEnrollSolutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. - * @param message RemoveFulfillmentPlacesRequest message or plain object to encode + * Encodes the specified EnrollSolutionRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionRequest.verify|verify} messages. + * @param message EnrollSolutionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IEnrollSolutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an EnrollSolutionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesRequest + * @returns EnrollSolutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.EnrollSolutionRequest; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesRequest + * @returns EnrollSolutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.EnrollSolutionRequest; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies an EnrollSolutionRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesRequest + * @returns EnrollSolutionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.EnrollSolutionRequest; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesRequest + * Creates a plain object from an EnrollSolutionRequest message. Also converts values to other types if specified. + * @param message EnrollSolutionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.EnrollSolutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this EnrollSolutionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveFulfillmentPlacesRequest + * Gets the default type url for EnrollSolutionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveFulfillmentPlacesMetadata. */ - interface IRemoveFulfillmentPlacesMetadata { + /** Properties of an EnrollSolutionResponse. */ + interface IEnrollSolutionResponse { + + /** EnrollSolutionResponse enrolledSolution */ + enrolledSolution?: (google.cloud.retail.v2alpha.SolutionType|keyof typeof google.cloud.retail.v2alpha.SolutionType|null); } - /** Represents a RemoveFulfillmentPlacesMetadata. */ - class RemoveFulfillmentPlacesMetadata implements IRemoveFulfillmentPlacesMetadata { + /** Represents an EnrollSolutionResponse. */ + class EnrollSolutionResponse implements IEnrollSolutionResponse { /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new EnrollSolutionResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IEnrollSolutionResponse); + + /** EnrollSolutionResponse enrolledSolution. */ + public enrolledSolution: (google.cloud.retail.v2alpha.SolutionType|keyof typeof google.cloud.retail.v2alpha.SolutionType); /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * Creates a new EnrollSolutionResponse instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesMetadata instance + * @returns EnrollSolutionResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IEnrollSolutionResponse): google.cloud.retail.v2alpha.EnrollSolutionResponse; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified EnrollSolutionResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionResponse.verify|verify} messages. + * @param message EnrollSolutionResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IEnrollSolutionResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. - * @param message RemoveFulfillmentPlacesMetadata message or plain object to encode + * Encodes the specified EnrollSolutionResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionResponse.verify|verify} messages. + * @param message EnrollSolutionResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IEnrollSolutionResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes an EnrollSolutionResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesMetadata + * @returns EnrollSolutionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.EnrollSolutionResponse; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesMetadata + * @returns EnrollSolutionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.EnrollSolutionResponse; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies an EnrollSolutionResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesMetadata + * @returns EnrollSolutionResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.EnrollSolutionResponse; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesMetadata + * Creates a plain object from an EnrollSolutionResponse message. Also converts values to other types if specified. + * @param message EnrollSolutionResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.EnrollSolutionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this EnrollSolutionResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveFulfillmentPlacesMetadata + * Gets the default type url for EnrollSolutionResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RemoveFulfillmentPlacesResponse. */ - interface IRemoveFulfillmentPlacesResponse { + /** Properties of an EnrollSolutionMetadata. */ + interface IEnrollSolutionMetadata { } - /** Represents a RemoveFulfillmentPlacesResponse. */ - class RemoveFulfillmentPlacesResponse implements IRemoveFulfillmentPlacesResponse { + /** Represents an EnrollSolutionMetadata. */ + class EnrollSolutionMetadata implements IEnrollSolutionMetadata { /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new EnrollSolutionMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse); + constructor(properties?: google.cloud.retail.v2alpha.IEnrollSolutionMetadata); /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new EnrollSolutionMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RemoveFulfillmentPlacesResponse instance + * @returns EnrollSolutionMetadata instance */ - public static create(properties?: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static create(properties?: google.cloud.retail.v2alpha.IEnrollSolutionMetadata): google.cloud.retail.v2alpha.EnrollSolutionMetadata; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified EnrollSolutionMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionMetadata.verify|verify} messages. + * @param message EnrollSolutionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IEnrollSolutionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. - * @param message RemoveFulfillmentPlacesResponse message or plain object to encode + * Encodes the specified EnrollSolutionMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionMetadata.verify|verify} messages. + * @param message EnrollSolutionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IEnrollSolutionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes an EnrollSolutionMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RemoveFulfillmentPlacesResponse + * @returns EnrollSolutionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.EnrollSolutionMetadata; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RemoveFulfillmentPlacesResponse + * @returns EnrollSolutionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.EnrollSolutionMetadata; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies an EnrollSolutionMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RemoveFulfillmentPlacesResponse + * @returns EnrollSolutionMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.EnrollSolutionMetadata; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. - * @param message RemoveFulfillmentPlacesResponse + * Creates a plain object from an EnrollSolutionMetadata message. Also converts values to other types if specified. + * @param message EnrollSolutionMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.EnrollSolutionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this EnrollSolutionMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RemoveFulfillmentPlacesResponse + * Gets the default type url for EnrollSolutionMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeMetadata. */ - interface IPurgeMetadata { + /** Properties of a ListEnrolledSolutionsRequest. */ + interface IListEnrolledSolutionsRequest { + + /** ListEnrolledSolutionsRequest parent */ + parent?: (string|null); } - /** Represents a PurgeMetadata. */ - class PurgeMetadata implements IPurgeMetadata { + /** Represents a ListEnrolledSolutionsRequest. */ + class ListEnrolledSolutionsRequest implements IListEnrolledSolutionsRequest { /** - * Constructs a new PurgeMetadata. + * Constructs a new ListEnrolledSolutionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeMetadata); + constructor(properties?: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest); + + /** ListEnrolledSolutionsRequest parent. */ + public parent: string; /** - * Creates a new PurgeMetadata instance using the specified properties. + * Creates a new ListEnrolledSolutionsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeMetadata instance + * @returns ListEnrolledSolutionsRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeMetadata): google.cloud.retail.v2alpha.PurgeMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest): google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified ListEnrolledSolutionsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest.verify|verify} messages. + * @param message ListEnrolledSolutionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. - * @param message PurgeMetadata message or plain object to encode + * Encodes the specified ListEnrolledSolutionsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest.verify|verify} messages. + * @param message ListEnrolledSolutionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a ListEnrolledSolutionsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeMetadata + * @returns ListEnrolledSolutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListEnrolledSolutionsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeMetadata + * @returns ListEnrolledSolutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest; /** - * Verifies a PurgeMetadata message. + * Verifies a ListEnrolledSolutionsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnrolledSolutionsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeMetadata + * @returns ListEnrolledSolutionsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. - * @param message PurgeMetadata + * Creates a plain object from a ListEnrolledSolutionsRequest message. Also converts values to other types if specified. + * @param message ListEnrolledSolutionsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeMetadata to JSON. + * Converts this ListEnrolledSolutionsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeMetadata + * Gets the default type url for ListEnrolledSolutionsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeProductsMetadata. */ - interface IPurgeProductsMetadata { - - /** PurgeProductsMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** PurgeProductsMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** PurgeProductsMetadata successCount */ - successCount?: (number|Long|string|null); + /** Properties of a ListEnrolledSolutionsResponse. */ + interface IListEnrolledSolutionsResponse { - /** PurgeProductsMetadata failureCount */ - failureCount?: (number|Long|string|null); + /** ListEnrolledSolutionsResponse enrolledSolutions */ + enrolledSolutions?: (google.cloud.retail.v2alpha.SolutionType[]|null); } - /** Represents a PurgeProductsMetadata. */ - class PurgeProductsMetadata implements IPurgeProductsMetadata { + /** Represents a ListEnrolledSolutionsResponse. */ + class ListEnrolledSolutionsResponse implements IListEnrolledSolutionsResponse { /** - * Constructs a new PurgeProductsMetadata. + * Constructs a new ListEnrolledSolutionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsMetadata); - - /** PurgeProductsMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** PurgeProductsMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** PurgeProductsMetadata successCount. */ - public successCount: (number|Long|string); + constructor(properties?: google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse); - /** PurgeProductsMetadata failureCount. */ - public failureCount: (number|Long|string); + /** ListEnrolledSolutionsResponse enrolledSolutions. */ + public enrolledSolutions: google.cloud.retail.v2alpha.SolutionType[]; /** - * Creates a new PurgeProductsMetadata instance using the specified properties. + * Creates a new ListEnrolledSolutionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeProductsMetadata instance + * @returns ListEnrolledSolutionsResponse instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsMetadata): google.cloud.retail.v2alpha.PurgeProductsMetadata; + public static create(properties?: google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse): google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse; /** - * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. - * @param message PurgeProductsMetadata message or plain object to encode + * Encodes the specified ListEnrolledSolutionsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse.verify|verify} messages. + * @param message ListEnrolledSolutionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. - * @param message PurgeProductsMetadata message or plain object to encode + * Encodes the specified ListEnrolledSolutionsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse.verify|verify} messages. + * @param message ListEnrolledSolutionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * Decodes a ListEnrolledSolutionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeProductsMetadata + * @returns ListEnrolledSolutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse; /** - * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListEnrolledSolutionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeProductsMetadata + * @returns ListEnrolledSolutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse; /** - * Verifies a PurgeProductsMetadata message. + * Verifies a ListEnrolledSolutionsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnrolledSolutionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeProductsMetadata + * @returns ListEnrolledSolutionsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse; /** - * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. - * @param message PurgeProductsMetadata + * Creates a plain object from a ListEnrolledSolutionsResponse message. Also converts values to other types if specified. + * @param message ListEnrolledSolutionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeProductsMetadata to JSON. + * Converts this ListEnrolledSolutionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeProductsMetadata + * Gets the default type url for ListEnrolledSolutionsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeProductsRequest. */ - interface IPurgeProductsRequest { - - /** PurgeProductsRequest parent */ - parent?: (string|null); - - /** PurgeProductsRequest filter */ - filter?: (string|null); + /** Properties of a GetLoggingConfigRequest. */ + interface IGetLoggingConfigRequest { - /** PurgeProductsRequest force */ - force?: (boolean|null); + /** GetLoggingConfigRequest name */ + name?: (string|null); } - /** Represents a PurgeProductsRequest. */ - class PurgeProductsRequest implements IPurgeProductsRequest { + /** Represents a GetLoggingConfigRequest. */ + class GetLoggingConfigRequest implements IGetLoggingConfigRequest { /** - * Constructs a new PurgeProductsRequest. + * Constructs a new GetLoggingConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsRequest); - - /** PurgeProductsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.retail.v2alpha.IGetLoggingConfigRequest); - /** PurgeProductsRequest filter. */ - public filter: string; - - /** PurgeProductsRequest force. */ - public force: boolean; + /** GetLoggingConfigRequest name. */ + public name: string; /** - * Creates a new PurgeProductsRequest instance using the specified properties. + * Creates a new GetLoggingConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeProductsRequest instance + * @returns GetLoggingConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsRequest): google.cloud.retail.v2alpha.PurgeProductsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IGetLoggingConfigRequest): google.cloud.retail.v2alpha.GetLoggingConfigRequest; /** - * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. - * @param message PurgeProductsRequest message or plain object to encode + * Encodes the specified GetLoggingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetLoggingConfigRequest.verify|verify} messages. + * @param message GetLoggingConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetLoggingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. - * @param message PurgeProductsRequest message or plain object to encode + * Encodes the specified GetLoggingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetLoggingConfigRequest.verify|verify} messages. + * @param message GetLoggingConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetLoggingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * Decodes a GetLoggingConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeProductsRequest + * @returns GetLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetLoggingConfigRequest; /** - * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetLoggingConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeProductsRequest + * @returns GetLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetLoggingConfigRequest; /** - * Verifies a PurgeProductsRequest message. + * Verifies a GetLoggingConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetLoggingConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeProductsRequest + * @returns GetLoggingConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetLoggingConfigRequest; /** - * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. - * @param message PurgeProductsRequest + * Creates a plain object from a GetLoggingConfigRequest message. Also converts values to other types if specified. + * @param message GetLoggingConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetLoggingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeProductsRequest to JSON. + * Converts this GetLoggingConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeProductsRequest + * Gets the default type url for GetLoggingConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeProductsResponse. */ - interface IPurgeProductsResponse { + /** Properties of an UpdateLoggingConfigRequest. */ + interface IUpdateLoggingConfigRequest { - /** PurgeProductsResponse purgeCount */ - purgeCount?: (number|Long|string|null); + /** UpdateLoggingConfigRequest loggingConfig */ + loggingConfig?: (google.cloud.retail.v2alpha.ILoggingConfig|null); - /** PurgeProductsResponse purgeSample */ - purgeSample?: (string[]|null); + /** UpdateLoggingConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a PurgeProductsResponse. */ - class PurgeProductsResponse implements IPurgeProductsResponse { + /** Represents an UpdateLoggingConfigRequest. */ + class UpdateLoggingConfigRequest implements IUpdateLoggingConfigRequest { /** - * Constructs a new PurgeProductsResponse. + * Constructs a new UpdateLoggingConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeProductsResponse); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest); - /** PurgeProductsResponse purgeCount. */ - public purgeCount: (number|Long|string); + /** UpdateLoggingConfigRequest loggingConfig. */ + public loggingConfig?: (google.cloud.retail.v2alpha.ILoggingConfig|null); - /** PurgeProductsResponse purgeSample. */ - public purgeSample: string[]; + /** UpdateLoggingConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new PurgeProductsResponse instance using the specified properties. + * Creates a new UpdateLoggingConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeProductsResponse instance + * @returns UpdateLoggingConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeProductsResponse): google.cloud.retail.v2alpha.PurgeProductsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest): google.cloud.retail.v2alpha.UpdateLoggingConfigRequest; /** - * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. - * @param message PurgeProductsResponse message or plain object to encode + * Encodes the specified UpdateLoggingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.verify|verify} messages. + * @param message UpdateLoggingConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. - * @param message PurgeProductsResponse message or plain object to encode + * Encodes the specified UpdateLoggingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.verify|verify} messages. + * @param message UpdateLoggingConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * Decodes an UpdateLoggingConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeProductsResponse + * @returns UpdateLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeProductsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateLoggingConfigRequest; /** - * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateLoggingConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeProductsResponse + * @returns UpdateLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeProductsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateLoggingConfigRequest; /** - * Verifies a PurgeProductsResponse message. + * Verifies an UpdateLoggingConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateLoggingConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeProductsResponse + * @returns UpdateLoggingConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeProductsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateLoggingConfigRequest; /** - * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. - * @param message PurgeProductsResponse + * Creates a plain object from an UpdateLoggingConfigRequest message. Also converts values to other types if specified. + * @param message UpdateLoggingConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateLoggingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeProductsResponse to JSON. + * Converts this UpdateLoggingConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeProductsResponse + * Gets the default type url for UpdateLoggingConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeUserEventsRequest. */ - interface IPurgeUserEventsRequest { - - /** PurgeUserEventsRequest parent */ - parent?: (string|null); - - /** PurgeUserEventsRequest filter */ - filter?: (string|null); + /** Properties of a GetAlertConfigRequest. */ + interface IGetAlertConfigRequest { - /** PurgeUserEventsRequest force */ - force?: (boolean|null); + /** GetAlertConfigRequest name */ + name?: (string|null); } - /** Represents a PurgeUserEventsRequest. */ - class PurgeUserEventsRequest implements IPurgeUserEventsRequest { + /** Represents a GetAlertConfigRequest. */ + class GetAlertConfigRequest implements IGetAlertConfigRequest { /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new GetAlertConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest); - - /** PurgeUserEventsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.retail.v2alpha.IGetAlertConfigRequest); - /** PurgeUserEventsRequest filter. */ - public filter: string; - - /** PurgeUserEventsRequest force. */ - public force: boolean; + /** GetAlertConfigRequest name. */ + public name: string; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new GetAlertConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsRequest instance + * @returns GetAlertConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsRequest): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static create(properties?: google.cloud.retail.v2alpha.IGetAlertConfigRequest): google.cloud.retail.v2alpha.GetAlertConfigRequest; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified GetAlertConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAlertConfigRequest.verify|verify} messages. + * @param message GetAlertConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IGetAlertConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. - * @param message PurgeUserEventsRequest message or plain object to encode + * Encodes the specified GetAlertConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAlertConfigRequest.verify|verify} messages. + * @param message GetAlertConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IGetAlertConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a GetAlertConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsRequest + * @returns GetAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.GetAlertConfigRequest; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetAlertConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsRequest + * @returns GetAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.GetAlertConfigRequest; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a GetAlertConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetAlertConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsRequest + * @returns GetAlertConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.GetAlertConfigRequest; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. - * @param message PurgeUserEventsRequest + * Creates a plain object from a GetAlertConfigRequest message. Also converts values to other types if specified. + * @param message GetAlertConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.GetAlertConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this GetAlertConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeUserEventsRequest + * Gets the default type url for GetAlertConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PurgeUserEventsResponse. */ - interface IPurgeUserEventsResponse { + /** Properties of an UpdateAlertConfigRequest. */ + interface IUpdateAlertConfigRequest { - /** PurgeUserEventsResponse purgedEventsCount */ - purgedEventsCount?: (number|Long|string|null); + /** UpdateAlertConfigRequest alertConfig */ + alertConfig?: (google.cloud.retail.v2alpha.IAlertConfig|null); + + /** UpdateAlertConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a PurgeUserEventsResponse. */ - class PurgeUserEventsResponse implements IPurgeUserEventsResponse { + /** Represents an UpdateAlertConfigRequest. */ + class UpdateAlertConfigRequest implements IUpdateAlertConfigRequest { /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new UpdateAlertConfigRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse); + constructor(properties?: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest); - /** PurgeUserEventsResponse purgedEventsCount. */ - public purgedEventsCount: (number|Long|string); + /** UpdateAlertConfigRequest alertConfig. */ + public alertConfig?: (google.cloud.retail.v2alpha.IAlertConfig|null); + + /** UpdateAlertConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * Creates a new UpdateAlertConfigRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PurgeUserEventsResponse instance + * @returns UpdateAlertConfigRequest instance */ - public static create(properties?: google.cloud.retail.v2alpha.IPurgeUserEventsResponse): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static create(properties?: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest): google.cloud.retail.v2alpha.UpdateAlertConfigRequest; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified UpdateAlertConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAlertConfigRequest.verify|verify} messages. + * @param message UpdateAlertConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. - * @param message PurgeUserEventsResponse message or plain object to encode + * Encodes the specified UpdateAlertConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAlertConfigRequest.verify|verify} messages. + * @param message UpdateAlertConfigRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.retail.v2alpha.IPurgeUserEventsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes an UpdateAlertConfigRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PurgeUserEventsResponse + * @returns UpdateAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.UpdateAlertConfigRequest; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateAlertConfigRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PurgeUserEventsResponse + * @returns UpdateAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.UpdateAlertConfigRequest; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies an UpdateAlertConfigRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAlertConfigRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PurgeUserEventsResponse + * @returns UpdateAlertConfigRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.PurgeUserEventsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2alpha.UpdateAlertConfigRequest; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. - * @param message PurgeUserEventsResponse + * Creates a plain object from an UpdateAlertConfigRequest message. Also converts values to other types if specified. + * @param message UpdateAlertConfigRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.retail.v2alpha.PurgeUserEventsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.retail.v2alpha.UpdateAlertConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this UpdateAlertConfigRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PurgeUserEventsResponse + * Gets the default type url for UpdateAlertConfigRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -38212,6 +43484,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel */ enableCategoryFilterLevel?: (string|null); + /** ServingConfig ignoreRecsDenylist */ + ignoreRecsDenylist?: (boolean|null); + /** ServingConfig personalizationSpec */ personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); @@ -38279,6 +43554,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel. */ public enableCategoryFilterLevel: string; + /** ServingConfig ignoreRecsDenylist. */ + public ignoreRecsDenylist: boolean; + /** ServingConfig personalizationSpec. */ public personalizationSpec?: (google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null); @@ -41475,6 +46753,9 @@ export namespace google { /** CatalogAttribute retrievableOption */ retrievableOption?: (google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption|null); + + /** CatalogAttribute facetConfig */ + facetConfig?: (google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig|null); } /** Represents a CatalogAttribute. */ @@ -41513,6 +46794,9 @@ export namespace google { /** CatalogAttribute retrievableOption. */ public retrievableOption: (google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption|keyof typeof google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption); + /** CatalogAttribute facetConfig. */ + public facetConfig?: (google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig|null); + /** * Creates a new CatalogAttribute instance using the specified properties. * @param [properties] Properties to set @@ -41593,6 +46877,542 @@ export namespace google { namespace CatalogAttribute { + /** Properties of a FacetConfig. */ + interface IFacetConfig { + + /** FacetConfig facetIntervals */ + facetIntervals?: (google.cloud.retail.v2beta.IInterval[]|null); + + /** FacetConfig ignoredFacetValues */ + ignoredFacetValues?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]|null); + + /** FacetConfig mergedFacetValues */ + mergedFacetValues?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue[]|null); + + /** FacetConfig mergedFacet */ + mergedFacet?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig */ + rerankConfig?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig|null); + } + + /** Represents a FacetConfig. */ + class FacetConfig implements IFacetConfig { + + /** + * Constructs a new FacetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig); + + /** FacetConfig facetIntervals. */ + public facetIntervals: google.cloud.retail.v2beta.IInterval[]; + + /** FacetConfig ignoredFacetValues. */ + public ignoredFacetValues: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues[]; + + /** FacetConfig mergedFacetValues. */ + public mergedFacetValues: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue[]; + + /** FacetConfig mergedFacet. */ + public mergedFacet?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet|null); + + /** FacetConfig rerankConfig. */ + public rerankConfig?: (google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig|null); + + /** + * Creates a new FacetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig; + + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.verify|verify} messages. + * @param message FacetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig; + + /** + * Verifies a FacetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig; + + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @param message FacetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FacetConfig { + + /** Properties of an IgnoredFacetValues. */ + interface IIgnoredFacetValues { + + /** IgnoredFacetValues values */ + values?: (string[]|null); + + /** IgnoredFacetValues startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an IgnoredFacetValues. */ + class IgnoredFacetValues implements IIgnoredFacetValues { + + /** + * Constructs a new IgnoredFacetValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues); + + /** IgnoredFacetValues values. */ + public values: string[]; + + /** IgnoredFacetValues startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** IgnoredFacetValues endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @param [properties] Properties to set + * @returns IgnoredFacetValues instance + */ + public static create(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @param message IgnoredFacetValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Verifies an IgnoredFacetValues message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IgnoredFacetValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues; + + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @param message IgnoredFacetValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IgnoredFacetValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IgnoredFacetValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacetValue. */ + interface IMergedFacetValue { + + /** MergedFacetValue values */ + values?: (string[]|null); + + /** MergedFacetValue mergedValue */ + mergedValue?: (string|null); + } + + /** Represents a MergedFacetValue. */ + class MergedFacetValue implements IMergedFacetValue { + + /** + * Constructs a new MergedFacetValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue); + + /** MergedFacetValue values. */ + public values: string[]; + + /** MergedFacetValue mergedValue. */ + public mergedValue: string; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacetValue instance + */ + public static create(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @param message MergedFacetValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Verifies a MergedFacetValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacetValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @param message MergedFacetValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacetValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacetValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MergedFacet. */ + interface IMergedFacet { + + /** MergedFacet mergedFacetKey */ + mergedFacetKey?: (string|null); + } + + /** Represents a MergedFacet. */ + class MergedFacet implements IMergedFacet { + + /** + * Constructs a new MergedFacet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet); + + /** MergedFacet mergedFacetKey. */ + public mergedFacetKey: string; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @param [properties] Properties to set + * @returns MergedFacet instance + */ + public static create(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @param message MergedFacet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Verifies a MergedFacet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergedFacet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @param message MergedFacet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergedFacet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergedFacet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RerankConfig. */ + interface IRerankConfig { + + /** RerankConfig rerankFacet */ + rerankFacet?: (boolean|null); + + /** RerankConfig facetValues */ + facetValues?: (string[]|null); + } + + /** Represents a RerankConfig. */ + class RerankConfig implements IRerankConfig { + + /** + * Constructs a new RerankConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig); + + /** RerankConfig rerankFacet. */ + public rerankFacet: boolean; + + /** RerankConfig facetValues. */ + public facetValues: string[]; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RerankConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @param message RerankConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Verifies a RerankConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RerankConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @param message RerankConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RerankConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RerankConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** AttributeType enum. */ enum AttributeType { UNKNOWN = 0, @@ -42380,6 +48200,9 @@ export namespace google { /** Condition activeTimeRange */ activeTimeRange?: (google.cloud.retail.v2beta.Condition.ITimeRange[]|null); + + /** Condition pageCategories */ + pageCategories?: (string[]|null); } /** Represents a Condition. */ @@ -42397,6 +48220,9 @@ export namespace google { /** Condition activeTimeRange. */ public activeTimeRange: google.cloud.retail.v2beta.Condition.ITimeRange[]; + /** Condition pageCategories. */ + public pageCategories: string[]; + /** * Creates a new Condition instance using the specified properties. * @param [properties] Properties to set @@ -42711,6 +48537,12 @@ export namespace google { /** Rule twowaySynonymsAction */ twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); + /** Rule forceReturnFacetAction */ + forceReturnFacetAction?: (google.cloud.retail.v2beta.Rule.IForceReturnFacetAction|null); + + /** Rule removeFacetAction */ + removeFacetAction?: (google.cloud.retail.v2beta.Rule.IRemoveFacetAction|null); + /** Rule condition */ condition?: (google.cloud.retail.v2beta.ICondition|null); } @@ -42748,11 +48580,17 @@ export namespace google { /** Rule twowaySynonymsAction. */ public twowaySynonymsAction?: (google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null); + /** Rule forceReturnFacetAction. */ + public forceReturnFacetAction?: (google.cloud.retail.v2beta.Rule.IForceReturnFacetAction|null); + + /** Rule removeFacetAction. */ + public removeFacetAction?: (google.cloud.retail.v2beta.Rule.IRemoveFacetAction|null); + /** Rule condition. */ public condition?: (google.cloud.retail.v2beta.ICondition|null); /** Rule action. */ - public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"); + public action?: ("boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"); /** * Creates a new Rule instance using the specified properties. @@ -43651,6 +49489,306 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a ForceReturnFacetAction. */ + interface IForceReturnFacetAction { + + /** ForceReturnFacetAction facetPositionAdjustments */ + facetPositionAdjustments?: (google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]|null); + } + + /** Represents a ForceReturnFacetAction. */ + class ForceReturnFacetAction implements IForceReturnFacetAction { + + /** + * Constructs a new ForceReturnFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IForceReturnFacetAction); + + /** ForceReturnFacetAction facetPositionAdjustments. */ + public facetPositionAdjustments: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment[]; + + /** + * Creates a new ForceReturnFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceReturnFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IForceReturnFacetAction): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction; + + /** + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.verify|verify} messages. + * @param message ForceReturnFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IForceReturnFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction; + + /** + * Verifies a ForceReturnFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceReturnFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction; + + /** + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. + * @param message ForceReturnFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForceReturnFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceReturnFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ForceReturnFacetAction { + + /** Properties of a FacetPositionAdjustment. */ + interface IFacetPositionAdjustment { + + /** FacetPositionAdjustment attributeName */ + attributeName?: (string|null); + + /** FacetPositionAdjustment position */ + position?: (number|null); + } + + /** Represents a FacetPositionAdjustment. */ + class FacetPositionAdjustment implements IFacetPositionAdjustment { + + /** + * Constructs a new FacetPositionAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment); + + /** FacetPositionAdjustment attributeName. */ + public attributeName: string; + + /** FacetPositionAdjustment position. */ + public position: number; + + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns FacetPositionAdjustment instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @param message FacetPositionAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Verifies a FacetPositionAdjustment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FacetPositionAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @param message FacetPositionAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FacetPositionAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FacetPositionAdjustment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RemoveFacetAction. */ + interface IRemoveFacetAction { + + /** RemoveFacetAction attributeNames */ + attributeNames?: (string[]|null); + } + + /** Represents a RemoveFacetAction. */ + class RemoveFacetAction implements IRemoveFacetAction { + + /** + * Constructs a new RemoveFacetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Rule.IRemoveFacetAction); + + /** RemoveFacetAction attributeNames. */ + public attributeNames: string[]; + + /** + * Creates a new RemoveFacetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveFacetAction instance + */ + public static create(properties?: google.cloud.retail.v2beta.Rule.IRemoveFacetAction): google.cloud.retail.v2beta.Rule.RemoveFacetAction; + + /** + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RemoveFacetAction.verify|verify} messages. + * @param message RemoveFacetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Rule.IRemoveFacetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Rule.RemoveFacetAction; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Rule.RemoveFacetAction; + + /** + * Verifies a RemoveFacetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveFacetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Rule.RemoveFacetAction; + + /** + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. + * @param message RemoveFacetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Rule.RemoveFacetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveFacetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveFacetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of an Audience. */ @@ -49530,6 +55668,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions */ maxSuggestions?: (number|null); + /** CompleteQueryRequest enableAttributeSuggestions */ + enableAttributeSuggestions?: (boolean|null); + /** CompleteQueryRequest entity */ entity?: (string|null); } @@ -49564,6 +55705,9 @@ export namespace google { /** CompleteQueryRequest maxSuggestions. */ public maxSuggestions: number; + /** CompleteQueryRequest enableAttributeSuggestions. */ + public enableAttributeSuggestions: boolean; + /** CompleteQueryRequest entity. */ public entity: string; @@ -52918,6 +59062,9 @@ export namespace google { /** Model servingConfigLists */ servingConfigLists?: (google.cloud.retail.v2beta.Model.IServingConfigList[]|null); + + /** Model modelFeaturesConfig */ + modelFeaturesConfig?: (google.cloud.retail.v2beta.Model.IModelFeaturesConfig|null); } /** Represents a Model. */ @@ -52971,6 +59118,9 @@ export namespace google { /** Model servingConfigLists. */ public servingConfigLists: google.cloud.retail.v2beta.Model.IServingConfigList[]; + /** Model modelFeaturesConfig. */ + public modelFeaturesConfig?: (google.cloud.retail.v2beta.Model.IModelFeaturesConfig|null); + /** * Creates a new Model instance using the specified properties. * @param [properties] Properties to set @@ -53148,6 +59298,203 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a FrequentlyBoughtTogetherFeaturesConfig. */ + interface IFrequentlyBoughtTogetherFeaturesConfig { + + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType */ + contextProductsType?: (google.cloud.retail.v2beta.Model.ContextProductsType|keyof typeof google.cloud.retail.v2beta.Model.ContextProductsType|null); + } + + /** Represents a FrequentlyBoughtTogetherFeaturesConfig. */ + class FrequentlyBoughtTogetherFeaturesConfig implements IFrequentlyBoughtTogetherFeaturesConfig { + + /** + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig); + + /** FrequentlyBoughtTogetherFeaturesConfig contextProductsType. */ + public contextProductsType: (google.cloud.retail.v2beta.Model.ContextProductsType|keyof typeof google.cloud.retail.v2beta.Model.ContextProductsType); + + /** + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FrequentlyBoughtTogetherFeaturesConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig): google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @param message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FrequentlyBoughtTogetherFeaturesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig; + + /** + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @param message FrequentlyBoughtTogetherFeaturesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelFeaturesConfig. */ + interface IModelFeaturesConfig { + + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig */ + frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); + } + + /** Represents a ModelFeaturesConfig. */ + class ModelFeaturesConfig implements IModelFeaturesConfig { + + /** + * Constructs a new ModelFeaturesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.Model.IModelFeaturesConfig); + + /** ModelFeaturesConfig frequentlyBoughtTogetherConfig. */ + public frequentlyBoughtTogetherConfig?: (google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig|null); + + /** ModelFeaturesConfig typeDedicatedConfig. */ + public typeDedicatedConfig?: "frequentlyBoughtTogetherConfig"; + + /** + * Creates a new ModelFeaturesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelFeaturesConfig instance + */ + public static create(properties?: google.cloud.retail.v2beta.Model.IModelFeaturesConfig): google.cloud.retail.v2beta.Model.ModelFeaturesConfig; + + /** + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Model.ModelFeaturesConfig.verify|verify} messages. + * @param message ModelFeaturesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.Model.IModelFeaturesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Model.ModelFeaturesConfig; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Model.ModelFeaturesConfig; + + /** + * Verifies a ModelFeaturesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelFeaturesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Model.ModelFeaturesConfig; + + /** + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. + * @param message ModelFeaturesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.Model.ModelFeaturesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelFeaturesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelFeaturesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** ServingState enum. */ enum ServingState { SERVING_STATE_UNSPECIFIED = 0, @@ -53177,6 +59524,13 @@ export namespace google { DATA_OK = 1, DATA_ERROR = 2 } + + /** ContextProductsType enum. */ + enum ContextProductsType { + CONTEXT_PRODUCTS_TYPE_UNSPECIFIED = 0, + SINGLE_CONTEXT_PRODUCT = 1, + MULTIPLE_CONTEXT_PRODUCTS = 2 + } } /** Represents a ModelService */ @@ -55060,6 +61414,20 @@ export namespace google { */ public deleteProduct(request: google.cloud.retail.v2beta.IDeleteProductRequest): Promise; + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public purgeProducts(request: google.cloud.retail.v2beta.IPurgeProductsRequest, callback: google.cloud.retail.v2beta.ProductService.PurgeProductsCallback): void; + + /** + * Calls PurgeProducts. + * @param request PurgeProductsRequest message or plain object + * @returns Promise + */ + public purgeProducts(request: google.cloud.retail.v2beta.IPurgeProductsRequest): Promise; + /** * Calls ImportProducts. * @param request ImportProductsRequest message or plain object @@ -55182,6 +61550,13 @@ export namespace google { */ type DeleteProductCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService|purgeProducts}. + * @param error Error, if any + * @param [response] Operation + */ + type PurgeProductsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.retail.v2beta.ProductService|importProducts}. * @param error Error, if any @@ -57455,6 +63830,333 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PurgeProductsMetadata. */ + interface IPurgeProductsMetadata { + + /** PurgeProductsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount */ + successCount?: (number|Long|string|null); + + /** PurgeProductsMetadata failureCount */ + failureCount?: (number|Long|string|null); + } + + /** Represents a PurgeProductsMetadata. */ + class PurgeProductsMetadata implements IPurgeProductsMetadata { + + /** + * Constructs a new PurgeProductsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IPurgeProductsMetadata); + + /** PurgeProductsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PurgeProductsMetadata successCount. */ + public successCount: (number|Long|string); + + /** PurgeProductsMetadata failureCount. */ + public failureCount: (number|Long|string); + + /** + * Creates a new PurgeProductsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsMetadata instance + */ + public static create(properties?: google.cloud.retail.v2beta.IPurgeProductsMetadata): google.cloud.retail.v2beta.PurgeProductsMetadata; + + /** + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsMetadata.verify|verify} messages. + * @param message PurgeProductsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeProductsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurgeProductsMetadata; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurgeProductsMetadata; + + /** + * Verifies a PurgeProductsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeProductsMetadata; + + /** + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * @param message PurgeProductsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PurgeProductsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeProductsRequest. */ + interface IPurgeProductsRequest { + + /** PurgeProductsRequest parent */ + parent?: (string|null); + + /** PurgeProductsRequest filter */ + filter?: (string|null); + + /** PurgeProductsRequest force */ + force?: (boolean|null); + } + + /** Represents a PurgeProductsRequest. */ + class PurgeProductsRequest implements IPurgeProductsRequest { + + /** + * Constructs a new PurgeProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IPurgeProductsRequest); + + /** PurgeProductsRequest parent. */ + public parent: string; + + /** PurgeProductsRequest filter. */ + public filter: string; + + /** PurgeProductsRequest force. */ + public force: boolean; + + /** + * Creates a new PurgeProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsRequest instance + */ + public static create(properties?: google.cloud.retail.v2beta.IPurgeProductsRequest): google.cloud.retail.v2beta.PurgeProductsRequest; + + /** + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsRequest.verify|verify} messages. + * @param message PurgeProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurgeProductsRequest; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurgeProductsRequest; + + /** + * Verifies a PurgeProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeProductsRequest; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @param message PurgeProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PurgeProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurgeProductsResponse. */ + interface IPurgeProductsResponse { + + /** PurgeProductsResponse purgeCount */ + purgeCount?: (number|Long|string|null); + + /** PurgeProductsResponse purgeSample */ + purgeSample?: (string[]|null); + } + + /** Represents a PurgeProductsResponse. */ + class PurgeProductsResponse implements IPurgeProductsResponse { + + /** + * Constructs a new PurgeProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.retail.v2beta.IPurgeProductsResponse); + + /** PurgeProductsResponse purgeCount. */ + public purgeCount: (number|Long|string); + + /** PurgeProductsResponse purgeSample. */ + public purgeSample: string[]; + + /** + * Creates a new PurgeProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PurgeProductsResponse instance + */ + public static create(properties?: google.cloud.retail.v2beta.IPurgeProductsResponse): google.cloud.retail.v2beta.PurgeProductsResponse; + + /** + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.retail.v2beta.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsResponse.verify|verify} messages. + * @param message PurgeProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.retail.v2beta.IPurgeProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.PurgeProductsResponse; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.PurgeProductsResponse; + + /** + * Verifies a PurgeProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurgeProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.PurgeProductsResponse; + + /** + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * @param message PurgeProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.retail.v2beta.PurgeProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurgeProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurgeProductsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PurgeUserEventsRequest. */ interface IPurgeUserEventsRequest { @@ -57715,6 +64417,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel */ enableCategoryFilterLevel?: (string|null); + /** ServingConfig ignoreRecsDenylist */ + ignoreRecsDenylist?: (boolean|null); + /** ServingConfig personalizationSpec */ personalizationSpec?: (google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null); @@ -57782,6 +64487,9 @@ export namespace google { /** ServingConfig enableCategoryFilterLevel. */ public enableCategoryFilterLevel: string; + /** ServingConfig ignoreRecsDenylist. */ + public ignoreRecsDenylist: boolean; + /** ServingConfig personalizationSpec. */ public personalizationSpec?: (google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null); diff --git a/packages/google-cloud-retail/protos/protos.js b/packages/google-cloud-retail/protos/protos.js index 9dd1bda5d58..c25179b48f0 100644 --- a/packages/google-cloud-retail/protos/protos.js +++ b/packages/google-cloud-retail/protos/protos.js @@ -2784,6 +2784,7 @@ * @property {google.cloud.retail.v2.CatalogAttribute.SearchableOption|null} [searchableOption] CatalogAttribute searchableOption * @property {google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption|null} [exactSearchableOption] CatalogAttribute exactSearchableOption * @property {google.cloud.retail.v2.CatalogAttribute.RetrievableOption|null} [retrievableOption] CatalogAttribute retrievableOption + * @property {google.cloud.retail.v2.CatalogAttribute.IFacetConfig|null} [facetConfig] CatalogAttribute facetConfig */ /** @@ -2865,6 +2866,14 @@ */ CatalogAttribute.prototype.retrievableOption = 0; + /** + * CatalogAttribute facetConfig. + * @member {google.cloud.retail.v2.CatalogAttribute.IFacetConfig|null|undefined} facetConfig + * @memberof google.cloud.retail.v2.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.facetConfig = null; + /** * Creates a new CatalogAttribute instance using the specified properties. * @function create @@ -2905,6 +2914,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.exactSearchableOption); if (message.retrievableOption != null && Object.hasOwnProperty.call(message, "retrievableOption")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.retrievableOption); + if (message.facetConfig != null && Object.hasOwnProperty.call(message, "facetConfig")) + $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.encode(message.facetConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -2971,6 +2982,10 @@ message.retrievableOption = reader.int32(); break; } + case 13: { + message.facetConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3066,6 +3081,11 @@ case 2: break; } + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) { + var error = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.verify(message.facetConfig); + if (error) + return "facetConfig." + error; + } return null; }; @@ -3205,6 +3225,11 @@ message.retrievableOption = 2; break; } + if (object.facetConfig != null) { + if (typeof object.facetConfig !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.facetConfig: object expected"); + message.facetConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.fromObject(object.facetConfig); + } return message; }; @@ -3230,6 +3255,7 @@ object.type = options.enums === String ? "UNKNOWN" : 0; object.exactSearchableOption = options.enums === String ? "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" : 0; object.retrievableOption = options.enums === String ? "RETRIEVABLE_OPTION_UNSPECIFIED" : 0; + object.facetConfig = null; } if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; @@ -3247,6 +3273,8 @@ object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) object.retrievableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.RetrievableOption[message.retrievableOption] === undefined ? message.retrievableOption : $root.google.cloud.retail.v2.CatalogAttribute.RetrievableOption[message.retrievableOption] : message.retrievableOption; + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) + object.facetConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.toObject(message.facetConfig, options); return object; }; @@ -3276,6 +3304,1343 @@ return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute"; }; + CatalogAttribute.FacetConfig = (function() { + + /** + * Properties of a FacetConfig. + * @memberof google.cloud.retail.v2.CatalogAttribute + * @interface IFacetConfig + * @property {Array.|null} [facetIntervals] FacetConfig facetIntervals + * @property {Array.|null} [ignoredFacetValues] FacetConfig ignoredFacetValues + * @property {Array.|null} [mergedFacetValues] FacetConfig mergedFacetValues + * @property {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet|null} [mergedFacet] FacetConfig mergedFacet + * @property {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig|null} [rerankConfig] FacetConfig rerankConfig + */ + + /** + * Constructs a new FacetConfig. + * @memberof google.cloud.retail.v2.CatalogAttribute + * @classdesc Represents a FacetConfig. + * @implements IFacetConfig + * @constructor + * @param {google.cloud.retail.v2.CatalogAttribute.IFacetConfig=} [properties] Properties to set + */ + function FacetConfig(properties) { + this.facetIntervals = []; + this.ignoredFacetValues = []; + this.mergedFacetValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetConfig facetIntervals. + * @member {Array.} facetIntervals + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.facetIntervals = $util.emptyArray; + + /** + * FacetConfig ignoredFacetValues. + * @member {Array.} ignoredFacetValues + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.ignoredFacetValues = $util.emptyArray; + + /** + * FacetConfig mergedFacetValues. + * @member {Array.} mergedFacetValues + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacetValues = $util.emptyArray; + + /** + * FacetConfig mergedFacet. + * @member {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet|null|undefined} mergedFacet + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacet = null; + + /** + * FacetConfig rerankConfig. + * @member {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig|null|undefined} rerankConfig + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.rerankConfig = null; + + /** + * Creates a new FacetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.IFacetConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig} FacetConfig instance + */ + FacetConfig.create = function create(properties) { + return new FacetConfig(properties); + }; + + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetIntervals != null && message.facetIntervals.length) + for (var i = 0; i < message.facetIntervals.length; ++i) + $root.google.cloud.retail.v2.Interval.encode(message.facetIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ignoredFacetValues != null && message.ignoredFacetValues.length) + for (var i = 0; i < message.ignoredFacetValues.length; ++i) + $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.encode(message.ignoredFacetValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mergedFacetValues != null && message.mergedFacetValues.length) + for (var i = 0; i < message.mergedFacetValues.length; ++i) + $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.encode(message.mergedFacetValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergedFacet != null && Object.hasOwnProperty.call(message, "mergedFacet")) + $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.encode(message.mergedFacet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rerankConfig != null && Object.hasOwnProperty.call(message, "rerankConfig")) + $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.encode(message.rerankConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.facetIntervals && message.facetIntervals.length)) + message.facetIntervals = []; + message.facetIntervals.push($root.google.cloud.retail.v2.Interval.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ignoredFacetValues && message.ignoredFacetValues.length)) + message.ignoredFacetValues = []; + message.ignoredFacetValues.push($root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.mergedFacetValues && message.mergedFacetValues.length)) + message.mergedFacetValues = []; + message.mergedFacetValues.push($root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.decode(reader, reader.uint32())); + break; + } + case 4: { + message.mergedFacet = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rerankConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetConfig message. + * @function verify + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetIntervals != null && message.hasOwnProperty("facetIntervals")) { + if (!Array.isArray(message.facetIntervals)) + return "facetIntervals: array expected"; + for (var i = 0; i < message.facetIntervals.length; ++i) { + var error = $root.google.cloud.retail.v2.Interval.verify(message.facetIntervals[i]); + if (error) + return "facetIntervals." + error; + } + } + if (message.ignoredFacetValues != null && message.hasOwnProperty("ignoredFacetValues")) { + if (!Array.isArray(message.ignoredFacetValues)) + return "ignoredFacetValues: array expected"; + for (var i = 0; i < message.ignoredFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify(message.ignoredFacetValues[i]); + if (error) + return "ignoredFacetValues." + error; + } + } + if (message.mergedFacetValues != null && message.hasOwnProperty("mergedFacetValues")) { + if (!Array.isArray(message.mergedFacetValues)) + return "mergedFacetValues: array expected"; + for (var i = 0; i < message.mergedFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.verify(message.mergedFacetValues[i]); + if (error) + return "mergedFacetValues." + error; + } + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) { + var error = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.verify(message.mergedFacet); + if (error) + return "mergedFacet." + error; + } + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) { + var error = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.verify(message.rerankConfig); + if (error) + return "rerankConfig." + error; + } + return null; + }; + + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig} FacetConfig + */ + FacetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig) + return object; + var message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig(); + if (object.facetIntervals) { + if (!Array.isArray(object.facetIntervals)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.facetIntervals: array expected"); + message.facetIntervals = []; + for (var i = 0; i < object.facetIntervals.length; ++i) { + if (typeof object.facetIntervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.facetIntervals: object expected"); + message.facetIntervals[i] = $root.google.cloud.retail.v2.Interval.fromObject(object.facetIntervals[i]); + } + } + if (object.ignoredFacetValues) { + if (!Array.isArray(object.ignoredFacetValues)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.ignoredFacetValues: array expected"); + message.ignoredFacetValues = []; + for (var i = 0; i < object.ignoredFacetValues.length; ++i) { + if (typeof object.ignoredFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.ignoredFacetValues: object expected"); + message.ignoredFacetValues[i] = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.fromObject(object.ignoredFacetValues[i]); + } + } + if (object.mergedFacetValues) { + if (!Array.isArray(object.mergedFacetValues)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.mergedFacetValues: array expected"); + message.mergedFacetValues = []; + for (var i = 0; i < object.mergedFacetValues.length; ++i) { + if (typeof object.mergedFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.mergedFacetValues: object expected"); + message.mergedFacetValues[i] = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.fromObject(object.mergedFacetValues[i]); + } + } + if (object.mergedFacet != null) { + if (typeof object.mergedFacet !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.mergedFacet: object expected"); + message.mergedFacet = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.fromObject(object.mergedFacet); + } + if (object.rerankConfig != null) { + if (typeof object.rerankConfig !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.rerankConfig: object expected"); + message.rerankConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.fromObject(object.rerankConfig); + } + return message; + }; + + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig} message FacetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetIntervals = []; + object.ignoredFacetValues = []; + object.mergedFacetValues = []; + } + if (options.defaults) { + object.mergedFacet = null; + object.rerankConfig = null; + } + if (message.facetIntervals && message.facetIntervals.length) { + object.facetIntervals = []; + for (var j = 0; j < message.facetIntervals.length; ++j) + object.facetIntervals[j] = $root.google.cloud.retail.v2.Interval.toObject(message.facetIntervals[j], options); + } + if (message.ignoredFacetValues && message.ignoredFacetValues.length) { + object.ignoredFacetValues = []; + for (var j = 0; j < message.ignoredFacetValues.length; ++j) + object.ignoredFacetValues[j] = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.toObject(message.ignoredFacetValues[j], options); + } + if (message.mergedFacetValues && message.mergedFacetValues.length) { + object.mergedFacetValues = []; + for (var j = 0; j < message.mergedFacetValues.length; ++j) + object.mergedFacetValues[j] = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.toObject(message.mergedFacetValues[j], options); + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) + object.mergedFacet = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.toObject(message.mergedFacet, options); + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) + object.rerankConfig = $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.toObject(message.rerankConfig, options); + return object; + }; + + /** + * Converts this FacetConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @instance + * @returns {Object.} JSON object + */ + FacetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute.FacetConfig"; + }; + + FacetConfig.IgnoredFacetValues = (function() { + + /** + * Properties of an IgnoredFacetValues. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @interface IIgnoredFacetValues + * @property {Array.|null} [values] IgnoredFacetValues values + * @property {google.protobuf.ITimestamp|null} [startTime] IgnoredFacetValues startTime + * @property {google.protobuf.ITimestamp|null} [endTime] IgnoredFacetValues endTime + */ + + /** + * Constructs a new IgnoredFacetValues. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @classdesc Represents an IgnoredFacetValues. + * @implements IIgnoredFacetValues + * @constructor + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + */ + function IgnoredFacetValues(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]]; + } + + /** + * IgnoredFacetValues values. + * @member {Array.} values + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.values = $util.emptyArray; + + /** + * IgnoredFacetValues startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.startTime = null; + + /** + * IgnoredFacetValues endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.endTime = null; + + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues instance + */ + IgnoredFacetValues.create = function create(properties) { + return new IgnoredFacetValues(properties); + }; + + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IgnoredFacetValues message. + * @function verify + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IgnoredFacetValues.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) + if (!$util.isString(message.values[i])) + return "values: string[] 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 IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + */ + IgnoredFacetValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues) + return object; + var message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.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.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues} message IgnoredFacetValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IgnoredFacetValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + 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 IgnoredFacetValues to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + * @returns {Object.} JSON object + */ + IgnoredFacetValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IgnoredFacetValues + * @function getTypeUrl + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IgnoredFacetValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute.FacetConfig.IgnoredFacetValues"; + }; + + return IgnoredFacetValues; + })(); + + FacetConfig.MergedFacetValue = (function() { + + /** + * Properties of a MergedFacetValue. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @interface IMergedFacetValue + * @property {Array.|null} [values] MergedFacetValue values + * @property {string|null} [mergedValue] MergedFacetValue mergedValue + */ + + /** + * Constructs a new MergedFacetValue. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacetValue. + * @implements IMergedFacetValue + * @constructor + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + */ + function MergedFacetValue(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]]; + } + + /** + * MergedFacetValue values. + * @member {Array.} values + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.values = $util.emptyArray; + + /** + * MergedFacetValue mergedValue. + * @member {string} mergedValue + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.mergedValue = ""; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue instance + */ + MergedFacetValue.create = function create(properties) { + return new MergedFacetValue(properties); + }; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.mergedValue != null && Object.hasOwnProperty.call(message, "mergedValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mergedValue); + return writer; + }; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.mergedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacetValue message. + * @function verify + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacetValue.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + if (!$util.isString(message.mergedValue)) + return "mergedValue: string expected"; + return null; + }; + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + */ + MergedFacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue) + return object; + var message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.mergedValue != null) + message.mergedValue = String(object.mergedValue); + return message; + }; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue} message MergedFacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacetValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) + object.mergedValue = ""; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + object.mergedValue = message.mergedValue; + return object; + }; + + /** + * Converts this MergedFacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + * @returns {Object.} JSON object + */ + MergedFacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacetValue + * @function getTypeUrl + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacetValue"; + }; + + return MergedFacetValue; + })(); + + FacetConfig.MergedFacet = (function() { + + /** + * Properties of a MergedFacet. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @interface IMergedFacet + * @property {string|null} [mergedFacetKey] MergedFacet mergedFacetKey + */ + + /** + * Constructs a new MergedFacet. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacet. + * @implements IMergedFacet + * @constructor + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + */ + function MergedFacet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergedFacet mergedFacetKey. + * @member {string} mergedFacetKey + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @instance + */ + MergedFacet.prototype.mergedFacetKey = ""; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet instance + */ + MergedFacet.create = function create(properties) { + return new MergedFacet(properties); + }; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mergedFacetKey != null && Object.hasOwnProperty.call(message, "mergedFacetKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mergedFacetKey); + return writer; + }; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mergedFacetKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacet message. + * @function verify + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + if (!$util.isString(message.mergedFacetKey)) + return "mergedFacetKey: string expected"; + return null; + }; + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + */ + MergedFacet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet) + return object; + var message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet(); + if (object.mergedFacetKey != null) + message.mergedFacetKey = String(object.mergedFacetKey); + return message; + }; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet} message MergedFacet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mergedFacetKey = ""; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + object.mergedFacetKey = message.mergedFacetKey; + return object; + }; + + /** + * Converts this MergedFacet to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @instance + * @returns {Object.} JSON object + */ + MergedFacet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacet + * @function getTypeUrl + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute.FacetConfig.MergedFacet"; + }; + + return MergedFacet; + })(); + + FacetConfig.RerankConfig = (function() { + + /** + * Properties of a RerankConfig. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @interface IRerankConfig + * @property {boolean|null} [rerankFacet] RerankConfig rerankFacet + * @property {Array.|null} [facetValues] RerankConfig facetValues + */ + + /** + * Constructs a new RerankConfig. + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig + * @classdesc Represents a RerankConfig. + * @implements IRerankConfig + * @constructor + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + */ + function RerankConfig(properties) { + this.facetValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RerankConfig rerankFacet. + * @member {boolean} rerankFacet + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.rerankFacet = false; + + /** + * RerankConfig facetValues. + * @member {Array.} facetValues + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.facetValues = $util.emptyArray; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig instance + */ + RerankConfig.create = function create(properties) { + return new RerankConfig(properties); + }; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rerankFacet != null && Object.hasOwnProperty.call(message, "rerankFacet")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.rerankFacet); + if (message.facetValues != null && message.facetValues.length) + for (var i = 0; i < message.facetValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.facetValues[i]); + return writer; + }; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rerankFacet = reader.bool(); + break; + } + case 2: { + if (!(message.facetValues && message.facetValues.length)) + message.facetValues = []; + message.facetValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RerankConfig message. + * @function verify + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RerankConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + if (typeof message.rerankFacet !== "boolean") + return "rerankFacet: boolean expected"; + if (message.facetValues != null && message.hasOwnProperty("facetValues")) { + if (!Array.isArray(message.facetValues)) + return "facetValues: array expected"; + for (var i = 0; i < message.facetValues.length; ++i) + if (!$util.isString(message.facetValues[i])) + return "facetValues: string[] expected"; + } + return null; + }; + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + */ + RerankConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig) + return object; + var message = new $root.google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig(); + if (object.rerankFacet != null) + message.rerankFacet = Boolean(object.rerankFacet); + if (object.facetValues) { + if (!Array.isArray(object.facetValues)) + throw TypeError(".google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig.facetValues: array expected"); + message.facetValues = []; + for (var i = 0; i < object.facetValues.length; ++i) + message.facetValues[i] = String(object.facetValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig} message RerankConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RerankConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facetValues = []; + if (options.defaults) + object.rerankFacet = false; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + object.rerankFacet = message.rerankFacet; + if (message.facetValues && message.facetValues.length) { + object.facetValues = []; + for (var j = 0; j < message.facetValues.length; ++j) + object.facetValues[j] = message.facetValues[j]; + } + return object; + }; + + /** + * Converts this RerankConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @instance + * @returns {Object.} JSON object + */ + RerankConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RerankConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RerankConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.CatalogAttribute.FacetConfig.RerankConfig"; + }; + + return RerankConfig; + })(); + + return FacetConfig; + })(); + /** * AttributeType enum. * @name google.cloud.retail.v2.CatalogAttribute.AttributeType @@ -4468,6 +5833,7 @@ * @interface ICondition * @property {Array.|null} [queryTerms] Condition queryTerms * @property {Array.|null} [activeTimeRange] Condition activeTimeRange + * @property {Array.|null} [pageCategories] Condition pageCategories */ /** @@ -4481,6 +5847,7 @@ function Condition(properties) { this.queryTerms = []; this.activeTimeRange = []; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4503,6 +5870,14 @@ */ Condition.prototype.activeTimeRange = $util.emptyArray; + /** + * Condition pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2.Condition + * @instance + */ + Condition.prototype.pageCategories = $util.emptyArray; + /** * Creates a new Condition instance using the specified properties. * @function create @@ -4533,6 +5908,9 @@ if (message.activeTimeRange != null && message.activeTimeRange.length) for (var i = 0; i < message.activeTimeRange.length; ++i) $root.google.cloud.retail.v2.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageCategories[i]); return writer; }; @@ -4579,6 +5957,12 @@ message.activeTimeRange.push($root.google.cloud.retail.v2.Condition.TimeRange.decode(reader, reader.uint32())); break; } + case 4: { + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -4632,6 +6016,13 @@ return "activeTimeRange." + error; } } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } return null; }; @@ -4667,6 +6058,13 @@ message.activeTimeRange[i] = $root.google.cloud.retail.v2.Condition.TimeRange.fromObject(object.activeTimeRange[i]); } } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2.Condition.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } return message; }; @@ -4686,6 +6084,7 @@ if (options.arrays || options.defaults) { object.queryTerms = []; object.activeTimeRange = []; + object.pageCategories = []; } if (message.queryTerms && message.queryTerms.length) { object.queryTerms = []; @@ -4697,6 +6096,11 @@ for (var j = 0; j < message.activeTimeRange.length; ++j) object.activeTimeRange[j] = $root.google.cloud.retail.v2.Condition.TimeRange.toObject(message.activeTimeRange[j], options); } + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } return object; }; @@ -5207,6 +6611,8 @@ * @property {google.cloud.retail.v2.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction * @property {google.cloud.retail.v2.Rule.IFilterAction|null} [filterAction] Rule filterAction * @property {google.cloud.retail.v2.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction + * @property {google.cloud.retail.v2.Rule.IForceReturnFacetAction|null} [forceReturnFacetAction] Rule forceReturnFacetAction + * @property {google.cloud.retail.v2.Rule.IRemoveFacetAction|null} [removeFacetAction] Rule removeFacetAction * @property {google.cloud.retail.v2.ICondition|null} [condition] Rule condition */ @@ -5289,6 +6695,22 @@ */ Rule.prototype.twowaySynonymsAction = null; + /** + * Rule forceReturnFacetAction. + * @member {google.cloud.retail.v2.Rule.IForceReturnFacetAction|null|undefined} forceReturnFacetAction + * @memberof google.cloud.retail.v2.Rule + * @instance + */ + Rule.prototype.forceReturnFacetAction = null; + + /** + * Rule removeFacetAction. + * @member {google.cloud.retail.v2.Rule.IRemoveFacetAction|null|undefined} removeFacetAction + * @memberof google.cloud.retail.v2.Rule + * @instance + */ + Rule.prototype.removeFacetAction = null; + /** * Rule condition. * @member {google.cloud.retail.v2.ICondition|null|undefined} condition @@ -5302,12 +6724,12 @@ /** * Rule action. - * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action + * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"|undefined} action * @memberof google.cloud.retail.v2.Rule * @instance */ Object.defineProperty(Rule.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), + get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction", "forceReturnFacetAction", "removeFacetAction"]), set: $util.oneOfSetter($oneOfFields) }); @@ -5353,6 +6775,10 @@ $root.google.cloud.retail.v2.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) $root.google.cloud.retail.v2.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.forceReturnFacetAction != null && Object.hasOwnProperty.call(message, "forceReturnFacetAction")) + $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.encode(message.forceReturnFacetAction, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.removeFacetAction != null && Object.hasOwnProperty.call(message, "removeFacetAction")) + $root.google.cloud.retail.v2.Rule.RemoveFacetAction.encode(message.removeFacetAction, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -5419,6 +6845,14 @@ message.twowaySynonymsAction = $root.google.cloud.retail.v2.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); break; } + case 12: { + message.forceReturnFacetAction = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.decode(reader, reader.uint32()); + break; + } + case 13: { + message.removeFacetAction = $root.google.cloud.retail.v2.Rule.RemoveFacetAction.decode(reader, reader.uint32()); + break; + } case 1: { message.condition = $root.google.cloud.retail.v2.Condition.decode(reader, reader.uint32()); break; @@ -5537,6 +6971,26 @@ return "twowaySynonymsAction." + error; } } + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.verify(message.forceReturnFacetAction); + if (error) + return "forceReturnFacetAction." + error; + } + } + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2.Rule.RemoveFacetAction.verify(message.removeFacetAction); + if (error) + return "removeFacetAction." + error; + } + } if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.cloud.retail.v2.Condition.verify(message.condition); if (error) @@ -5597,6 +7051,16 @@ throw TypeError(".google.cloud.retail.v2.Rule.twowaySynonymsAction: object expected"); message.twowaySynonymsAction = $root.google.cloud.retail.v2.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); } + if (object.forceReturnFacetAction != null) { + if (typeof object.forceReturnFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2.Rule.forceReturnFacetAction: object expected"); + message.forceReturnFacetAction = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.fromObject(object.forceReturnFacetAction); + } + if (object.removeFacetAction != null) { + if (typeof object.removeFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2.Rule.removeFacetAction: object expected"); + message.removeFacetAction = $root.google.cloud.retail.v2.Rule.RemoveFacetAction.fromObject(object.removeFacetAction); + } if (object.condition != null) { if (typeof object.condition !== "object") throw TypeError(".google.cloud.retail.v2.Rule.condition: object expected"); @@ -5662,6 +7126,16 @@ if (options.oneofs) object.action = "twowaySynonymsAction"; } + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + object.forceReturnFacetAction = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.toObject(message.forceReturnFacetAction, options); + if (options.oneofs) + object.action = "forceReturnFacetAction"; + } + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + object.removeFacetAction = $root.google.cloud.retail.v2.Rule.RemoveFacetAction.toObject(message.removeFacetAction, options); + if (options.oneofs) + object.action = "removeFacetAction"; + } return object; }; @@ -7625,6 +9099,676 @@ return IgnoreAction; })(); + Rule.ForceReturnFacetAction = (function() { + + /** + * Properties of a ForceReturnFacetAction. + * @memberof google.cloud.retail.v2.Rule + * @interface IForceReturnFacetAction + * @property {Array.|null} [facetPositionAdjustments] ForceReturnFacetAction facetPositionAdjustments + */ + + /** + * Constructs a new ForceReturnFacetAction. + * @memberof google.cloud.retail.v2.Rule + * @classdesc Represents a ForceReturnFacetAction. + * @implements IForceReturnFacetAction + * @constructor + * @param {google.cloud.retail.v2.Rule.IForceReturnFacetAction=} [properties] Properties to set + */ + function ForceReturnFacetAction(properties) { + this.facetPositionAdjustments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForceReturnFacetAction facetPositionAdjustments. + * @member {Array.} facetPositionAdjustments + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @instance + */ + ForceReturnFacetAction.prototype.facetPositionAdjustments = $util.emptyArray; + + /** + * Creates a new ForceReturnFacetAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IForceReturnFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction} ForceReturnFacetAction instance + */ + ForceReturnFacetAction.create = function create(properties) { + return new ForceReturnFacetAction(properties); + }; + + /** + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceReturnFacetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetPositionAdjustments != null && message.facetPositionAdjustments.length) + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) + $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.encode(message.facetPositionAdjustments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceReturnFacetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction} ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceReturnFacetAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.facetPositionAdjustments && message.facetPositionAdjustments.length)) + message.facetPositionAdjustments = []; + message.facetPositionAdjustments.push($root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction} ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceReturnFacetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForceReturnFacetAction message. + * @function verify + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForceReturnFacetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetPositionAdjustments != null && message.hasOwnProperty("facetPositionAdjustments")) { + if (!Array.isArray(message.facetPositionAdjustments)) + return "facetPositionAdjustments: array expected"; + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) { + var error = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify(message.facetPositionAdjustments[i]); + if (error) + return "facetPositionAdjustments." + error; + } + } + return null; + }; + + /** + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction} ForceReturnFacetAction + */ + ForceReturnFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction) + return object; + var message = new $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction(); + if (object.facetPositionAdjustments) { + if (!Array.isArray(object.facetPositionAdjustments)) + throw TypeError(".google.cloud.retail.v2.Rule.ForceReturnFacetAction.facetPositionAdjustments: array expected"); + message.facetPositionAdjustments = []; + for (var i = 0; i < object.facetPositionAdjustments.length; ++i) { + if (typeof object.facetPositionAdjustments[i] !== "object") + throw TypeError(".google.cloud.retail.v2.Rule.ForceReturnFacetAction.facetPositionAdjustments: object expected"); + message.facetPositionAdjustments[i] = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.fromObject(object.facetPositionAdjustments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction} message ForceReturnFacetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForceReturnFacetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facetPositionAdjustments = []; + if (message.facetPositionAdjustments && message.facetPositionAdjustments.length) { + object.facetPositionAdjustments = []; + for (var j = 0; j < message.facetPositionAdjustments.length; ++j) + object.facetPositionAdjustments[j] = $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.toObject(message.facetPositionAdjustments[j], options); + } + return object; + }; + + /** + * Converts this ForceReturnFacetAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @instance + * @returns {Object.} JSON object + */ + ForceReturnFacetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForceReturnFacetAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceReturnFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.Rule.ForceReturnFacetAction"; + }; + + ForceReturnFacetAction.FacetPositionAdjustment = (function() { + + /** + * Properties of a FacetPositionAdjustment. + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @interface IFacetPositionAdjustment + * @property {string|null} [attributeName] FacetPositionAdjustment attributeName + * @property {number|null} [position] FacetPositionAdjustment position + */ + + /** + * Constructs a new FacetPositionAdjustment. + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction + * @classdesc Represents a FacetPositionAdjustment. + * @implements IFacetPositionAdjustment + * @constructor + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + */ + function FacetPositionAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetPositionAdjustment attributeName. + * @member {string} attributeName + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.attributeName = ""; + + /** + * FacetPositionAdjustment position. + * @member {number} position + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.position = 0; + + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment instance + */ + FacetPositionAdjustment.create = function create(properties) { + return new FacetPositionAdjustment(properties); + }; + + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeName != null && Object.hasOwnProperty.call(message, "attributeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeName); + if (message.position != null && Object.hasOwnProperty.call(message, "position")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.position); + return writer; + }; + + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributeName = reader.string(); + break; + } + case 2: { + message.position = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetPositionAdjustment message. + * @function verify + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetPositionAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + if (!$util.isString(message.attributeName)) + return "attributeName: string expected"; + if (message.position != null && message.hasOwnProperty("position")) + if (!$util.isInteger(message.position)) + return "position: integer expected"; + return null; + }; + + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + */ + FacetPositionAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment) + return object; + var message = new $root.google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + if (object.attributeName != null) + message.attributeName = String(object.attributeName); + if (object.position != null) + message.position = object.position | 0; + return message; + }; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment} message FacetPositionAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetPositionAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeName = ""; + object.position = 0; + } + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + object.attributeName = message.attributeName; + if (message.position != null && message.hasOwnProperty("position")) + object.position = message.position; + return object; + }; + + /** + * Converts this FacetPositionAdjustment to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + * @returns {Object.} JSON object + */ + FacetPositionAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetPositionAdjustment + * @function getTypeUrl + * @memberof google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetPositionAdjustment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.Rule.ForceReturnFacetAction.FacetPositionAdjustment"; + }; + + return FacetPositionAdjustment; + })(); + + return ForceReturnFacetAction; + })(); + + Rule.RemoveFacetAction = (function() { + + /** + * Properties of a RemoveFacetAction. + * @memberof google.cloud.retail.v2.Rule + * @interface IRemoveFacetAction + * @property {Array.|null} [attributeNames] RemoveFacetAction attributeNames + */ + + /** + * Constructs a new RemoveFacetAction. + * @memberof google.cloud.retail.v2.Rule + * @classdesc Represents a RemoveFacetAction. + * @implements IRemoveFacetAction + * @constructor + * @param {google.cloud.retail.v2.Rule.IRemoveFacetAction=} [properties] Properties to set + */ + function RemoveFacetAction(properties) { + this.attributeNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveFacetAction attributeNames. + * @member {Array.} attributeNames + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @instance + */ + RemoveFacetAction.prototype.attributeNames = $util.emptyArray; + + /** + * Creates a new RemoveFacetAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IRemoveFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Rule.RemoveFacetAction} RemoveFacetAction instance + */ + RemoveFacetAction.create = function create(properties) { + return new RemoveFacetAction(properties); + }; + + /** + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2.Rule.RemoveFacetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFacetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeNames != null && message.attributeNames.length) + for (var i = 0; i < message.attributeNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeNames[i]); + return writer; + }; + + /** + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Rule.RemoveFacetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFacetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Rule.RemoveFacetAction} RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFacetAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.Rule.RemoveFacetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.attributeNames && message.attributeNames.length)) + message.attributeNames = []; + message.attributeNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Rule.RemoveFacetAction} RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFacetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveFacetAction message. + * @function verify + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFacetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeNames != null && message.hasOwnProperty("attributeNames")) { + if (!Array.isArray(message.attributeNames)) + return "attributeNames: array expected"; + for (var i = 0; i < message.attributeNames.length; ++i) + if (!$util.isString(message.attributeNames[i])) + return "attributeNames: string[] expected"; + } + return null; + }; + + /** + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Rule.RemoveFacetAction} RemoveFacetAction + */ + RemoveFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Rule.RemoveFacetAction) + return object; + var message = new $root.google.cloud.retail.v2.Rule.RemoveFacetAction(); + if (object.attributeNames) { + if (!Array.isArray(object.attributeNames)) + throw TypeError(".google.cloud.retail.v2.Rule.RemoveFacetAction.attributeNames: array expected"); + message.attributeNames = []; + for (var i = 0; i < object.attributeNames.length; ++i) + message.attributeNames[i] = String(object.attributeNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2.Rule.RemoveFacetAction} message RemoveFacetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFacetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributeNames = []; + if (message.attributeNames && message.attributeNames.length) { + object.attributeNames = []; + for (var j = 0; j < message.attributeNames.length; ++j) + object.attributeNames[j] = message.attributeNames[j]; + } + return object; + }; + + /** + * Converts this RemoveFacetAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @instance + * @returns {Object.} JSON object + */ + RemoveFacetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveFacetAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2.Rule.RemoveFacetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.Rule.RemoveFacetAction"; + }; + + return RemoveFacetAction; + })(); + return Rule; })(); @@ -21907,6 +24051,7 @@ * @property {string|null} [deviceType] CompleteQueryRequest deviceType * @property {string|null} [dataset] CompleteQueryRequest dataset * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @property {boolean|null} [enableAttributeSuggestions] CompleteQueryRequest enableAttributeSuggestions * @property {string|null} [entity] CompleteQueryRequest entity */ @@ -21982,6 +24127,14 @@ */ CompleteQueryRequest.prototype.maxSuggestions = 0; + /** + * CompleteQueryRequest enableAttributeSuggestions. + * @member {boolean} enableAttributeSuggestions + * @memberof google.cloud.retail.v2.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.enableAttributeSuggestions = false; + /** * CompleteQueryRequest entity. * @member {string} entity @@ -22029,6 +24182,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); + if (message.enableAttributeSuggestions != null && Object.hasOwnProperty.call(message, "enableAttributeSuggestions")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableAttributeSuggestions); if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.entity); return writer; @@ -22095,6 +24250,10 @@ message.maxSuggestions = reader.int32(); break; } + case 9: { + message.enableAttributeSuggestions = reader.bool(); + break; + } case 10: { message.entity = reader.string(); break; @@ -22159,6 +24318,9 @@ if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) if (!$util.isInteger(message.maxSuggestions)) return "maxSuggestions: integer expected"; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + if (typeof message.enableAttributeSuggestions !== "boolean") + return "enableAttributeSuggestions: boolean expected"; if (message.entity != null && message.hasOwnProperty("entity")) if (!$util.isString(message.entity)) return "entity: string expected"; @@ -22196,6 +24358,8 @@ message.dataset = String(object.dataset); if (object.maxSuggestions != null) message.maxSuggestions = object.maxSuggestions | 0; + if (object.enableAttributeSuggestions != null) + message.enableAttributeSuggestions = Boolean(object.enableAttributeSuggestions); if (object.entity != null) message.entity = String(object.entity); return message; @@ -22223,6 +24387,7 @@ object.maxSuggestions = 0; object.dataset = ""; object.visitorId = ""; + object.enableAttributeSuggestions = false; object.entity = ""; } if (message.catalog != null && message.hasOwnProperty("catalog")) @@ -22242,6 +24407,8 @@ object.dataset = message.dataset; if (message.visitorId != null && message.hasOwnProperty("visitorId")) object.visitorId = message.visitorId; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + object.enableAttributeSuggestions = message.enableAttributeSuggestions; if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; return object; @@ -25138,6 +27305,7 @@ * @property {google.cloud.retail.v2.Model.DataState|null} [dataState] Model dataState * @property {google.cloud.retail.v2.RecommendationsFilteringOption|null} [filteringOption] Model filteringOption * @property {Array.|null} [servingConfigLists] Model servingConfigLists + * @property {google.cloud.retail.v2.Model.IModelFeaturesConfig|null} [modelFeaturesConfig] Model modelFeaturesConfig */ /** @@ -25268,6 +27436,14 @@ */ Model.prototype.servingConfigLists = $util.emptyArray; + /** + * Model modelFeaturesConfig. + * @member {google.cloud.retail.v2.Model.IModelFeaturesConfig|null|undefined} modelFeaturesConfig + * @memberof google.cloud.retail.v2.Model + * @instance + */ + Model.prototype.modelFeaturesConfig = null; + /** * Creates a new Model instance using the specified properties. * @function create @@ -25321,6 +27497,8 @@ if (message.servingConfigLists != null && message.servingConfigLists.length) for (var i = 0; i < message.servingConfigLists.length; ++i) $root.google.cloud.retail.v2.Model.ServingConfigList.encode(message.servingConfigLists[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.modelFeaturesConfig != null && Object.hasOwnProperty.call(message, "modelFeaturesConfig")) + $root.google.cloud.retail.v2.Model.ModelFeaturesConfig.encode(message.modelFeaturesConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; @@ -25413,6 +27591,10 @@ message.servingConfigLists.push($root.google.cloud.retail.v2.Model.ServingConfigList.decode(reader, reader.uint32())); break; } + case 22: { + message.modelFeaturesConfig = $root.google.cloud.retail.v2.Model.ModelFeaturesConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25534,6 +27716,11 @@ return "servingConfigLists." + error; } } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) { + var error = $root.google.cloud.retail.v2.Model.ModelFeaturesConfig.verify(message.modelFeaturesConfig); + if (error) + return "modelFeaturesConfig." + error; + } return null; }; @@ -25692,6 +27879,11 @@ message.servingConfigLists[i] = $root.google.cloud.retail.v2.Model.ServingConfigList.fromObject(object.servingConfigLists[i]); } } + if (object.modelFeaturesConfig != null) { + if (typeof object.modelFeaturesConfig !== "object") + throw TypeError(".google.cloud.retail.v2.Model.modelFeaturesConfig: object expected"); + message.modelFeaturesConfig = $root.google.cloud.retail.v2.Model.ModelFeaturesConfig.fromObject(object.modelFeaturesConfig); + } return message; }; @@ -25724,6 +27916,7 @@ object.tuningOperation = ""; object.dataState = options.enums === String ? "DATA_STATE_UNSPECIFIED" : 0; object.filteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; + object.modelFeaturesConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -25756,6 +27949,8 @@ for (var j = 0; j < message.servingConfigLists.length; ++j) object.servingConfigLists[j] = $root.google.cloud.retail.v2.Model.ServingConfigList.toObject(message.servingConfigLists[j], options); } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) + object.modelFeaturesConfig = $root.google.cloud.retail.v2.Model.ModelFeaturesConfig.toObject(message.modelFeaturesConfig, options); return object; }; @@ -26004,6 +28199,460 @@ return ServingConfigList; })(); + Model.FrequentlyBoughtTogetherFeaturesConfig = (function() { + + /** + * Properties of a FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2.Model + * @interface IFrequentlyBoughtTogetherFeaturesConfig + * @property {google.cloud.retail.v2.Model.ContextProductsType|null} [contextProductsType] FrequentlyBoughtTogetherFeaturesConfig contextProductsType + */ + + /** + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2.Model + * @classdesc Represents a FrequentlyBoughtTogetherFeaturesConfig. + * @implements IFrequentlyBoughtTogetherFeaturesConfig + * @constructor + * @param {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + */ + function FrequentlyBoughtTogetherFeaturesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FrequentlyBoughtTogetherFeaturesConfig contextProductsType. + * @member {google.cloud.retail.v2.Model.ContextProductsType} contextProductsType + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.contextProductsType = 0; + + /** + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig instance + */ + FrequentlyBoughtTogetherFeaturesConfig.create = function create(properties) { + return new FrequentlyBoughtTogetherFeaturesConfig(properties); + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contextProductsType != null && Object.hasOwnProperty.call(message, "contextProductsType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.contextProductsType); + return writer; + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.contextProductsType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. + * @function verify + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FrequentlyBoughtTogetherFeaturesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + switch (message.contextProductsType) { + default: + return "contextProductsType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + */ + FrequentlyBoughtTogetherFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig) + return object; + var message = new $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig(); + switch (object.contextProductsType) { + default: + if (typeof object.contextProductsType === "number") { + message.contextProductsType = object.contextProductsType; + break; + } + break; + case "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": + case 0: + message.contextProductsType = 0; + break; + case "SINGLE_CONTEXT_PRODUCT": + case 1: + message.contextProductsType = 1; + break; + case "MULTIPLE_CONTEXT_PRODUCTS": + case 2: + message.contextProductsType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FrequentlyBoughtTogetherFeaturesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contextProductsType = options.enums === String ? "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" : 0; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + object.contextProductsType = options.enums === String ? $root.google.cloud.retail.v2.Model.ContextProductsType[message.contextProductsType] === undefined ? message.contextProductsType : $root.google.cloud.retail.v2.Model.ContextProductsType[message.contextProductsType] : message.contextProductsType; + return object; + }; + + /** + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + * @returns {Object.} JSON object + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FrequentlyBoughtTogetherFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig"; + }; + + return FrequentlyBoughtTogetherFeaturesConfig; + })(); + + Model.ModelFeaturesConfig = (function() { + + /** + * Properties of a ModelFeaturesConfig. + * @memberof google.cloud.retail.v2.Model + * @interface IModelFeaturesConfig + * @property {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig|null} [frequentlyBoughtTogetherConfig] ModelFeaturesConfig frequentlyBoughtTogetherConfig + */ + + /** + * Constructs a new ModelFeaturesConfig. + * @memberof google.cloud.retail.v2.Model + * @classdesc Represents a ModelFeaturesConfig. + * @implements IModelFeaturesConfig + * @constructor + * @param {google.cloud.retail.v2.Model.IModelFeaturesConfig=} [properties] Properties to set + */ + function ModelFeaturesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelFeaturesConfig frequentlyBoughtTogetherConfig. + * @member {google.cloud.retail.v2.Model.IFrequentlyBoughtTogetherFeaturesConfig|null|undefined} frequentlyBoughtTogetherConfig + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @instance + */ + ModelFeaturesConfig.prototype.frequentlyBoughtTogetherConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelFeaturesConfig typeDedicatedConfig. + * @member {"frequentlyBoughtTogetherConfig"|undefined} typeDedicatedConfig + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @instance + */ + Object.defineProperty(ModelFeaturesConfig.prototype, "typeDedicatedConfig", { + get: $util.oneOfGetter($oneOfFields = ["frequentlyBoughtTogetherConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelFeaturesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IModelFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2.Model.ModelFeaturesConfig} ModelFeaturesConfig instance + */ + ModelFeaturesConfig.create = function create(properties) { + return new ModelFeaturesConfig(properties); + }; + + /** + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2.Model.ModelFeaturesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeaturesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frequentlyBoughtTogetherConfig != null && Object.hasOwnProperty.call(message, "frequentlyBoughtTogetherConfig")) + $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.encode(message.frequentlyBoughtTogetherConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2.Model.ModelFeaturesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.Model.ModelFeaturesConfig} ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeaturesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.Model.ModelFeaturesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.Model.ModelFeaturesConfig} ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelFeaturesConfig message. + * @function verify + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelFeaturesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + properties.typeDedicatedConfig = 1; + { + var error = $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.verify(message.frequentlyBoughtTogetherConfig); + if (error) + return "frequentlyBoughtTogetherConfig." + error; + } + } + return null; + }; + + /** + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.Model.ModelFeaturesConfig} ModelFeaturesConfig + */ + ModelFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.Model.ModelFeaturesConfig) + return object; + var message = new $root.google.cloud.retail.v2.Model.ModelFeaturesConfig(); + if (object.frequentlyBoughtTogetherConfig != null) { + if (typeof object.frequentlyBoughtTogetherConfig !== "object") + throw TypeError(".google.cloud.retail.v2.Model.ModelFeaturesConfig.frequentlyBoughtTogetherConfig: object expected"); + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.fromObject(object.frequentlyBoughtTogetherConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2.Model.ModelFeaturesConfig} message ModelFeaturesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelFeaturesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + object.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2.Model.FrequentlyBoughtTogetherFeaturesConfig.toObject(message.frequentlyBoughtTogetherConfig, options); + if (options.oneofs) + object.typeDedicatedConfig = "frequentlyBoughtTogetherConfig"; + } + return object; + }; + + /** + * Converts this ModelFeaturesConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @instance + * @returns {Object.} JSON object + */ + ModelFeaturesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelFeaturesConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2.Model.ModelFeaturesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.Model.ModelFeaturesConfig"; + }; + + return ModelFeaturesConfig; + })(); + /** * ServingState enum. * @name google.cloud.retail.v2.Model.ServingState @@ -26072,6 +28721,22 @@ return values; })(); + /** + * ContextProductsType enum. + * @name google.cloud.retail.v2.Model.ContextProductsType + * @enum {number} + * @property {number} CONTEXT_PRODUCTS_TYPE_UNSPECIFIED=0 CONTEXT_PRODUCTS_TYPE_UNSPECIFIED value + * @property {number} SINGLE_CONTEXT_PRODUCT=1 SINGLE_CONTEXT_PRODUCT value + * @property {number} MULTIPLE_CONTEXT_PRODUCTS=2 MULTIPLE_CONTEXT_PRODUCTS value + */ + Model.ContextProductsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SINGLE_CONTEXT_PRODUCT"] = 1; + values[valuesById[2] = "MULTIPLE_CONTEXT_PRODUCTS"] = 2; + return values; + })(); + return Model; })(); @@ -30254,6 +32919,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.retail.v2.ProductService|purgeProducts}. + * @memberof google.cloud.retail.v2.ProductService + * @typedef PurgeProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @param {google.cloud.retail.v2.ProductService.PurgeProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.purgeProducts = function purgeProducts(request, callback) { + return this.rpcCall(purgeProducts, $root.google.cloud.retail.v2.PurgeProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeProducts" }); + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2.ProductService + * @instance + * @param {google.cloud.retail.v2.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.retail.v2.ProductService|importProducts}. * @memberof google.cloud.retail.v2.ProductService @@ -35397,26 +38095,27 @@ return PurgeMetadata; })(); - v2.PurgeUserEventsRequest = (function() { + v2.PurgeProductsMetadata = (function() { /** - * Properties of a PurgeUserEventsRequest. + * Properties of a PurgeProductsMetadata. * @memberof google.cloud.retail.v2 - * @interface IPurgeUserEventsRequest - * @property {string|null} [parent] PurgeUserEventsRequest parent - * @property {string|null} [filter] PurgeUserEventsRequest filter - * @property {boolean|null} [force] PurgeUserEventsRequest force + * @interface IPurgeProductsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] PurgeProductsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PurgeProductsMetadata updateTime + * @property {number|Long|null} [successCount] PurgeProductsMetadata successCount + * @property {number|Long|null} [failureCount] PurgeProductsMetadata failureCount */ /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new PurgeProductsMetadata. * @memberof google.cloud.retail.v2 - * @classdesc Represents a PurgeUserEventsRequest. - * @implements IPurgeUserEventsRequest + * @classdesc Represents a PurgeProductsMetadata. + * @implements IPurgeProductsMetadata * @constructor - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2.IPurgeProductsMetadata=} [properties] Properties to set */ - function PurgeUserEventsRequest(properties) { + function PurgeProductsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35424,51 +38123,361 @@ } /** - * PurgeUserEventsRequest parent. + * PurgeProductsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.createTime = null; + + /** + * PurgeProductsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.updateTime = null; + + /** + * PurgeProductsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PurgeProductsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeProductsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeProductsMetadata} PurgeProductsMetadata instance + */ + PurgeProductsMetadata.create = function create(properties) { + return new PurgeProductsMetadata(properties); + }; + + /** + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeProductsMetadata} PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.PurgeProductsMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeProductsMetadata} PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsMetadata message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeProductsMetadata} PurgeProductsMetadata + */ + PurgeProductsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeProductsMetadata) + return object; + var message = new $root.google.cloud.retail.v2.PurgeProductsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2.PurgeProductsMetadata.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.retail.v2.PurgeProductsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2.PurgeProductsMetadata} message PurgeProductsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this PurgeProductsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2.PurgeProductsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.PurgeProductsMetadata"; + }; + + return PurgeProductsMetadata; + })(); + + v2.PurgeProductsRequest = (function() { + + /** + * Properties of a PurgeProductsRequest. + * @memberof google.cloud.retail.v2 + * @interface IPurgeProductsRequest + * @property {string|null} [parent] PurgeProductsRequest parent + * @property {string|null} [filter] PurgeProductsRequest filter + * @property {boolean|null} [force] PurgeProductsRequest force + */ + + /** + * Constructs a new PurgeProductsRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeProductsRequest. + * @implements IPurgeProductsRequest + * @constructor + * @param {google.cloud.retail.v2.IPurgeProductsRequest=} [properties] Properties to set + */ + function PurgeProductsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeProductsRequest parent. * @member {string} parent - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @instance */ - PurgeUserEventsRequest.prototype.parent = ""; + PurgeProductsRequest.prototype.parent = ""; /** - * PurgeUserEventsRequest filter. + * PurgeProductsRequest filter. * @member {string} filter - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @instance */ - PurgeUserEventsRequest.prototype.filter = ""; + PurgeProductsRequest.prototype.filter = ""; /** - * PurgeUserEventsRequest force. + * PurgeProductsRequest force. * @member {boolean} force - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @instance */ - PurgeUserEventsRequest.prototype.force = false; + PurgeProductsRequest.prototype.force = false; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new PurgeProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest instance + * @param {google.cloud.retail.v2.IPurgeProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeProductsRequest} PurgeProductsRequest instance */ - PurgeUserEventsRequest.create = function create(properties) { - return new PurgeUserEventsRequest(properties); + PurgeProductsRequest.create = function create(properties) { + return new PurgeProductsRequest(properties); }; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encode = function encode(message, writer) { + PurgeProductsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -35481,33 +38490,540 @@ }; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + PurgeProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a PurgeProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2.PurgeProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2.PurgeProductsRequest} PurgeProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decode = function decode(reader, length) { + PurgeProductsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.PurgeUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.PurgeProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeProductsRequest} PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsRequest message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeProductsRequest} PurgeProductsRequest + */ + PurgeProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeProductsRequest) + return object; + var message = new $root.google.cloud.retail.v2.PurgeProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @static + * @param {google.cloud.retail.v2.PurgeProductsRequest} message PurgeProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2.PurgeProductsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.PurgeProductsRequest"; + }; + + return PurgeProductsRequest; + })(); + + v2.PurgeProductsResponse = (function() { + + /** + * Properties of a PurgeProductsResponse. + * @memberof google.cloud.retail.v2 + * @interface IPurgeProductsResponse + * @property {number|Long|null} [purgeCount] PurgeProductsResponse purgeCount + * @property {Array.|null} [purgeSample] PurgeProductsResponse purgeSample + */ + + /** + * Constructs a new PurgeProductsResponse. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeProductsResponse. + * @implements IPurgeProductsResponse + * @constructor + * @param {google.cloud.retail.v2.IPurgeProductsResponse=} [properties] Properties to set + */ + function PurgeProductsResponse(properties) { + this.purgeSample = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeProductsResponse purgeCount. + * @member {number|Long} purgeCount + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsResponse purgeSample. + * @member {Array.} purgeSample + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeSample = $util.emptyArray; + + /** + * Creates a new PurgeProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeProductsResponse} PurgeProductsResponse instance + */ + PurgeProductsResponse.create = function create(properties) { + return new PurgeProductsResponse(properties); + }; + + /** + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purgeCount != null && Object.hasOwnProperty.call(message, "purgeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgeCount); + if (message.purgeSample != null && message.purgeSample.length) + for (var i = 0; i < message.purgeSample.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.purgeSample[i]); + return writer; + }; + + /** + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeProductsResponse} PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.PurgeProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.purgeCount = reader.int64(); + break; + } + case 2: { + if (!(message.purgeSample && message.purgeSample.length)) + message.purgeSample = []; + message.purgeSample.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2.PurgeProductsResponse} PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsResponse message. + * @function verify + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (!$util.isInteger(message.purgeCount) && !(message.purgeCount && $util.isInteger(message.purgeCount.low) && $util.isInteger(message.purgeCount.high))) + return "purgeCount: integer|Long expected"; + if (message.purgeSample != null && message.hasOwnProperty("purgeSample")) { + if (!Array.isArray(message.purgeSample)) + return "purgeSample: array expected"; + for (var i = 0; i < message.purgeSample.length; ++i) + if (!$util.isString(message.purgeSample[i])) + return "purgeSample: string[] expected"; + } + return null; + }; + + /** + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2.PurgeProductsResponse} PurgeProductsResponse + */ + PurgeProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2.PurgeProductsResponse) + return object; + var message = new $root.google.cloud.retail.v2.PurgeProductsResponse(); + if (object.purgeCount != null) + if ($util.Long) + (message.purgeCount = $util.Long.fromValue(object.purgeCount)).unsigned = false; + else if (typeof object.purgeCount === "string") + message.purgeCount = parseInt(object.purgeCount, 10); + else if (typeof object.purgeCount === "number") + message.purgeCount = object.purgeCount; + else if (typeof object.purgeCount === "object") + message.purgeCount = new $util.LongBits(object.purgeCount.low >>> 0, object.purgeCount.high >>> 0).toNumber(); + if (object.purgeSample) { + if (!Array.isArray(object.purgeSample)) + throw TypeError(".google.cloud.retail.v2.PurgeProductsResponse.purgeSample: array expected"); + message.purgeSample = []; + for (var i = 0; i < object.purgeSample.length; ++i) + message.purgeSample[i] = String(object.purgeSample[i]); + } + return message; + }; + + /** + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2.PurgeProductsResponse} message PurgeProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeSample = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgeCount = options.longs === String ? "0" : 0; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (typeof message.purgeCount === "number") + object.purgeCount = options.longs === String ? String(message.purgeCount) : message.purgeCount; + else + object.purgeCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgeCount) : options.longs === Number ? new $util.LongBits(message.purgeCount.low >>> 0, message.purgeCount.high >>> 0).toNumber() : message.purgeCount; + if (message.purgeSample && message.purgeSample.length) { + object.purgeSample = []; + for (var j = 0; j < message.purgeSample.length; ++j) + object.purgeSample[j] = message.purgeSample[j]; + } + return object; + }; + + /** + * Converts this PurgeProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2.PurgeProductsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2.PurgeProductsResponse"; + }; + + return PurgeProductsResponse; + })(); + + v2.PurgeUserEventsRequest = (function() { + + /** + * Properties of a PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @interface IPurgeUserEventsRequest + * @property {string|null} [parent] PurgeUserEventsRequest parent + * @property {string|null} [filter] PurgeUserEventsRequest filter + * @property {boolean|null} [force] PurgeUserEventsRequest force + */ + + /** + * Constructs a new PurgeUserEventsRequest. + * @memberof google.cloud.retail.v2 + * @classdesc Represents a PurgeUserEventsRequest. + * @implements IPurgeUserEventsRequest + * @constructor + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + */ + function PurgeUserEventsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.parent = ""; + + /** + * PurgeUserEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.filter = ""; + + /** + * PurgeUserEventsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.force = false; + + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest instance + */ + PurgeUserEventsRequest.create = function create(properties) { + return new PurgeUserEventsRequest(properties); + }; + + /** + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.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 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2.PurgeUserEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {google.cloud.retail.v2.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2.PurgeUserEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2.PurgeUserEventsRequest} PurgeUserEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeUserEventsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2.PurgeUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -41365,6 +44881,7 @@ * @property {string|null} [diversityLevel] ServingConfig diversityLevel * @property {google.cloud.retail.v2.ServingConfig.DiversityType|null} [diversityType] ServingConfig diversityType * @property {string|null} [enableCategoryFilterLevel] ServingConfig enableCategoryFilterLevel + * @property {boolean|null} [ignoreRecsDenylist] ServingConfig ignoreRecsDenylist * @property {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] ServingConfig personalizationSpec * @property {Array.|null} [solutionTypes] ServingConfig solutionTypes */ @@ -41530,6 +45047,14 @@ */ ServingConfig.prototype.enableCategoryFilterLevel = ""; + /** + * ServingConfig ignoreRecsDenylist. + * @member {boolean} ignoreRecsDenylist + * @memberof google.cloud.retail.v2.ServingConfig + * @instance + */ + ServingConfig.prototype.ignoreRecsDenylist = false; + /** * ServingConfig personalizationSpec. * @member {google.cloud.retail.v2.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec @@ -41621,6 +45146,8 @@ writer.uint32(/* id 20, wireType 0 =*/160).int32(message.diversityType); if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.ignoreRecsDenylist != null && Object.hasOwnProperty.call(message, "ignoreRecsDenylist")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.ignoreRecsDenylist); return writer; }; @@ -41741,6 +45268,10 @@ message.enableCategoryFilterLevel = reader.string(); break; } + case 24: { + message.ignoreRecsDenylist = reader.bool(); + break; + } case 21: { message.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); break; @@ -41886,6 +45417,9 @@ if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) if (!$util.isString(message.enableCategoryFilterLevel)) return "enableCategoryFilterLevel: string expected"; + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + if (typeof message.ignoreRecsDenylist !== "boolean") + return "ignoreRecsDenylist: boolean expected"; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { var error = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); if (error) @@ -42019,6 +45553,8 @@ } if (object.enableCategoryFilterLevel != null) message.enableCategoryFilterLevel = String(object.enableCategoryFilterLevel); + if (object.ignoreRecsDenylist != null) + message.ignoreRecsDenylist = Boolean(object.ignoreRecsDenylist); if (object.personalizationSpec != null) { if (typeof object.personalizationSpec !== "object") throw TypeError(".google.cloud.retail.v2.ServingConfig.personalizationSpec: object expected"); @@ -42087,6 +45623,7 @@ object.enableCategoryFilterLevel = ""; object.diversityType = options.enums === String ? "DIVERSITY_TYPE_UNSPECIFIED" : 0; object.personalizationSpec = null; + object.ignoreRecsDenylist = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -42156,6 +45693,8 @@ object.diversityType = options.enums === String ? $root.google.cloud.retail.v2.ServingConfig.DiversityType[message.diversityType] === undefined ? message.diversityType : $root.google.cloud.retail.v2.ServingConfig.DiversityType[message.diversityType] : message.diversityType; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + object.ignoreRecsDenylist = message.ignoreRecsDenylist; return object; }; @@ -48839,25 +52378,47 @@ return GcsOutputResult; })(); - v2alpha.ProductLevelConfig = (function() { + /** + * BranchView enum. + * @name google.cloud.retail.v2alpha.BranchView + * @enum {number} + * @property {number} BRANCH_VIEW_UNSPECIFIED=0 BRANCH_VIEW_UNSPECIFIED value + * @property {number} BRANCH_VIEW_BASIC=1 BRANCH_VIEW_BASIC value + * @property {number} BRANCH_VIEW_FULL=2 BRANCH_VIEW_FULL value + */ + v2alpha.BranchView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BRANCH_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BRANCH_VIEW_BASIC"] = 1; + values[valuesById[2] = "BRANCH_VIEW_FULL"] = 2; + return values; + })(); + + v2alpha.Branch = (function() { /** - * Properties of a ProductLevelConfig. + * Properties of a Branch. * @memberof google.cloud.retail.v2alpha - * @interface IProductLevelConfig - * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType - * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField + * @interface IBranch + * @property {string|null} [name] Branch name + * @property {string|null} [displayName] Branch displayName + * @property {boolean|null} [isDefault] Branch isDefault + * @property {google.protobuf.ITimestamp|null} [lastProductImportTime] Branch lastProductImportTime + * @property {Array.|null} [productCountStats] Branch productCountStats + * @property {Array.|null} [qualityMetrics] Branch qualityMetrics */ /** - * Constructs a new ProductLevelConfig. + * Constructs a new Branch. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductLevelConfig. - * @implements IProductLevelConfig + * @classdesc Represents a Branch. + * @implements IBranch * @constructor - * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IBranch=} [properties] Properties to set */ - function ProductLevelConfig(properties) { + function Branch(properties) { + this.productCountStats = []; + this.qualityMetrics = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48865,89 +52426,151 @@ } /** - * ProductLevelConfig ingestionProductType. - * @member {string} ingestionProductType - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * Branch name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Branch * @instance */ - ProductLevelConfig.prototype.ingestionProductType = ""; + Branch.prototype.name = ""; /** - * ProductLevelConfig merchantCenterProductIdField. - * @member {string} merchantCenterProductIdField - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * Branch displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Branch * @instance */ - ProductLevelConfig.prototype.merchantCenterProductIdField = ""; + Branch.prototype.displayName = ""; /** - * Creates a new ProductLevelConfig instance using the specified properties. + * Branch isDefault. + * @member {boolean} isDefault + * @memberof google.cloud.retail.v2alpha.Branch + * @instance + */ + Branch.prototype.isDefault = false; + + /** + * Branch lastProductImportTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastProductImportTime + * @memberof google.cloud.retail.v2alpha.Branch + * @instance + */ + Branch.prototype.lastProductImportTime = null; + + /** + * Branch productCountStats. + * @member {Array.} productCountStats + * @memberof google.cloud.retail.v2alpha.Branch + * @instance + */ + Branch.prototype.productCountStats = $util.emptyArray; + + /** + * Branch qualityMetrics. + * @member {Array.} qualityMetrics + * @memberof google.cloud.retail.v2alpha.Branch + * @instance + */ + Branch.prototype.qualityMetrics = $util.emptyArray; + + /** + * Creates a new Branch instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig instance + * @param {google.cloud.retail.v2alpha.IBranch=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Branch} Branch instance */ - ProductLevelConfig.create = function create(properties) { - return new ProductLevelConfig(properties); + Branch.create = function create(properties) { + return new Branch(properties); }; /** - * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * Encodes the specified Branch message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBranch} message Branch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductLevelConfig.encode = function encode(message, writer) { + Branch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); - if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); + 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.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isDefault); + if (message.lastProductImportTime != null && Object.hasOwnProperty.call(message, "lastProductImportTime")) + $root.google.protobuf.Timestamp.encode(message.lastProductImportTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.qualityMetrics != null && message.qualityMetrics.length) + for (var i = 0; i < message.qualityMetrics.length; ++i) + $root.google.cloud.retail.v2alpha.Branch.QualityMetric.encode(message.qualityMetrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.productCountStats != null && message.productCountStats.length) + for (var i = 0; i < message.productCountStats.length; ++i) + $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.encode(message.productCountStats[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. + * Encodes the specified Branch message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static - * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBranch} message Branch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { + Branch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer. + * Decodes a Branch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig + * @returns {google.cloud.retail.v2alpha.Branch} Branch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductLevelConfig.decode = function decode(reader, length) { + Branch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Branch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.ingestionProductType = reader.string(); + message.name = reader.string(); break; } case 2: { - message.merchantCenterProductIdField = reader.string(); + message.displayName = reader.string(); + break; + } + case 3: { + message.isDefault = reader.bool(); + break; + } + case 5: { + message.lastProductImportTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.productCountStats && message.productCountStats.length)) + message.productCountStats = []; + message.productCountStats.push($root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.qualityMetrics && message.qualityMetrics.length)) + message.qualityMetrics = []; + message.qualityMetrics.push($root.google.cloud.retail.v2alpha.Branch.QualityMetric.decode(reader, reader.uint32())); break; } default: @@ -48959,139 +52582,881 @@ }; /** - * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. + * Decodes a Branch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig + * @returns {google.cloud.retail.v2alpha.Branch} Branch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { + Branch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductLevelConfig message. + * Verifies a Branch message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductLevelConfig.verify = function verify(message) { + Branch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - if (!$util.isString(message.ingestionProductType)) - return "ingestionProductType: string expected"; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - if (!$util.isString(message.merchantCenterProductIdField)) - return "merchantCenterProductIdField: 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.isDefault != null && message.hasOwnProperty("isDefault")) + if (typeof message.isDefault !== "boolean") + return "isDefault: boolean expected"; + if (message.lastProductImportTime != null && message.hasOwnProperty("lastProductImportTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastProductImportTime); + if (error) + return "lastProductImportTime." + error; + } + if (message.productCountStats != null && message.hasOwnProperty("productCountStats")) { + if (!Array.isArray(message.productCountStats)) + return "productCountStats: array expected"; + for (var i = 0; i < message.productCountStats.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.verify(message.productCountStats[i]); + if (error) + return "productCountStats." + error; + } + } + if (message.qualityMetrics != null && message.hasOwnProperty("qualityMetrics")) { + if (!Array.isArray(message.qualityMetrics)) + return "qualityMetrics: array expected"; + for (var i = 0; i < message.qualityMetrics.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Branch.QualityMetric.verify(message.qualityMetrics[i]); + if (error) + return "qualityMetrics." + error; + } + } return null; }; /** - * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Branch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig + * @returns {google.cloud.retail.v2alpha.Branch} Branch */ - ProductLevelConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductLevelConfig) + Branch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Branch) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); - if (object.ingestionProductType != null) - message.ingestionProductType = String(object.ingestionProductType); - if (object.merchantCenterProductIdField != null) - message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); + var message = new $root.google.cloud.retail.v2alpha.Branch(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.isDefault != null) + message.isDefault = Boolean(object.isDefault); + if (object.lastProductImportTime != null) { + if (typeof object.lastProductImportTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Branch.lastProductImportTime: object expected"); + message.lastProductImportTime = $root.google.protobuf.Timestamp.fromObject(object.lastProductImportTime); + } + if (object.productCountStats) { + if (!Array.isArray(object.productCountStats)) + throw TypeError(".google.cloud.retail.v2alpha.Branch.productCountStats: array expected"); + message.productCountStats = []; + for (var i = 0; i < object.productCountStats.length; ++i) { + if (typeof object.productCountStats[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Branch.productCountStats: object expected"); + message.productCountStats[i] = $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.fromObject(object.productCountStats[i]); + } + } + if (object.qualityMetrics) { + if (!Array.isArray(object.qualityMetrics)) + throw TypeError(".google.cloud.retail.v2alpha.Branch.qualityMetrics: array expected"); + message.qualityMetrics = []; + for (var i = 0; i < object.qualityMetrics.length; ++i) { + if (typeof object.qualityMetrics[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Branch.qualityMetrics: object expected"); + message.qualityMetrics[i] = $root.google.cloud.retail.v2alpha.Branch.QualityMetric.fromObject(object.qualityMetrics[i]); + } + } return message; }; /** - * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. + * Creates a plain object from a Branch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static - * @param {google.cloud.retail.v2alpha.ProductLevelConfig} message ProductLevelConfig + * @param {google.cloud.retail.v2alpha.Branch} message Branch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductLevelConfig.toObject = function toObject(message, options) { + Branch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.qualityMetrics = []; + object.productCountStats = []; + } if (options.defaults) { - object.ingestionProductType = ""; - object.merchantCenterProductIdField = ""; + object.name = ""; + object.displayName = ""; + object.isDefault = false; + object.lastProductImportTime = 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.isDefault != null && message.hasOwnProperty("isDefault")) + object.isDefault = message.isDefault; + if (message.lastProductImportTime != null && message.hasOwnProperty("lastProductImportTime")) + object.lastProductImportTime = $root.google.protobuf.Timestamp.toObject(message.lastProductImportTime, options); + if (message.qualityMetrics && message.qualityMetrics.length) { + object.qualityMetrics = []; + for (var j = 0; j < message.qualityMetrics.length; ++j) + object.qualityMetrics[j] = $root.google.cloud.retail.v2alpha.Branch.QualityMetric.toObject(message.qualityMetrics[j], options); + } + if (message.productCountStats && message.productCountStats.length) { + object.productCountStats = []; + for (var j = 0; j < message.productCountStats.length; ++j) + object.productCountStats[j] = $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.toObject(message.productCountStats[j], options); } - if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) - object.ingestionProductType = message.ingestionProductType; - if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) - object.merchantCenterProductIdField = message.merchantCenterProductIdField; return object; }; /** - * Converts this ProductLevelConfig to JSON. + * Converts this Branch to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @instance * @returns {Object.} JSON object */ - ProductLevelConfig.prototype.toJSON = function toJSON() { + Branch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProductLevelConfig + * Gets the default type url for Branch * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ProductLevelConfig + * @memberof google.cloud.retail.v2alpha.Branch * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProductLevelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Branch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductLevelConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Branch"; }; - return ProductLevelConfig; + Branch.ProductCountStatistic = (function() { + + /** + * Properties of a ProductCountStatistic. + * @memberof google.cloud.retail.v2alpha.Branch + * @interface IProductCountStatistic + * @property {google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope|null} [scope] ProductCountStatistic scope + * @property {Object.|null} [counts] ProductCountStatistic counts + */ + + /** + * Constructs a new ProductCountStatistic. + * @memberof google.cloud.retail.v2alpha.Branch + * @classdesc Represents a ProductCountStatistic. + * @implements IProductCountStatistic + * @constructor + * @param {google.cloud.retail.v2alpha.Branch.IProductCountStatistic=} [properties] Properties to set + */ + function ProductCountStatistic(properties) { + this.counts = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProductCountStatistic scope. + * @member {google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope} scope + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @instance + */ + ProductCountStatistic.prototype.scope = 0; + + /** + * ProductCountStatistic counts. + * @member {Object.} counts + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @instance + */ + ProductCountStatistic.prototype.counts = $util.emptyObject; + + /** + * Creates a new ProductCountStatistic instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {google.cloud.retail.v2alpha.Branch.IProductCountStatistic=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Branch.ProductCountStatistic} ProductCountStatistic instance + */ + ProductCountStatistic.create = function create(properties) { + return new ProductCountStatistic(properties); + }; + + /** + * Encodes the specified ProductCountStatistic message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.ProductCountStatistic.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {google.cloud.retail.v2alpha.Branch.IProductCountStatistic} message ProductCountStatistic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductCountStatistic.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.scope); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + for (var keys = Object.keys(message.counts), 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 0 =*/16).int64(message.counts[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProductCountStatistic message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.ProductCountStatistic.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {google.cloud.retail.v2alpha.Branch.IProductCountStatistic} message ProductCountStatistic message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProductCountStatistic.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProductCountStatistic message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Branch.ProductCountStatistic} ProductCountStatistic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductCountStatistic.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.int32(); + break; + } + case 2: { + if (message.counts === $util.emptyObject) + message.counts = {}; + 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.counts[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductCountStatistic message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Branch.ProductCountStatistic} ProductCountStatistic + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductCountStatistic.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductCountStatistic message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductCountStatistic.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!$util.isObject(message.counts)) + return "counts: object expected"; + var key = Object.keys(message.counts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) + return "counts: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a ProductCountStatistic message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Branch.ProductCountStatistic} ProductCountStatistic + */ + ProductCountStatistic.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic) + return object; + var message = new $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic(); + switch (object.scope) { + default: + if (typeof object.scope === "number") { + message.scope = object.scope; + break; + } + break; + case "PRODUCT_COUNT_SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "ALL_PRODUCTS": + case 1: + message.scope = 1; + break; + case "LAST_24_HOUR_UPDATE": + case 2: + message.scope = 2; + break; + } + if (object.counts) { + if (typeof object.counts !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Branch.ProductCountStatistic.counts: object expected"); + message.counts = {}; + for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; + else if (typeof object.counts[keys[i]] === "string") + message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); + else if (typeof object.counts[keys[i]] === "number") + message.counts[keys[i]] = object.counts[keys[i]]; + else if (typeof object.counts[keys[i]] === "object") + message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a ProductCountStatistic message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {google.cloud.retail.v2alpha.Branch.ProductCountStatistic} message ProductCountStatistic + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductCountStatistic.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.counts = {}; + if (options.defaults) + object.scope = options.enums === String ? "PRODUCT_COUNT_SCOPE_UNSPECIFIED" : 0; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope[message.scope] === undefined ? message.scope : $root.google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope[message.scope] : message.scope; + var keys2; + if (message.counts && (keys2 = Object.keys(message.counts)).length) { + object.counts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.counts[keys2[j]] === "number") + object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; + else + object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; + } + return object; + }; + + /** + * Converts this ProductCountStatistic to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @instance + * @returns {Object.} JSON object + */ + ProductCountStatistic.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProductCountStatistic + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Branch.ProductCountStatistic + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProductCountStatistic.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Branch.ProductCountStatistic"; + }; + + /** + * ProductCountScope enum. + * @name google.cloud.retail.v2alpha.Branch.ProductCountStatistic.ProductCountScope + * @enum {number} + * @property {number} PRODUCT_COUNT_SCOPE_UNSPECIFIED=0 PRODUCT_COUNT_SCOPE_UNSPECIFIED value + * @property {number} ALL_PRODUCTS=1 ALL_PRODUCTS value + * @property {number} LAST_24_HOUR_UPDATE=2 LAST_24_HOUR_UPDATE value + */ + ProductCountStatistic.ProductCountScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRODUCT_COUNT_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL_PRODUCTS"] = 1; + values[valuesById[2] = "LAST_24_HOUR_UPDATE"] = 2; + return values; + })(); + + return ProductCountStatistic; + })(); + + Branch.QualityMetric = (function() { + + /** + * Properties of a QualityMetric. + * @memberof google.cloud.retail.v2alpha.Branch + * @interface IQualityMetric + * @property {string|null} [requirementKey] QualityMetric requirementKey + * @property {number|null} [qualifiedProductCount] QualityMetric qualifiedProductCount + * @property {number|null} [unqualifiedProductCount] QualityMetric unqualifiedProductCount + * @property {number|null} [suggestedQualityPercentThreshold] QualityMetric suggestedQualityPercentThreshold + * @property {Array.|null} [unqualifiedSampleProducts] QualityMetric unqualifiedSampleProducts + */ + + /** + * Constructs a new QualityMetric. + * @memberof google.cloud.retail.v2alpha.Branch + * @classdesc Represents a QualityMetric. + * @implements IQualityMetric + * @constructor + * @param {google.cloud.retail.v2alpha.Branch.IQualityMetric=} [properties] Properties to set + */ + function QualityMetric(properties) { + this.unqualifiedSampleProducts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QualityMetric requirementKey. + * @member {string} requirementKey + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + */ + QualityMetric.prototype.requirementKey = ""; + + /** + * QualityMetric qualifiedProductCount. + * @member {number} qualifiedProductCount + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + */ + QualityMetric.prototype.qualifiedProductCount = 0; + + /** + * QualityMetric unqualifiedProductCount. + * @member {number} unqualifiedProductCount + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + */ + QualityMetric.prototype.unqualifiedProductCount = 0; + + /** + * QualityMetric suggestedQualityPercentThreshold. + * @member {number} suggestedQualityPercentThreshold + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + */ + QualityMetric.prototype.suggestedQualityPercentThreshold = 0; + + /** + * QualityMetric unqualifiedSampleProducts. + * @member {Array.} unqualifiedSampleProducts + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + */ + QualityMetric.prototype.unqualifiedSampleProducts = $util.emptyArray; + + /** + * Creates a new QualityMetric instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {google.cloud.retail.v2alpha.Branch.IQualityMetric=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Branch.QualityMetric} QualityMetric instance + */ + QualityMetric.create = function create(properties) { + return new QualityMetric(properties); + }; + + /** + * Encodes the specified QualityMetric message. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.QualityMetric.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {google.cloud.retail.v2alpha.Branch.IQualityMetric} message QualityMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QualityMetric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requirementKey != null && Object.hasOwnProperty.call(message, "requirementKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requirementKey); + if (message.qualifiedProductCount != null && Object.hasOwnProperty.call(message, "qualifiedProductCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.qualifiedProductCount); + if (message.unqualifiedProductCount != null && Object.hasOwnProperty.call(message, "unqualifiedProductCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.unqualifiedProductCount); + if (message.suggestedQualityPercentThreshold != null && Object.hasOwnProperty.call(message, "suggestedQualityPercentThreshold")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.suggestedQualityPercentThreshold); + if (message.unqualifiedSampleProducts != null && message.unqualifiedSampleProducts.length) + for (var i = 0; i < message.unqualifiedSampleProducts.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.unqualifiedSampleProducts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QualityMetric message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Branch.QualityMetric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {google.cloud.retail.v2alpha.Branch.IQualityMetric} message QualityMetric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QualityMetric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QualityMetric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Branch.QualityMetric} QualityMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QualityMetric.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Branch.QualityMetric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requirementKey = reader.string(); + break; + } + case 2: { + message.qualifiedProductCount = reader.int32(); + break; + } + case 3: { + message.unqualifiedProductCount = reader.int32(); + break; + } + case 4: { + message.suggestedQualityPercentThreshold = reader.double(); + break; + } + case 5: { + if (!(message.unqualifiedSampleProducts && message.unqualifiedSampleProducts.length)) + message.unqualifiedSampleProducts = []; + message.unqualifiedSampleProducts.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QualityMetric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Branch.QualityMetric} QualityMetric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QualityMetric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QualityMetric message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QualityMetric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requirementKey != null && message.hasOwnProperty("requirementKey")) + if (!$util.isString(message.requirementKey)) + return "requirementKey: string expected"; + if (message.qualifiedProductCount != null && message.hasOwnProperty("qualifiedProductCount")) + if (!$util.isInteger(message.qualifiedProductCount)) + return "qualifiedProductCount: integer expected"; + if (message.unqualifiedProductCount != null && message.hasOwnProperty("unqualifiedProductCount")) + if (!$util.isInteger(message.unqualifiedProductCount)) + return "unqualifiedProductCount: integer expected"; + if (message.suggestedQualityPercentThreshold != null && message.hasOwnProperty("suggestedQualityPercentThreshold")) + if (typeof message.suggestedQualityPercentThreshold !== "number") + return "suggestedQualityPercentThreshold: number expected"; + if (message.unqualifiedSampleProducts != null && message.hasOwnProperty("unqualifiedSampleProducts")) { + if (!Array.isArray(message.unqualifiedSampleProducts)) + return "unqualifiedSampleProducts: array expected"; + for (var i = 0; i < message.unqualifiedSampleProducts.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.unqualifiedSampleProducts[i]); + if (error) + return "unqualifiedSampleProducts." + error; + } + } + return null; + }; + + /** + * Creates a QualityMetric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Branch.QualityMetric} QualityMetric + */ + QualityMetric.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Branch.QualityMetric) + return object; + var message = new $root.google.cloud.retail.v2alpha.Branch.QualityMetric(); + if (object.requirementKey != null) + message.requirementKey = String(object.requirementKey); + if (object.qualifiedProductCount != null) + message.qualifiedProductCount = object.qualifiedProductCount | 0; + if (object.unqualifiedProductCount != null) + message.unqualifiedProductCount = object.unqualifiedProductCount | 0; + if (object.suggestedQualityPercentThreshold != null) + message.suggestedQualityPercentThreshold = Number(object.suggestedQualityPercentThreshold); + if (object.unqualifiedSampleProducts) { + if (!Array.isArray(object.unqualifiedSampleProducts)) + throw TypeError(".google.cloud.retail.v2alpha.Branch.QualityMetric.unqualifiedSampleProducts: array expected"); + message.unqualifiedSampleProducts = []; + for (var i = 0; i < object.unqualifiedSampleProducts.length; ++i) { + if (typeof object.unqualifiedSampleProducts[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Branch.QualityMetric.unqualifiedSampleProducts: object expected"); + message.unqualifiedSampleProducts[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.unqualifiedSampleProducts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QualityMetric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {google.cloud.retail.v2alpha.Branch.QualityMetric} message QualityMetric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QualityMetric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unqualifiedSampleProducts = []; + if (options.defaults) { + object.requirementKey = ""; + object.qualifiedProductCount = 0; + object.unqualifiedProductCount = 0; + object.suggestedQualityPercentThreshold = 0; + } + if (message.requirementKey != null && message.hasOwnProperty("requirementKey")) + object.requirementKey = message.requirementKey; + if (message.qualifiedProductCount != null && message.hasOwnProperty("qualifiedProductCount")) + object.qualifiedProductCount = message.qualifiedProductCount; + if (message.unqualifiedProductCount != null && message.hasOwnProperty("unqualifiedProductCount")) + object.unqualifiedProductCount = message.unqualifiedProductCount; + if (message.suggestedQualityPercentThreshold != null && message.hasOwnProperty("suggestedQualityPercentThreshold")) + object.suggestedQualityPercentThreshold = options.json && !isFinite(message.suggestedQualityPercentThreshold) ? String(message.suggestedQualityPercentThreshold) : message.suggestedQualityPercentThreshold; + if (message.unqualifiedSampleProducts && message.unqualifiedSampleProducts.length) { + object.unqualifiedSampleProducts = []; + for (var j = 0; j < message.unqualifiedSampleProducts.length; ++j) + object.unqualifiedSampleProducts[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.unqualifiedSampleProducts[j], options); + } + return object; + }; + + /** + * Converts this QualityMetric to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @instance + * @returns {Object.} JSON object + */ + QualityMetric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QualityMetric + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Branch.QualityMetric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QualityMetric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Branch.QualityMetric"; + }; + + return QualityMetric; + })(); + + return Branch; })(); - v2alpha.CatalogAttribute = (function() { + v2alpha.Product = (function() { /** - * Properties of a CatalogAttribute. + * Properties of a Product. * @memberof google.cloud.retail.v2alpha - * @interface ICatalogAttribute - * @property {string|null} [key] CatalogAttribute key - * @property {boolean|null} [inUse] CatalogAttribute inUse - * @property {google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|null} [type] CatalogAttribute type - * @property {google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|null} [indexableOption] CatalogAttribute indexableOption - * @property {google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|null} [dynamicFacetableOption] CatalogAttribute dynamicFacetableOption - * @property {google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|null} [searchableOption] CatalogAttribute searchableOption - * @property {google.cloud.retail.v2alpha.RecommendationsFilteringOption|null} [recommendationsFilteringOption] CatalogAttribute recommendationsFilteringOption - * @property {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null} [exactSearchableOption] CatalogAttribute exactSearchableOption - * @property {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null} [retrievableOption] CatalogAttribute retrievableOption + * @interface IProduct + * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime + * @property {google.protobuf.IDuration|null} [ttl] Product ttl + * @property {string|null} [name] Product name + * @property {string|null} [id] Product id + * @property {google.cloud.retail.v2alpha.Product.Type|null} [type] Product type + * @property {string|null} [primaryProductId] Product primaryProductId + * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds + * @property {string|null} [gtin] Product gtin + * @property {Array.|null} [categories] Product categories + * @property {string|null} [title] Product title + * @property {Array.|null} [brands] Product brands + * @property {string|null} [description] Product description + * @property {string|null} [languageCode] Product languageCode + * @property {Object.|null} [attributes] Product attributes + * @property {Array.|null} [tags] Product tags + * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] Product priceInfo + * @property {google.cloud.retail.v2alpha.IRating|null} [rating] Product rating + * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime + * @property {google.cloud.retail.v2alpha.Product.Availability|null} [availability] Product availability + * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity + * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo + * @property {string|null} [uri] Product uri + * @property {Array.|null} [images] Product images + * @property {google.cloud.retail.v2alpha.IAudience|null} [audience] Product audience + * @property {google.cloud.retail.v2alpha.IColorInfo|null} [colorInfo] Product colorInfo + * @property {Array.|null} [sizes] Product sizes + * @property {Array.|null} [materials] Product materials + * @property {Array.|null} [patterns] Product patterns + * @property {Array.|null} [conditions] Product conditions + * @property {Array.|null} [promotions] Product promotions + * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime + * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields + * @property {Array.|null} [variants] Product variants + * @property {Array.|null} [localInventories] Product localInventories */ /** - * Constructs a new CatalogAttribute. + * Constructs a new Product. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CatalogAttribute. - * @implements ICatalogAttribute + * @classdesc Represents a Product. + * @implements IProduct * @constructor - * @param {google.cloud.retail.v2alpha.ICatalogAttribute=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set */ - function CatalogAttribute(properties) { + function Product(properties) { + this.collectionMemberIds = []; + this.categories = []; + this.brands = []; + this.attributes = {}; + this.tags = []; + this.fulfillmentInfo = []; + this.images = []; + this.sizes = []; + this.materials = []; + this.patterns = []; + this.conditions = []; + this.promotions = []; + this.variants = []; + this.localInventories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49099,187 +53464,612 @@ } /** - * CatalogAttribute key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.key = ""; + Product.prototype.expireTime = null; /** - * CatalogAttribute inUse. - * @member {boolean} inUse - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.inUse = false; + Product.prototype.ttl = null; /** - * CatalogAttribute type. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.AttributeType} type - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.type = 0; + Product.prototype.name = ""; /** - * CatalogAttribute indexableOption. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption} indexableOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.indexableOption = 0; + Product.prototype.id = ""; /** - * CatalogAttribute dynamicFacetableOption. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption} dynamicFacetableOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product type. + * @member {google.cloud.retail.v2alpha.Product.Type} type + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.dynamicFacetableOption = 0; + Product.prototype.type = 0; /** - * CatalogAttribute searchableOption. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption} searchableOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product primaryProductId. + * @member {string} primaryProductId + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.searchableOption = 0; + Product.prototype.primaryProductId = ""; /** - * CatalogAttribute recommendationsFilteringOption. - * @member {google.cloud.retail.v2alpha.RecommendationsFilteringOption} recommendationsFilteringOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product collectionMemberIds. + * @member {Array.} collectionMemberIds + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.recommendationsFilteringOption = 0; + Product.prototype.collectionMemberIds = $util.emptyArray; /** - * CatalogAttribute exactSearchableOption. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption} exactSearchableOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product gtin. + * @member {string} gtin + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.exactSearchableOption = 0; + Product.prototype.gtin = ""; /** - * CatalogAttribute retrievableOption. - * @member {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption} retrievableOption - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * Product categories. + * @member {Array.} categories + * @memberof google.cloud.retail.v2alpha.Product * @instance */ - CatalogAttribute.prototype.retrievableOption = 0; + Product.prototype.categories = $util.emptyArray; /** - * Creates a new CatalogAttribute instance using the specified properties. + * Product title. + * @member {string} title + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.title = ""; + + /** + * Product brands. + * @member {Array.} brands + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.brands = $util.emptyArray; + + /** + * Product description. + * @member {string} description + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.description = ""; + + /** + * Product languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.languageCode = ""; + + /** + * Product attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.attributes = $util.emptyObject; + + /** + * Product tags. + * @member {Array.} tags + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.tags = $util.emptyArray; + + /** + * Product priceInfo. + * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.priceInfo = null; + + /** + * Product rating. + * @member {google.cloud.retail.v2alpha.IRating|null|undefined} rating + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.rating = null; + + /** + * Product availableTime. + * @member {google.protobuf.ITimestamp|null|undefined} availableTime + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.availableTime = null; + + /** + * Product availability. + * @member {google.cloud.retail.v2alpha.Product.Availability} availability + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.availability = 0; + + /** + * Product availableQuantity. + * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.availableQuantity = null; + + /** + * Product fulfillmentInfo. + * @member {Array.} fulfillmentInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.fulfillmentInfo = $util.emptyArray; + + /** + * Product uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.uri = ""; + + /** + * Product images. + * @member {Array.} images + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.images = $util.emptyArray; + + /** + * Product audience. + * @member {google.cloud.retail.v2alpha.IAudience|null|undefined} audience + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.audience = null; + + /** + * Product colorInfo. + * @member {google.cloud.retail.v2alpha.IColorInfo|null|undefined} colorInfo + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.colorInfo = null; + + /** + * Product sizes. + * @member {Array.} sizes + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.sizes = $util.emptyArray; + + /** + * Product materials. + * @member {Array.} materials + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.materials = $util.emptyArray; + + /** + * Product patterns. + * @member {Array.} patterns + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.patterns = $util.emptyArray; + + /** + * Product conditions. + * @member {Array.} conditions + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.conditions = $util.emptyArray; + + /** + * Product promotions. + * @member {Array.} promotions + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.promotions = $util.emptyArray; + + /** + * Product publishTime. + * @member {google.protobuf.ITimestamp|null|undefined} publishTime + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.publishTime = null; + + /** + * Product retrievableFields. + * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.retrievableFields = null; + + /** + * Product variants. + * @member {Array.} variants + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.variants = $util.emptyArray; + + /** + * Product localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Product.prototype.localInventories = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Product expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.retail.v2alpha.Product + * @instance + */ + Object.defineProperty(Product.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Product instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.ICatalogAttribute=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute instance + * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Product} Product instance */ - CatalogAttribute.create = function create(properties) { - return new CatalogAttribute(properties); + Product.create = function create(properties) { + return new Product(properties); }; /** - * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. + * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.ICatalogAttribute} message CatalogAttribute message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CatalogAttribute.encode = function encode(message, writer) { + Product.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.indexableOption != null && Object.hasOwnProperty.call(message, "indexableOption")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.indexableOption); - if (message.dynamicFacetableOption != null && Object.hasOwnProperty.call(message, "dynamicFacetableOption")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dynamicFacetableOption); - if (message.searchableOption != null && Object.hasOwnProperty.call(message, "searchableOption")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.searchableOption); - if (message.recommendationsFilteringOption != null && Object.hasOwnProperty.call(message, "recommendationsFilteringOption")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.recommendationsFilteringOption); - if (message.inUse != null && Object.hasOwnProperty.call(message, "inUse")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.inUse); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); - if (message.exactSearchableOption != null && Object.hasOwnProperty.call(message, "exactSearchableOption")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.exactSearchableOption); - if (message.retrievableOption != null && Object.hasOwnProperty.call(message, "retrievableOption")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.retrievableOption); + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); + if (message.collectionMemberIds != null && message.collectionMemberIds.length) + for (var i = 0; i < message.collectionMemberIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); + if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); + if (message.brands != null && message.brands.length) + for (var i = 0; i < message.brands.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); + if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) + $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + $root.google.cloud.retail.v2alpha.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) + $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); + if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) + $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) + for (var i = 0; i < message.fulfillmentInfo.length; ++i) + $root.google.cloud.retail.v2alpha.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + $root.google.cloud.retail.v2alpha.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + $root.google.cloud.retail.v2alpha.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) + $root.google.cloud.retail.v2alpha.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.sizes != null && message.sizes.length) + for (var i = 0; i < message.sizes.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); + if (message.materials != null && message.materials.length) + for (var i = 0; i < message.materials.length; ++i) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); + if (message.patterns != null && message.patterns.length) + for (var i = 0; i < message.patterns.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); + if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) + $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.variants != null && message.variants.length) + for (var i = 0; i < message.variants.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) + $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.promotions != null && message.promotions.length) + for (var i = 0; i < message.promotions.length; ++i) + $root.google.cloud.retail.v2alpha.Promotion.encode(message.promotions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.localInventories != null && message.localInventories.length) + for (var i = 0; i < message.localInventories.length; ++i) + $root.google.cloud.retail.v2alpha.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); return writer; }; /** - * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.ICatalogAttribute} message CatalogAttribute message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CatalogAttribute.encodeDelimited = function encodeDelimited(message, writer) { + Product.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CatalogAttribute message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute + * @returns {google.cloud.retail.v2alpha.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CatalogAttribute.decode = function decode(reader, length) { + Product.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Product(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.key = reader.string(); + case 16: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 9: { - message.inUse = reader.bool(); + case 17: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } - case 10: { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { message.type = reader.int32(); break; } + case 4: { + message.primaryProductId = reader.string(); + break; + } case 5: { - message.indexableOption = reader.int32(); + if (!(message.collectionMemberIds && message.collectionMemberIds.length)) + message.collectionMemberIds = []; + message.collectionMemberIds.push(reader.string()); break; } case 6: { - message.dynamicFacetableOption = reader.int32(); + message.gtin = reader.string(); break; } case 7: { - message.searchableOption = reader.int32(); + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push(reader.string()); break; } case 8: { - message.recommendationsFilteringOption = reader.int32(); + message.title = reader.string(); + break; + } + case 9: { + if (!(message.brands && message.brands.length)) + message.brands = []; + message.brands.push(reader.string()); + break; + } + case 10: { + message.description = reader.string(); break; } case 11: { - message.exactSearchableOption = reader.int32(); + message.languageCode = reader.string(); break; } case 12: { - message.retrievableOption = reader.int32(); + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 13: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 14: { + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + message.rating = $root.google.cloud.retail.v2alpha.Rating.decode(reader, reader.uint32()); + break; + } + case 18: { + message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + message.availability = reader.int32(); + break; + } + case 20: { + message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + break; + } + case 21: { + if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) + message.fulfillmentInfo = []; + message.fulfillmentInfo.push($root.google.cloud.retail.v2alpha.FulfillmentInfo.decode(reader, reader.uint32())); + break; + } + case 22: { + message.uri = reader.string(); + break; + } + case 23: { + if (!(message.images && message.images.length)) + message.images = []; + message.images.push($root.google.cloud.retail.v2alpha.Image.decode(reader, reader.uint32())); + break; + } + case 24: { + message.audience = $root.google.cloud.retail.v2alpha.Audience.decode(reader, reader.uint32()); + break; + } + case 25: { + message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.decode(reader, reader.uint32()); + break; + } + case 26: { + if (!(message.sizes && message.sizes.length)) + message.sizes = []; + message.sizes.push(reader.string()); + break; + } + case 27: { + if (!(message.materials && message.materials.length)) + message.materials = []; + message.materials.push(reader.string()); + break; + } + case 28: { + if (!(message.patterns && message.patterns.length)) + message.patterns = []; + message.patterns.push(reader.string()); + break; + } + case 29: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push(reader.string()); + break; + } + case 34: { + if (!(message.promotions && message.promotions.length)) + message.promotions = []; + message.promotions.push($root.google.cloud.retail.v2alpha.Promotion.decode(reader, reader.uint32())); + break; + } + case 33: { + message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 30: { + message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 31: { + if (!(message.variants && message.variants.length)) + message.variants = []; + message.variants.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + break; + } + case 35: { + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); break; } default: @@ -49291,38 +54081,57 @@ }; /** - * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute + * @returns {google.cloud.retail.v2alpha.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CatalogAttribute.decodeDelimited = function decodeDelimited(reader) { + Product.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CatalogAttribute message. + * Verifies a Product message. * @function verify - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CatalogAttribute.verify = function verify(message) { + Product.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.inUse != null && message.hasOwnProperty("inUse")) - if (typeof message.inUse !== "boolean") - return "inUse: boolean expected"; + var properties = {}; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; if (message.type != null && message.hasOwnProperty("type")) switch (message.type) { default: @@ -49330,81 +54139,218 @@ case 0: case 1: case 2: + case 3: break; } - if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) - switch (message.indexableOption) { - default: - return "indexableOption: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + if (!$util.isString(message.primaryProductId)) + return "primaryProductId: string expected"; + if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { + if (!Array.isArray(message.collectionMemberIds)) + return "collectionMemberIds: array expected"; + for (var i = 0; i < message.collectionMemberIds.length; ++i) + if (!$util.isString(message.collectionMemberIds[i])) + return "collectionMemberIds: string[] expected"; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + if (!$util.isString(message.gtin)) + return "gtin: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) + if (!$util.isString(message.categories[i])) + return "categories: string[] expected"; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.brands != null && message.hasOwnProperty("brands")) { + if (!Array.isArray(message.brands)) + return "brands: array expected"; + for (var i = 0; i < message.brands.length; ++i) + if (!$util.isString(message.brands[i])) + return "brands: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; } - if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) - switch (message.dynamicFacetableOption) { + } + 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"; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { + var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); + if (error) + return "priceInfo." + error; + } + if (message.rating != null && message.hasOwnProperty("rating")) { + var error = $root.google.cloud.retail.v2alpha.Rating.verify(message.rating); + if (error) + return "rating." + error; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.availableTime); + if (error) + return "availableTime." + error; + } + if (message.availability != null && message.hasOwnProperty("availability")) + switch (message.availability) { default: - return "dynamicFacetableOption: enum value expected"; + return "availability: enum value expected"; case 0: case 1: case 2: + case 3: + case 4: break; } - if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) - switch (message.searchableOption) { - default: - return "searchableOption: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); + if (error) + return "availableQuantity." + error; + } + if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { + if (!Array.isArray(message.fulfillmentInfo)) + return "fulfillmentInfo: array expected"; + for (var i = 0; i < message.fulfillmentInfo.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.FulfillmentInfo.verify(message.fulfillmentInfo[i]); + if (error) + return "fulfillmentInfo." + error; } - if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) - switch (message.recommendationsFilteringOption) { - default: - return "recommendationsFilteringOption: enum value expected"; - case 0: - case 1: - case 3: - break; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Image.verify(message.images[i]); + if (error) + return "images." + error; } - if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) - switch (message.exactSearchableOption) { - default: - return "exactSearchableOption: enum value expected"; - case 0: - case 1: - case 2: - break; + } + if (message.audience != null && message.hasOwnProperty("audience")) { + var error = $root.google.cloud.retail.v2alpha.Audience.verify(message.audience); + if (error) + return "audience." + error; + } + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { + var error = $root.google.cloud.retail.v2alpha.ColorInfo.verify(message.colorInfo); + if (error) + return "colorInfo." + error; + } + if (message.sizes != null && message.hasOwnProperty("sizes")) { + if (!Array.isArray(message.sizes)) + return "sizes: array expected"; + for (var i = 0; i < message.sizes.length; ++i) + if (!$util.isString(message.sizes[i])) + return "sizes: string[] expected"; + } + if (message.materials != null && message.hasOwnProperty("materials")) { + if (!Array.isArray(message.materials)) + return "materials: array expected"; + for (var i = 0; i < message.materials.length; ++i) + if (!$util.isString(message.materials[i])) + return "materials: string[] expected"; + } + if (message.patterns != null && message.hasOwnProperty("patterns")) { + if (!Array.isArray(message.patterns)) + return "patterns: array expected"; + for (var i = 0; i < message.patterns.length; ++i) + if (!$util.isString(message.patterns[i])) + return "patterns: string[] expected"; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) + if (!$util.isString(message.conditions[i])) + return "conditions: string[] expected"; + } + if (message.promotions != null && message.hasOwnProperty("promotions")) { + if (!Array.isArray(message.promotions)) + return "promotions: array expected"; + for (var i = 0; i < message.promotions.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Promotion.verify(message.promotions[i]); + if (error) + return "promotions." + error; } - if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) - switch (message.retrievableOption) { - default: - return "retrievableOption: enum value expected"; - case 0: - case 1: - case 2: - break; + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.publishTime); + if (error) + return "publishTime." + error; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { + var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); + if (error) + return "retrievableFields." + error; + } + if (message.variants != null && message.hasOwnProperty("variants")) { + if (!Array.isArray(message.variants)) + return "variants: array expected"; + for (var i = 0; i < message.variants.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.variants[i]); + if (error) + return "variants." + error; + } + } + if (message.localInventories != null && message.hasOwnProperty("localInventories")) { + if (!Array.isArray(message.localInventories)) + return "localInventories: array expected"; + for (var i = 0; i < message.localInventories.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.LocalInventory.verify(message.localInventories[i]); + if (error) + return "localInventories." + error; } + } return null; }; /** - * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute + * @returns {google.cloud.retail.v2alpha.Product} Product */ - CatalogAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute) + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Product) return object; - var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute(); - if (object.key != null) - message.key = String(object.key); - if (object.inUse != null) - message.inUse = Boolean(object.inUse); + var message = new $root.google.cloud.retail.v2alpha.Product(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); switch (object.type) { default: if (typeof object.type === "number") { @@ -49412,333 +54358,546 @@ break; } break; - case "UNKNOWN": + case "TYPE_UNSPECIFIED": case 0: message.type = 0; break; - case "TEXTUAL": + case "PRIMARY": case 1: message.type = 1; break; - case "NUMERICAL": + case "VARIANT": case 2: message.type = 2; break; + case "COLLECTION": + case 3: + message.type = 3; + break; } - switch (object.indexableOption) { - default: - if (typeof object.indexableOption === "number") { - message.indexableOption = object.indexableOption; - break; + if (object.primaryProductId != null) + message.primaryProductId = String(object.primaryProductId); + if (object.collectionMemberIds) { + if (!Array.isArray(object.collectionMemberIds)) + throw TypeError(".google.cloud.retail.v2alpha.Product.collectionMemberIds: array expected"); + message.collectionMemberIds = []; + for (var i = 0; i < object.collectionMemberIds.length; ++i) + message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); + } + if (object.gtin != null) + message.gtin = String(object.gtin); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.retail.v2alpha.Product.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) + message.categories[i] = String(object.categories[i]); + } + if (object.title != null) + message.title = String(object.title); + if (object.brands) { + if (!Array.isArray(object.brands)) + throw TypeError(".google.cloud.retail.v2alpha.Product.brands: array expected"); + message.brands = []; + for (var i = 0; i < object.brands.length; ++i) + message.brands[i] = String(object.brands[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); } - break; - case "INDEXABLE_OPTION_UNSPECIFIED": - case 0: - message.indexableOption = 0; - break; - case "INDEXABLE_ENABLED": - case 1: - message.indexableOption = 1; - break; - case "INDEXABLE_DISABLED": - case 2: - message.indexableOption = 2; - break; } - switch (object.dynamicFacetableOption) { + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.retail.v2alpha.Product.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.priceInfo != null) { + if (typeof object.priceInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.priceInfo: object expected"); + message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); + } + if (object.rating != null) { + if (typeof object.rating !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.rating: object expected"); + message.rating = $root.google.cloud.retail.v2alpha.Rating.fromObject(object.rating); + } + if (object.availableTime != null) { + if (typeof object.availableTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.availableTime: object expected"); + message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); + } + switch (object.availability) { default: - if (typeof object.dynamicFacetableOption === "number") { - message.dynamicFacetableOption = object.dynamicFacetableOption; + if (typeof object.availability === "number") { + message.availability = object.availability; break; } break; - case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": + case "AVAILABILITY_UNSPECIFIED": case 0: - message.dynamicFacetableOption = 0; + message.availability = 0; break; - case "DYNAMIC_FACETABLE_ENABLED": + case "IN_STOCK": case 1: - message.dynamicFacetableOption = 1; + message.availability = 1; break; - case "DYNAMIC_FACETABLE_DISABLED": + case "OUT_OF_STOCK": case 2: - message.dynamicFacetableOption = 2; - break; - } - switch (object.searchableOption) { - default: - if (typeof object.searchableOption === "number") { - message.searchableOption = object.searchableOption; - break; - } - break; - case "SEARCHABLE_OPTION_UNSPECIFIED": - case 0: - message.searchableOption = 0; + message.availability = 2; break; - case "SEARCHABLE_ENABLED": - case 1: - message.searchableOption = 1; + case "PREORDER": + case 3: + message.availability = 3; break; - case "SEARCHABLE_DISABLED": - case 2: - message.searchableOption = 2; + case "BACKORDER": + case 4: + message.availability = 4; break; } - switch (object.recommendationsFilteringOption) { - default: - if (typeof object.recommendationsFilteringOption === "number") { - message.recommendationsFilteringOption = object.recommendationsFilteringOption; - break; + if (object.availableQuantity != null) { + if (typeof object.availableQuantity !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.availableQuantity: object expected"); + message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); + } + if (object.fulfillmentInfo) { + if (!Array.isArray(object.fulfillmentInfo)) + throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: array expected"); + message.fulfillmentInfo = []; + for (var i = 0; i < object.fulfillmentInfo.length; ++i) { + if (typeof object.fulfillmentInfo[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: object expected"); + message.fulfillmentInfo[i] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); } - break; - case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": - case 0: - message.recommendationsFilteringOption = 0; - break; - case "RECOMMENDATIONS_FILTERING_DISABLED": - case 1: - message.recommendationsFilteringOption = 1; - break; - case "RECOMMENDATIONS_FILTERING_ENABLED": - case 3: - message.recommendationsFilteringOption = 3; - break; } - switch (object.exactSearchableOption) { - default: - if (typeof object.exactSearchableOption === "number") { - message.exactSearchableOption = object.exactSearchableOption; - break; + if (object.uri != null) + message.uri = String(object.uri); + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.cloud.retail.v2alpha.Product.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) { + if (typeof object.images[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.images: object expected"); + message.images[i] = $root.google.cloud.retail.v2alpha.Image.fromObject(object.images[i]); } - break; - case "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": - case 0: - message.exactSearchableOption = 0; - break; - case "EXACT_SEARCHABLE_ENABLED": - case 1: - message.exactSearchableOption = 1; - break; - case "EXACT_SEARCHABLE_DISABLED": - case 2: - message.exactSearchableOption = 2; - break; } - switch (object.retrievableOption) { - default: - if (typeof object.retrievableOption === "number") { - message.retrievableOption = object.retrievableOption; - break; + if (object.audience != null) { + if (typeof object.audience !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.audience: object expected"); + message.audience = $root.google.cloud.retail.v2alpha.Audience.fromObject(object.audience); + } + if (object.colorInfo != null) { + if (typeof object.colorInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.colorInfo: object expected"); + message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.fromObject(object.colorInfo); + } + if (object.sizes) { + if (!Array.isArray(object.sizes)) + throw TypeError(".google.cloud.retail.v2alpha.Product.sizes: array expected"); + message.sizes = []; + for (var i = 0; i < object.sizes.length; ++i) + message.sizes[i] = String(object.sizes[i]); + } + if (object.materials) { + if (!Array.isArray(object.materials)) + throw TypeError(".google.cloud.retail.v2alpha.Product.materials: array expected"); + message.materials = []; + for (var i = 0; i < object.materials.length; ++i) + message.materials[i] = String(object.materials[i]); + } + if (object.patterns) { + if (!Array.isArray(object.patterns)) + throw TypeError(".google.cloud.retail.v2alpha.Product.patterns: array expected"); + message.patterns = []; + for (var i = 0; i < object.patterns.length; ++i) + message.patterns[i] = String(object.patterns[i]); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.retail.v2alpha.Product.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) + message.conditions[i] = String(object.conditions[i]); + } + if (object.promotions) { + if (!Array.isArray(object.promotions)) + throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: array expected"); + message.promotions = []; + for (var i = 0; i < object.promotions.length; ++i) { + if (typeof object.promotions[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: object expected"); + message.promotions[i] = $root.google.cloud.retail.v2alpha.Promotion.fromObject(object.promotions[i]); + } + } + if (object.publishTime != null) { + if (typeof object.publishTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.publishTime: object expected"); + message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); + } + if (object.retrievableFields != null) { + if (typeof object.retrievableFields !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.retrievableFields: object expected"); + message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); + } + if (object.variants) { + if (!Array.isArray(object.variants)) + throw TypeError(".google.cloud.retail.v2alpha.Product.variants: array expected"); + message.variants = []; + for (var i = 0; i < object.variants.length; ++i) { + if (typeof object.variants[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.variants: object expected"); + message.variants[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.variants[i]); + } + } + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: array expected"); + message.localInventories = []; + for (var i = 0; i < object.localInventories.length; ++i) { + if (typeof object.localInventories[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); } - break; - case "RETRIEVABLE_OPTION_UNSPECIFIED": - case 0: - message.retrievableOption = 0; - break; - case "RETRIEVABLE_ENABLED": - case 1: - message.retrievableOption = 1; - break; - case "RETRIEVABLE_DISABLED": - case 2: - message.retrievableOption = 2; - break; } return message; }; /** - * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. + * Creates a plain object from a Product message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static - * @param {google.cloud.retail.v2alpha.CatalogAttribute} message CatalogAttribute + * @param {google.cloud.retail.v2alpha.Product} message Product * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CatalogAttribute.toObject = function toObject(message, options) { + Product.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.collectionMemberIds = []; + object.categories = []; + object.brands = []; + object.tags = []; + object.fulfillmentInfo = []; + object.images = []; + object.sizes = []; + object.materials = []; + object.patterns = []; + object.conditions = []; + object.variants = []; + object.promotions = []; + object.localInventories = []; + } + if (options.objects || options.defaults) + object.attributes = {}; if (options.defaults) { - object.key = ""; - object.indexableOption = options.enums === String ? "INDEXABLE_OPTION_UNSPECIFIED" : 0; - object.dynamicFacetableOption = options.enums === String ? "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" : 0; - object.searchableOption = options.enums === String ? "SEARCHABLE_OPTION_UNSPECIFIED" : 0; - object.recommendationsFilteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; - object.inUse = false; - object.type = options.enums === String ? "UNKNOWN" : 0; - object.exactSearchableOption = options.enums === String ? "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" : 0; - object.retrievableOption = options.enums === String ? "RETRIEVABLE_OPTION_UNSPECIFIED" : 0; + object.name = ""; + object.id = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.primaryProductId = ""; + object.gtin = ""; + object.title = ""; + object.description = ""; + object.languageCode = ""; + object.priceInfo = null; + object.rating = null; + object.availableTime = null; + object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; + object.availableQuantity = null; + object.uri = ""; + object.audience = null; + object.colorInfo = null; + object.retrievableFields = null; + object.publishTime = null; } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) - object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] === undefined ? message.indexableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; - if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) - object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] === undefined ? message.dynamicFacetableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; - if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) - object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] === undefined ? message.searchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; - if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) - object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] === undefined ? message.recommendationsFilteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; - if (message.inUse != null && message.hasOwnProperty("inUse")) - object.inUse = message.inUse; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] : message.type; - if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) - object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; - if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) - object.retrievableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] === undefined ? message.retrievableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] : message.retrievableOption; + object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; + if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) + object.primaryProductId = message.primaryProductId; + if (message.collectionMemberIds && message.collectionMemberIds.length) { + object.collectionMemberIds = []; + for (var j = 0; j < message.collectionMemberIds.length; ++j) + object.collectionMemberIds[j] = message.collectionMemberIds[j]; + } + if (message.gtin != null && message.hasOwnProperty("gtin")) + object.gtin = message.gtin; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = message.categories[j]; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.brands && message.brands.length) { + object.brands = []; + for (var j = 0; j < message.brands.length; ++j) + object.brands[j] = message.brands[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) + object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = $root.google.cloud.retail.v2alpha.Rating.toObject(message.rating, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + if (message.availableTime != null && message.hasOwnProperty("availableTime")) + object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); + if (message.availability != null && message.hasOwnProperty("availability")) + object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] === undefined ? message.availability : $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; + if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) + object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); + if (message.fulfillmentInfo && message.fulfillmentInfo.length) { + object.fulfillmentInfo = []; + for (var j = 0; j < message.fulfillmentInfo.length; ++j) + object.fulfillmentInfo[j] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = $root.google.cloud.retail.v2alpha.Image.toObject(message.images[j], options); + } + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = $root.google.cloud.retail.v2alpha.Audience.toObject(message.audience, options); + if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) + object.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.toObject(message.colorInfo, options); + if (message.sizes && message.sizes.length) { + object.sizes = []; + for (var j = 0; j < message.sizes.length; ++j) + object.sizes[j] = message.sizes[j]; + } + if (message.materials && message.materials.length) { + object.materials = []; + for (var j = 0; j < message.materials.length; ++j) + object.materials[j] = message.materials[j]; + } + if (message.patterns && message.patterns.length) { + object.patterns = []; + for (var j = 0; j < message.patterns.length; ++j) + object.patterns[j] = message.patterns[j]; + } + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = message.conditions[j]; + } + if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) + object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); + if (message.variants && message.variants.length) { + object.variants = []; + for (var j = 0; j < message.variants.length; ++j) + object.variants[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.variants[j], options); + } + if (message.publishTime != null && message.hasOwnProperty("publishTime")) + object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); + if (message.promotions && message.promotions.length) { + object.promotions = []; + for (var j = 0; j < message.promotions.length; ++j) + object.promotions[j] = $root.google.cloud.retail.v2alpha.Promotion.toObject(message.promotions[j], options); + } + if (message.localInventories && message.localInventories.length) { + object.localInventories = []; + for (var j = 0; j < message.localInventories.length; ++j) + object.localInventories[j] = $root.google.cloud.retail.v2alpha.LocalInventory.toObject(message.localInventories[j], options); + } return object; }; /** - * Converts this CatalogAttribute to JSON. + * Converts this Product to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @instance * @returns {Object.} JSON object */ - CatalogAttribute.prototype.toJSON = function toJSON() { + Product.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CatalogAttribute + * Gets the default type url for Product * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @memberof google.cloud.retail.v2alpha.Product * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CatalogAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Product"; }; /** - * AttributeType enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.AttributeType + * Type enum. + * @name google.cloud.retail.v2alpha.Product.Type * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} TEXTUAL=1 TEXTUAL value - * @property {number} NUMERICAL=2 NUMERICAL value + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRIMARY=1 PRIMARY value + * @property {number} VARIANT=2 VARIANT value + * @property {number} COLLECTION=3 COLLECTION value */ - CatalogAttribute.AttributeType = (function() { + Product.Type = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "TEXTUAL"] = 1; - values[valuesById[2] = "NUMERICAL"] = 2; + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY"] = 1; + values[valuesById[2] = "VARIANT"] = 2; + values[valuesById[3] = "COLLECTION"] = 3; return values; })(); /** - * IndexableOption enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption + * Availability enum. + * @name google.cloud.retail.v2alpha.Product.Availability * @enum {number} - * @property {number} INDEXABLE_OPTION_UNSPECIFIED=0 INDEXABLE_OPTION_UNSPECIFIED value - * @property {number} INDEXABLE_ENABLED=1 INDEXABLE_ENABLED value - * @property {number} INDEXABLE_DISABLED=2 INDEXABLE_DISABLED value + * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value + * @property {number} IN_STOCK=1 IN_STOCK value + * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value + * @property {number} PREORDER=3 PREORDER value + * @property {number} BACKORDER=4 BACKORDER value */ - CatalogAttribute.IndexableOption = (function() { + Product.Availability = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INDEXABLE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "INDEXABLE_ENABLED"] = 1; - values[valuesById[2] = "INDEXABLE_DISABLED"] = 2; + values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_STOCK"] = 1; + values[valuesById[2] = "OUT_OF_STOCK"] = 2; + values[valuesById[3] = "PREORDER"] = 3; + values[valuesById[4] = "BACKORDER"] = 4; return values; })(); - /** - * DynamicFacetableOption enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption - * @enum {number} - * @property {number} DYNAMIC_FACETABLE_OPTION_UNSPECIFIED=0 DYNAMIC_FACETABLE_OPTION_UNSPECIFIED value - * @property {number} DYNAMIC_FACETABLE_ENABLED=1 DYNAMIC_FACETABLE_ENABLED value - * @property {number} DYNAMIC_FACETABLE_DISABLED=2 DYNAMIC_FACETABLE_DISABLED value - */ - CatalogAttribute.DynamicFacetableOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DYNAMIC_FACETABLE_ENABLED"] = 1; - values[valuesById[2] = "DYNAMIC_FACETABLE_DISABLED"] = 2; - return values; - })(); + return Product; + })(); - /** - * SearchableOption enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption - * @enum {number} - * @property {number} SEARCHABLE_OPTION_UNSPECIFIED=0 SEARCHABLE_OPTION_UNSPECIFIED value - * @property {number} SEARCHABLE_ENABLED=1 SEARCHABLE_ENABLED value - * @property {number} SEARCHABLE_DISABLED=2 SEARCHABLE_DISABLED value - */ - CatalogAttribute.SearchableOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCHABLE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "SEARCHABLE_ENABLED"] = 1; - values[valuesById[2] = "SEARCHABLE_DISABLED"] = 2; - return values; - })(); + /** + * AttributeConfigLevel enum. + * @name google.cloud.retail.v2alpha.AttributeConfigLevel + * @enum {number} + * @property {number} ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED=0 ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED value + * @property {number} PRODUCT_LEVEL_ATTRIBUTE_CONFIG=1 PRODUCT_LEVEL_ATTRIBUTE_CONFIG value + * @property {number} CATALOG_LEVEL_ATTRIBUTE_CONFIG=2 CATALOG_LEVEL_ATTRIBUTE_CONFIG value + */ + v2alpha.AttributeConfigLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_LEVEL_ATTRIBUTE_CONFIG"] = 1; + values[valuesById[2] = "CATALOG_LEVEL_ATTRIBUTE_CONFIG"] = 2; + return values; + })(); - /** - * ExactSearchableOption enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption - * @enum {number} - * @property {number} EXACT_SEARCHABLE_OPTION_UNSPECIFIED=0 EXACT_SEARCHABLE_OPTION_UNSPECIFIED value - * @property {number} EXACT_SEARCHABLE_ENABLED=1 EXACT_SEARCHABLE_ENABLED value - * @property {number} EXACT_SEARCHABLE_DISABLED=2 EXACT_SEARCHABLE_DISABLED value - */ - CatalogAttribute.ExactSearchableOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXACT_SEARCHABLE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXACT_SEARCHABLE_ENABLED"] = 1; - values[valuesById[2] = "EXACT_SEARCHABLE_DISABLED"] = 2; - return values; - })(); + /** + * SolutionType enum. + * @name google.cloud.retail.v2alpha.SolutionType + * @enum {number} + * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value + * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value + * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value + */ + v2alpha.SolutionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; + values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; + return values; + })(); - /** - * RetrievableOption enum. - * @name google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption - * @enum {number} - * @property {number} RETRIEVABLE_OPTION_UNSPECIFIED=0 RETRIEVABLE_OPTION_UNSPECIFIED value - * @property {number} RETRIEVABLE_ENABLED=1 RETRIEVABLE_ENABLED value - * @property {number} RETRIEVABLE_DISABLED=2 RETRIEVABLE_DISABLED value - */ - CatalogAttribute.RetrievableOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETRIEVABLE_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETRIEVABLE_ENABLED"] = 1; - values[valuesById[2] = "RETRIEVABLE_DISABLED"] = 2; - return values; - })(); + /** + * RecommendationsFilteringOption enum. + * @name google.cloud.retail.v2alpha.RecommendationsFilteringOption + * @enum {number} + * @property {number} RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED=0 RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED value + * @property {number} RECOMMENDATIONS_FILTERING_DISABLED=1 RECOMMENDATIONS_FILTERING_DISABLED value + * @property {number} RECOMMENDATIONS_FILTERING_ENABLED=3 RECOMMENDATIONS_FILTERING_ENABLED value + */ + v2alpha.RecommendationsFilteringOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RECOMMENDATIONS_FILTERING_DISABLED"] = 1; + values[valuesById[3] = "RECOMMENDATIONS_FILTERING_ENABLED"] = 3; + return values; + })(); - return CatalogAttribute; + /** + * SearchSolutionUseCase enum. + * @name google.cloud.retail.v2alpha.SearchSolutionUseCase + * @enum {number} + * @property {number} SEARCH_SOLUTION_USE_CASE_UNSPECIFIED=0 SEARCH_SOLUTION_USE_CASE_UNSPECIFIED value + * @property {number} SEARCH_SOLUTION_USE_CASE_SEARCH=1 SEARCH_SOLUTION_USE_CASE_SEARCH value + * @property {number} SEARCH_SOLUTION_USE_CASE_BROWSE=2 SEARCH_SOLUTION_USE_CASE_BROWSE value + */ + v2alpha.SearchSolutionUseCase = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEARCH_SOLUTION_USE_CASE_SEARCH"] = 1; + values[valuesById[2] = "SEARCH_SOLUTION_USE_CASE_BROWSE"] = 2; + return values; })(); - v2alpha.AttributesConfig = (function() { + v2alpha.Condition = (function() { /** - * Properties of an AttributesConfig. + * Properties of a Condition. * @memberof google.cloud.retail.v2alpha - * @interface IAttributesConfig - * @property {string|null} [name] AttributesConfig name - * @property {Object.|null} [catalogAttributes] AttributesConfig catalogAttributes - * @property {google.cloud.retail.v2alpha.AttributeConfigLevel|null} [attributeConfigLevel] AttributesConfig attributeConfigLevel + * @interface ICondition + * @property {Array.|null} [queryTerms] Condition queryTerms + * @property {Array.|null} [activeTimeRange] Condition activeTimeRange + * @property {Array.|null} [pageCategories] Condition pageCategories */ /** - * Constructs a new AttributesConfig. + * Constructs a new Condition. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AttributesConfig. - * @implements IAttributesConfig + * @classdesc Represents a Condition. + * @implements ICondition * @constructor - * @param {google.cloud.retail.v2alpha.IAttributesConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set */ - function AttributesConfig(properties) { - this.catalogAttributes = {}; + function Condition(properties) { + this.queryTerms = []; + this.activeTimeRange = []; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49746,125 +54905,112 @@ } /** - * AttributesConfig name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * Condition queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Condition * @instance */ - AttributesConfig.prototype.name = ""; + Condition.prototype.queryTerms = $util.emptyArray; /** - * AttributesConfig catalogAttributes. - * @member {Object.} catalogAttributes - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * Condition activeTimeRange. + * @member {Array.} activeTimeRange + * @memberof google.cloud.retail.v2alpha.Condition * @instance */ - AttributesConfig.prototype.catalogAttributes = $util.emptyObject; + Condition.prototype.activeTimeRange = $util.emptyArray; /** - * AttributesConfig attributeConfigLevel. - * @member {google.cloud.retail.v2alpha.AttributeConfigLevel} attributeConfigLevel - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * Condition pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2alpha.Condition * @instance */ - AttributesConfig.prototype.attributeConfigLevel = 0; + Condition.prototype.pageCategories = $util.emptyArray; /** - * Creates a new AttributesConfig instance using the specified properties. + * Creates a new Condition instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static - * @param {google.cloud.retail.v2alpha.IAttributesConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig instance + * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition} Condition instance */ - AttributesConfig.create = function create(properties) { - return new AttributesConfig(properties); + Condition.create = function create(properties) { + return new Condition(properties); }; /** - * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static - * @param {google.cloud.retail.v2alpha.IAttributesConfig} message AttributesConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttributesConfig.encode = function encode(message, writer) { + Condition.encode = function encode(message, writer) { 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.catalogAttributes != null && Object.hasOwnProperty.call(message, "catalogAttributes")) - for (var keys = Object.keys(message.catalogAttributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.attributeConfigLevel != null && Object.hasOwnProperty.call(message, "attributeConfigLevel")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attributeConfigLevel); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + $root.google.cloud.retail.v2alpha.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.activeTimeRange != null && message.activeTimeRange.length) + for (var i = 0; i < message.activeTimeRange.length; ++i) + $root.google.cloud.retail.v2alpha.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageCategories[i]); return writer; }; /** - * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static - * @param {google.cloud.retail.v2alpha.IAttributesConfig} message AttributesConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttributesConfig.encodeDelimited = function encodeDelimited(message, writer) { + Condition.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AttributesConfig message from the specified reader or buffer. + * Decodes a Condition message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig + * @returns {google.cloud.retail.v2alpha.Condition} Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttributesConfig.decode = function decode(reader, length) { + Condition.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AttributesConfig(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push($root.google.cloud.retail.v2alpha.Condition.QueryTerm.decode(reader, reader.uint32())); break; } - case 2: { - if (message.catalogAttributes === $util.emptyObject) - message.catalogAttributes = {}; - 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.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.catalogAttributes[key] = value; + case 3: { + if (!(message.activeTimeRange && message.activeTimeRange.length)) + message.activeTimeRange = []; + message.activeTimeRange.push($root.google.cloud.retail.v2alpha.Condition.TimeRange.decode(reader, reader.uint32())); break; } - case 3: { - message.attributeConfigLevel = reader.int32(); + case 4: { + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); break; } default: @@ -49876,193 +55022,659 @@ }; /** - * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. + * Decodes a Condition message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig + * @returns {google.cloud.retail.v2alpha.Condition} Condition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttributesConfig.decodeDelimited = function decodeDelimited(reader) { + Condition.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AttributesConfig message. + * Verifies a Condition message. * @function verify - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AttributesConfig.verify = function verify(message) { + Condition.verify = function verify(message) { if (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.catalogAttributes != null && message.hasOwnProperty("catalogAttributes")) { - if (!$util.isObject(message.catalogAttributes)) - return "catalogAttributes: object expected"; - var key = Object.keys(message.catalogAttributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttributes[key[i]]); + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.verify(message.queryTerms[i]); if (error) - return "catalogAttributes." + error; + return "queryTerms." + error; } } - if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) - switch (message.attributeConfigLevel) { - default: - return "attributeConfigLevel: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { + if (!Array.isArray(message.activeTimeRange)) + return "activeTimeRange: array expected"; + for (var i = 0; i < message.activeTimeRange.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Condition.TimeRange.verify(message.activeTimeRange[i]); + if (error) + return "activeTimeRange." + error; } + } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } return null; }; /** - * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. + * Creates a Condition message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig + * @returns {google.cloud.retail.v2alpha.Condition} Condition */ - AttributesConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AttributesConfig) + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition) return object; - var message = new $root.google.cloud.retail.v2alpha.AttributesConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.catalogAttributes) { - if (typeof object.catalogAttributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AttributesConfig.catalogAttributes: object expected"); - message.catalogAttributes = {}; - for (var keys = Object.keys(object.catalogAttributes), i = 0; i < keys.length; ++i) { - if (typeof object.catalogAttributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AttributesConfig.catalogAttributes: object expected"); - message.catalogAttributes[keys[i]] = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttributes[keys[i]]); + var message = new $root.google.cloud.retail.v2alpha.Condition(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) { + if (typeof object.queryTerms[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: object expected"); + message.queryTerms[i] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.fromObject(object.queryTerms[i]); } } - switch (object.attributeConfigLevel) { - default: - if (typeof object.attributeConfigLevel === "number") { - message.attributeConfigLevel = object.attributeConfigLevel; - break; + if (object.activeTimeRange) { + if (!Array.isArray(object.activeTimeRange)) + throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: array expected"); + message.activeTimeRange = []; + for (var i = 0; i < object.activeTimeRange.length; ++i) { + if (typeof object.activeTimeRange[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: object expected"); + message.activeTimeRange[i] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.fromObject(object.activeTimeRange[i]); } - break; - case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": - case 0: - message.attributeConfigLevel = 0; - break; - case "PRODUCT_LEVEL_ATTRIBUTE_CONFIG": - case 1: - message.attributeConfigLevel = 1; - break; - case "CATALOG_LEVEL_ATTRIBUTE_CONFIG": - case 2: - message.attributeConfigLevel = 2; - break; + } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2alpha.Condition.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); } return message; }; /** - * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. + * Creates a plain object from a Condition message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static - * @param {google.cloud.retail.v2alpha.AttributesConfig} message AttributesConfig + * @param {google.cloud.retail.v2alpha.Condition} message Condition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AttributesConfig.toObject = function toObject(message, options) { + Condition.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.catalogAttributes = {}; - if (options.defaults) { - object.name = ""; - object.attributeConfigLevel = options.enums === String ? "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED" : 0; + if (options.arrays || options.defaults) { + object.queryTerms = []; + object.activeTimeRange = []; + object.pageCategories = []; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - var keys2; - if (message.catalogAttributes && (keys2 = Object.keys(message.catalogAttributes)).length) { - object.catalogAttributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.toObject(message.queryTerms[j], options); + } + if (message.activeTimeRange && message.activeTimeRange.length) { + object.activeTimeRange = []; + for (var j = 0; j < message.activeTimeRange.length; ++j) + object.activeTimeRange[j] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.toObject(message.activeTimeRange[j], options); + } + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; } - if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) - object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] === undefined ? message.attributeConfigLevel : $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; /** - * Converts this AttributesConfig to JSON. + * Converts this Condition to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @instance * @returns {Object.} JSON object */ - AttributesConfig.prototype.toJSON = function toJSON() { + Condition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AttributesConfig + * Gets the default type url for Condition * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AttributesConfig + * @memberof google.cloud.retail.v2alpha.Condition * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AttributesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AttributesConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition"; }; - return AttributesConfig; + Condition.QueryTerm = (function() { + + /** + * Properties of a QueryTerm. + * @memberof google.cloud.retail.v2alpha.Condition + * @interface IQueryTerm + * @property {string|null} [value] QueryTerm value + * @property {boolean|null} [fullMatch] QueryTerm fullMatch + */ + + /** + * Constructs a new QueryTerm. + * @memberof google.cloud.retail.v2alpha.Condition + * @classdesc Represents a QueryTerm. + * @implements IQueryTerm + * @constructor + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set + */ + function QueryTerm(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryTerm value. + * @member {string} value + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.value = ""; + + /** + * QueryTerm fullMatch. + * @member {boolean} fullMatch + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @instance + */ + QueryTerm.prototype.fullMatch = false; + + /** + * Creates a new QueryTerm instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm instance + */ + QueryTerm.create = function create(properties) { + return new QueryTerm(properties); + }; + + /** + * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTerm.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.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); + return writer; + }; + + /** + * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryTerm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTerm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.fullMatch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryTerm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryTerm message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryTerm.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.fullMatch != null && message.hasOwnProperty("fullMatch")) + if (typeof message.fullMatch !== "boolean") + return "fullMatch: boolean expected"; + return null; + }; + + /** + * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + */ + QueryTerm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition.QueryTerm) + return object; + var message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); + if (object.value != null) + message.value = String(object.value); + if (object.fullMatch != null) + message.fullMatch = Boolean(object.fullMatch); + return message; + }; + + /** + * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {google.cloud.retail.v2alpha.Condition.QueryTerm} message QueryTerm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryTerm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.fullMatch = false; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) + object.fullMatch = message.fullMatch; + return object; + }; + + /** + * Converts this QueryTerm to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @instance + * @returns {Object.} JSON object + */ + QueryTerm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryTerm + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryTerm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition.QueryTerm"; + }; + + return QueryTerm; + })(); + + Condition.TimeRange = (function() { + + /** + * Properties of a TimeRange. + * @memberof google.cloud.retail.v2alpha.Condition + * @interface ITimeRange + * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + */ + + /** + * Constructs a new TimeRange. + * @memberof google.cloud.retail.v2alpha.Condition + * @classdesc Represents a TimeRange. + * @implements ITimeRange + * @constructor + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set + */ + function TimeRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeRange startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @instance + */ + TimeRange.prototype.startTime = null; + + /** + * TimeRange endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @instance + */ + TimeRange.prototype.endTime = null; + + /** + * Creates a new TimeRange instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange instance + */ + TimeRange.create = function create(properties) { + return new TimeRange(properties); + }; + + /** + * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.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 TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); + 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 TimeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeRange message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeRange.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 TimeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + */ + TimeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Condition.TimeRange) + return object; + var message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.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.retail.v2alpha.Condition.TimeRange.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {google.cloud.retail.v2alpha.Condition.TimeRange} message TimeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeRange.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 TimeRange to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @instance + * @returns {Object.} JSON object + */ + TimeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeRange + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition.TimeRange"; + }; + + return TimeRange; + })(); + + return Condition; })(); - v2alpha.CompletionConfig = (function() { + v2alpha.Rule = (function() { /** - * Properties of a CompletionConfig. + * Properties of a Rule. * @memberof google.cloud.retail.v2alpha - * @interface ICompletionConfig - * @property {string|null} [name] CompletionConfig name - * @property {string|null} [matchingOrder] CompletionConfig matchingOrder - * @property {number|null} [maxSuggestions] CompletionConfig maxSuggestions - * @property {number|null} [minPrefixLength] CompletionConfig minPrefixLength - * @property {boolean|null} [autoLearning] CompletionConfig autoLearning - * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [suggestionsInputConfig] CompletionConfig suggestionsInputConfig - * @property {string|null} [lastSuggestionsImportOperation] CompletionConfig lastSuggestionsImportOperation - * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [denylistInputConfig] CompletionConfig denylistInputConfig - * @property {string|null} [lastDenylistImportOperation] CompletionConfig lastDenylistImportOperation - * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [allowlistInputConfig] CompletionConfig allowlistInputConfig - * @property {string|null} [lastAllowlistImportOperation] CompletionConfig lastAllowlistImportOperation + * @interface IRule + * @property {google.cloud.retail.v2alpha.Rule.IBoostAction|null} [boostAction] Rule boostAction + * @property {google.cloud.retail.v2alpha.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction + * @property {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction + * @property {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction + * @property {google.cloud.retail.v2alpha.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction + * @property {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction + * @property {google.cloud.retail.v2alpha.Rule.IFilterAction|null} [filterAction] Rule filterAction + * @property {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction + * @property {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction|null} [forceReturnFacetAction] Rule forceReturnFacetAction + * @property {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction|null} [removeFacetAction] Rule removeFacetAction + * @property {google.cloud.retail.v2alpha.ICondition|null} [condition] Rule condition */ /** - * Constructs a new CompletionConfig. + * Constructs a new Rule. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionConfig. - * @implements ICompletionConfig + * @classdesc Represents a Rule. + * @implements IRule * @constructor - * @param {google.cloud.retail.v2alpha.ICompletionConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set */ - function CompletionConfig(properties) { + function Rule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50070,215 +55682,229 @@ } /** - * CompletionConfig name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule boostAction. + * @member {google.cloud.retail.v2alpha.Rule.IBoostAction|null|undefined} boostAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.name = ""; + Rule.prototype.boostAction = null; /** - * CompletionConfig matchingOrder. - * @member {string} matchingOrder - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule redirectAction. + * @member {google.cloud.retail.v2alpha.Rule.IRedirectAction|null|undefined} redirectAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.matchingOrder = ""; + Rule.prototype.redirectAction = null; /** - * CompletionConfig maxSuggestions. - * @member {number} maxSuggestions - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule onewaySynonymsAction. + * @member {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.maxSuggestions = 0; + Rule.prototype.onewaySynonymsAction = null; /** - * CompletionConfig minPrefixLength. - * @member {number} minPrefixLength - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule doNotAssociateAction. + * @member {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.minPrefixLength = 0; + Rule.prototype.doNotAssociateAction = null; /** - * CompletionConfig autoLearning. - * @member {boolean} autoLearning - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule replacementAction. + * @member {google.cloud.retail.v2alpha.Rule.IReplacementAction|null|undefined} replacementAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.autoLearning = false; + Rule.prototype.replacementAction = null; /** - * CompletionConfig suggestionsInputConfig. - * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} suggestionsInputConfig - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule ignoreAction. + * @member {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null|undefined} ignoreAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.suggestionsInputConfig = null; + Rule.prototype.ignoreAction = null; /** - * CompletionConfig lastSuggestionsImportOperation. - * @member {string} lastSuggestionsImportOperation - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule filterAction. + * @member {google.cloud.retail.v2alpha.Rule.IFilterAction|null|undefined} filterAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.lastSuggestionsImportOperation = ""; + Rule.prototype.filterAction = null; /** - * CompletionConfig denylistInputConfig. - * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} denylistInputConfig - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule twowaySynonymsAction. + * @member {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.denylistInputConfig = null; + Rule.prototype.twowaySynonymsAction = null; /** - * CompletionConfig lastDenylistImportOperation. - * @member {string} lastDenylistImportOperation - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule forceReturnFacetAction. + * @member {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction|null|undefined} forceReturnFacetAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.lastDenylistImportOperation = ""; + Rule.prototype.forceReturnFacetAction = null; /** - * CompletionConfig allowlistInputConfig. - * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} allowlistInputConfig - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule removeFacetAction. + * @member {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction|null|undefined} removeFacetAction + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.allowlistInputConfig = null; + Rule.prototype.removeFacetAction = null; /** - * CompletionConfig lastAllowlistImportOperation. - * @member {string} lastAllowlistImportOperation - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * Rule condition. + * @member {google.cloud.retail.v2alpha.ICondition|null|undefined} condition + * @memberof google.cloud.retail.v2alpha.Rule * @instance */ - CompletionConfig.prototype.lastAllowlistImportOperation = ""; + Rule.prototype.condition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new CompletionConfig instance using the specified properties. + * Rule action. + * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"|undefined} action + * @memberof google.cloud.retail.v2alpha.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction", "forceReturnFacetAction", "removeFacetAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rule instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.ICompletionConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig instance + * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule} Rule instance */ - CompletionConfig.create = function create(properties) { - return new CompletionConfig(properties); + Rule.create = function create(properties) { + return new Rule(properties); }; /** - * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.ICompletionConfig} message CompletionConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionConfig.encode = function encode(message, writer) { + Rule.encode = function encode(message, writer) { 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.matchingOrder != null && Object.hasOwnProperty.call(message, "matchingOrder")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchingOrder); - if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSuggestions); - if (message.minPrefixLength != null && Object.hasOwnProperty.call(message, "minPrefixLength")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minPrefixLength); - if (message.suggestionsInputConfig != null && Object.hasOwnProperty.call(message, "suggestionsInputConfig")) - $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.suggestionsInputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.lastSuggestionsImportOperation != null && Object.hasOwnProperty.call(message, "lastSuggestionsImportOperation")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastSuggestionsImportOperation); - if (message.denylistInputConfig != null && Object.hasOwnProperty.call(message, "denylistInputConfig")) - $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.denylistInputConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.lastDenylistImportOperation != null && Object.hasOwnProperty.call(message, "lastDenylistImportOperation")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastDenylistImportOperation); - if (message.allowlistInputConfig != null && Object.hasOwnProperty.call(message, "allowlistInputConfig")) - $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.allowlistInputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.lastAllowlistImportOperation != null && Object.hasOwnProperty.call(message, "lastAllowlistImportOperation")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.lastAllowlistImportOperation); - if (message.autoLearning != null && Object.hasOwnProperty.call(message, "autoLearning")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoLearning); - return writer; - }; - - /** - * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionConfig + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.retail.v2alpha.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) + $root.google.cloud.retail.v2alpha.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) + $root.google.cloud.retail.v2alpha.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) + $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) + $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) + $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) + $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) + $root.google.cloud.retail.v2alpha.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) + $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.forceReturnFacetAction != null && Object.hasOwnProperty.call(message, "forceReturnFacetAction")) + $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.encode(message.forceReturnFacetAction, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.removeFacetAction != null && Object.hasOwnProperty.call(message, "removeFacetAction")) + $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction.encode(message.removeFacetAction, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.ICompletionConfig} message CompletionConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionConfig.encodeDelimited = function encodeDelimited(message, writer) { + Rule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionConfig message from the specified reader or buffer. + * Decodes a Rule message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig + * @returns {google.cloud.retail.v2alpha.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionConfig.decode = function decode(reader, length) { + Rule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } case 2: { - message.matchingOrder = reader.string(); + message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.decode(reader, reader.uint32()); break; } case 3: { - message.maxSuggestions = reader.int32(); + message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.decode(reader, reader.uint32()); break; } - case 4: { - message.minPrefixLength = reader.int32(); + case 6: { + message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); break; } - case 11: { - message.autoLearning = reader.bool(); + case 7: { + message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); break; } - case 5: { - message.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + case 8: { + message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.decode(reader, reader.uint32()); break; } - case 6: { - message.lastSuggestionsImportOperation = reader.string(); + case 9: { + message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.decode(reader, reader.uint32()); break; } - case 7: { - message.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + case 10: { + message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.decode(reader, reader.uint32()); break; } - case 8: { - message.lastDenylistImportOperation = reader.string(); + case 11: { + message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); break; } - case 9: { - message.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + case 12: { + message.forceReturnFacetAction = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.decode(reader, reader.uint32()); break; } - case 10: { - message.lastAllowlistImportOperation = reader.string(); + case 13: { + message.removeFacetAction = $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction.decode(reader, reader.uint32()); + break; + } + case 1: { + message.condition = $root.google.cloud.retail.v2alpha.Condition.decode(reader, reader.uint32()); break; } default: @@ -50290,1669 +55916,1180 @@ }; /** - * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. + * Decodes a Rule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig + * @returns {google.cloud.retail.v2alpha.Rule} Rule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionConfig.decodeDelimited = function decodeDelimited(reader) { + Rule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionConfig message. + * Verifies a Rule message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionConfig.verify = function verify(message) { + Rule.verify = function verify(message) { if (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.matchingOrder != null && message.hasOwnProperty("matchingOrder")) - if (!$util.isString(message.matchingOrder)) - return "matchingOrder: string expected"; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - if (!$util.isInteger(message.maxSuggestions)) - return "maxSuggestions: integer expected"; - if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) - if (!$util.isInteger(message.minPrefixLength)) - return "minPrefixLength: integer expected"; - if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) - if (typeof message.autoLearning !== "boolean") - return "autoLearning: boolean expected"; - if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.suggestionsInputConfig); - if (error) - return "suggestionsInputConfig." + error; - } - if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) - if (!$util.isString(message.lastSuggestionsImportOperation)) - return "lastSuggestionsImportOperation: string expected"; - if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.denylistInputConfig); - if (error) - return "denylistInputConfig." + error; + var properties = {}; + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.BoostAction.verify(message.boostAction); + if (error) + return "boostAction." + error; + } } - if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) - if (!$util.isString(message.lastDenylistImportOperation)) - return "lastDenylistImportOperation: string expected"; - if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.allowlistInputConfig); - if (error) - return "allowlistInputConfig." + error; + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.verify(message.redirectAction); + if (error) + return "redirectAction." + error; + } } - if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) - if (!$util.isString(message.lastAllowlistImportOperation)) - return "lastAllowlistImportOperation: string expected"; - return null; - }; - - /** - * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompletionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig - */ - CompletionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompletionConfig) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompletionConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.matchingOrder != null) - message.matchingOrder = String(object.matchingOrder); - if (object.maxSuggestions != null) - message.maxSuggestions = object.maxSuggestions | 0; - if (object.minPrefixLength != null) - message.minPrefixLength = object.minPrefixLength | 0; - if (object.autoLearning != null) - message.autoLearning = Boolean(object.autoLearning); - if (object.suggestionsInputConfig != null) { - if (typeof object.suggestionsInputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.suggestionsInputConfig: object expected"); - message.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.suggestionsInputConfig); + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); + if (error) + return "onewaySynonymsAction." + error; + } } - if (object.lastSuggestionsImportOperation != null) - message.lastSuggestionsImportOperation = String(object.lastSuggestionsImportOperation); - if (object.denylistInputConfig != null) { - if (typeof object.denylistInputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.denylistInputConfig: object expected"); - message.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.denylistInputConfig); + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); + if (error) + return "doNotAssociateAction." + error; + } } - if (object.lastDenylistImportOperation != null) - message.lastDenylistImportOperation = String(object.lastDenylistImportOperation); - if (object.allowlistInputConfig != null) { - if (typeof object.allowlistInputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.allowlistInputConfig: object expected"); - message.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.allowlistInputConfig); + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.verify(message.replacementAction); + if (error) + return "replacementAction." + error; + } } - if (object.lastAllowlistImportOperation != null) - message.lastAllowlistImportOperation = String(object.lastAllowlistImportOperation); - return message; - }; - - /** - * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompletionConfig - * @static - * @param {google.cloud.retail.v2alpha.CompletionConfig} message CompletionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompletionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.matchingOrder = ""; - object.maxSuggestions = 0; - object.minPrefixLength = 0; - object.suggestionsInputConfig = null; - object.lastSuggestionsImportOperation = ""; - object.denylistInputConfig = null; - object.lastDenylistImportOperation = ""; - object.allowlistInputConfig = null; - object.lastAllowlistImportOperation = ""; - object.autoLearning = false; + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.verify(message.ignoreAction); + if (error) + return "ignoreAction." + error; + } } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.matchingOrder != null && message.hasOwnProperty("matchingOrder")) - object.matchingOrder = message.matchingOrder; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - object.maxSuggestions = message.maxSuggestions; - if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) - object.minPrefixLength = message.minPrefixLength; - if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) - object.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.suggestionsInputConfig, options); - if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) - object.lastSuggestionsImportOperation = message.lastSuggestionsImportOperation; - if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) - object.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.denylistInputConfig, options); - if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) - object.lastDenylistImportOperation = message.lastDenylistImportOperation; - if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) - object.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.allowlistInputConfig, options); - if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) - object.lastAllowlistImportOperation = message.lastAllowlistImportOperation; - if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) - object.autoLearning = message.autoLearning; - return object; - }; - - /** - * Converts this CompletionConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompletionConfig - * @instance - * @returns {Object.} JSON object - */ - CompletionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CompletionConfig - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompletionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CompletionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.FilterAction.verify(message.filterAction); + if (error) + return "filterAction." + error; + } } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionConfig"; - }; - - return CompletionConfig; - })(); - - v2alpha.MerchantCenterLink = (function() { - - /** - * Properties of a MerchantCenterLink. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterLink - * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterLink merchantCenterAccountId - * @property {string|null} [branchId] MerchantCenterLink branchId - * @property {Array.|null} [destinations] MerchantCenterLink destinations - * @property {string|null} [regionCode] MerchantCenterLink regionCode - * @property {string|null} [languageCode] MerchantCenterLink languageCode - * @property {Array.|null} [feeds] MerchantCenterLink feeds - */ - - /** - * Constructs a new MerchantCenterLink. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterLink. - * @implements IMerchantCenterLink - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set - */ - function MerchantCenterLink(properties) { - this.destinations = []; - this.feeds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MerchantCenterLink merchantCenterAccountId. - * @member {number|Long} merchantCenterAccountId - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * MerchantCenterLink branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.branchId = ""; - - /** - * MerchantCenterLink destinations. - * @member {Array.} destinations - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.destinations = $util.emptyArray; - - /** - * MerchantCenterLink regionCode. - * @member {string} regionCode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.regionCode = ""; - - /** - * MerchantCenterLink languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.languageCode = ""; - - /** - * MerchantCenterLink feeds. - * @member {Array.} feeds - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @instance - */ - MerchantCenterLink.prototype.feeds = $util.emptyArray; - - /** - * Creates a new MerchantCenterLink instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink instance - */ - MerchantCenterLink.create = function create(properties) { - return new MerchantCenterLink(properties); - }; - - /** - * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLink.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.merchantCenterAccountId); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); - if (message.destinations != null && message.destinations.length) - for (var i = 0; i < message.destinations.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinations[i]); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.regionCode); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); - if (message.feeds != null && message.feeds.length) - for (var i = 0; i < message.feeds.length; ++i) - $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.encode(message.feeds[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MerchantCenterLink message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLink.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.merchantCenterAccountId = reader.int64(); - break; - } - case 2: { - message.branchId = reader.string(); - break; - } - case 3: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - message.destinations.push(reader.string()); - break; - } - case 4: { - message.regionCode = reader.string(); - break; - } - case 5: { - message.languageCode = reader.string(); - break; - } - case 6: { - if (!(message.feeds && message.feeds.length)) - message.feeds = []; - message.feeds.push($root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); + if (error) + return "twowaySynonymsAction." + error; } } - return message; - }; - - /** - * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerchantCenterLink message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterLink.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) - return "merchantCenterAccountId: integer|Long expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: 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) - if (!$util.isString(message.destinations[i])) - return "destinations: string[] expected"; + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.verify(message.forceReturnFacetAction); + if (error) + return "forceReturnFacetAction." + error; + } } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.feeds != null && message.hasOwnProperty("feeds")) { - if (!Array.isArray(message.feeds)) - return "feeds: array expected"; - for (var i = 0; i < message.feeds.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify(message.feeds[i]); + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction.verify(message.removeFacetAction); if (error) - return "feeds." + error; + return "removeFacetAction." + error; } } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.cloud.retail.v2alpha.Condition.verify(message.condition); + if (error) + return "condition." + error; + } return null; }; /** - * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. + * Creates a Rule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink + * @returns {google.cloud.retail.v2alpha.Rule} Rule */ - MerchantCenterLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLink) + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule) return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); - if (object.merchantCenterAccountId != null) - if ($util.Long) - (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; - else if (typeof object.merchantCenterAccountId === "string") - message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); - else if (typeof object.merchantCenterAccountId === "number") - message.merchantCenterAccountId = object.merchantCenterAccountId; - else if (typeof object.merchantCenterAccountId === "object") - message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - message.destinations[i] = String(object.destinations[i]); + var message = new $root.google.cloud.retail.v2alpha.Rule(); + if (object.boostAction != null) { + if (typeof object.boostAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.boostAction: object expected"); + message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.fromObject(object.boostAction); } - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.feeds) { - if (!Array.isArray(object.feeds)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: array expected"); - message.feeds = []; - for (var i = 0; i < object.feeds.length; ++i) { - if (typeof object.feeds[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: object expected"); - message.feeds[i] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.fromObject(object.feeds[i]); - } + if (object.redirectAction != null) { + if (typeof object.redirectAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.redirectAction: object expected"); + message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.fromObject(object.redirectAction); + } + if (object.onewaySynonymsAction != null) { + if (typeof object.onewaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.onewaySynonymsAction: object expected"); + message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); + } + if (object.doNotAssociateAction != null) { + if (typeof object.doNotAssociateAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.doNotAssociateAction: object expected"); + message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); + } + if (object.replacementAction != null) { + if (typeof object.replacementAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.replacementAction: object expected"); + message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.fromObject(object.replacementAction); + } + if (object.ignoreAction != null) { + if (typeof object.ignoreAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.ignoreAction: object expected"); + message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.fromObject(object.ignoreAction); + } + if (object.filterAction != null) { + if (typeof object.filterAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.filterAction: object expected"); + message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.fromObject(object.filterAction); + } + if (object.twowaySynonymsAction != null) { + if (typeof object.twowaySynonymsAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.twowaySynonymsAction: object expected"); + message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); + } + if (object.forceReturnFacetAction != null) { + if (typeof object.forceReturnFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.forceReturnFacetAction: object expected"); + message.forceReturnFacetAction = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.fromObject(object.forceReturnFacetAction); + } + if (object.removeFacetAction != null) { + if (typeof object.removeFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.removeFacetAction: object expected"); + message.removeFacetAction = $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction.fromObject(object.removeFacetAction); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.condition: object expected"); + message.condition = $root.google.cloud.retail.v2alpha.Condition.fromObject(object.condition); } return message; }; /** - * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. + * Creates a plain object from a Rule message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @memberof google.cloud.retail.v2alpha.Rule * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterLink} message MerchantCenterLink + * @param {google.cloud.retail.v2alpha.Rule} message Rule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MerchantCenterLink.toObject = function toObject(message, options) { + Rule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.destinations = []; - object.feeds = []; + if (options.defaults) + object.condition = null; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.cloud.retail.v2alpha.Condition.toObject(message.condition, options); + if (message.boostAction != null && message.hasOwnProperty("boostAction")) { + object.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.toObject(message.boostAction, options); + if (options.oneofs) + object.action = "boostAction"; } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.merchantCenterAccountId = options.longs === String ? "0" : 0; - object.branchId = ""; - object.regionCode = ""; - object.languageCode = ""; + if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { + object.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.toObject(message.redirectAction, options); + if (options.oneofs) + object.action = "redirectAction"; } - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (typeof message.merchantCenterAccountId === "number") - object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; - else - object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = message.destinations[j]; + if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { + object.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); + if (options.oneofs) + object.action = "onewaySynonymsAction"; } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.feeds && message.feeds.length) { - object.feeds = []; - for (var j = 0; j < message.feeds.length; ++j) - object.feeds[j] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.toObject(message.feeds[j], options); + if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { + object.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); + if (options.oneofs) + object.action = "doNotAssociateAction"; + } + if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { + object.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.toObject(message.replacementAction, options); + if (options.oneofs) + object.action = "replacementAction"; + } + if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { + object.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.toObject(message.ignoreAction, options); + if (options.oneofs) + object.action = "ignoreAction"; + } + if (message.filterAction != null && message.hasOwnProperty("filterAction")) { + object.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.toObject(message.filterAction, options); + if (options.oneofs) + object.action = "filterAction"; + } + if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { + object.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); + if (options.oneofs) + object.action = "twowaySynonymsAction"; + } + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + object.forceReturnFacetAction = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.toObject(message.forceReturnFacetAction, options); + if (options.oneofs) + object.action = "forceReturnFacetAction"; + } + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + object.removeFacetAction = $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction.toObject(message.removeFacetAction, options); + if (options.oneofs) + object.action = "removeFacetAction"; } return object; }; /** - * Converts this MerchantCenterLink to JSON. + * Converts this Rule to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @memberof google.cloud.retail.v2alpha.Rule * @instance * @returns {Object.} JSON object */ - MerchantCenterLink.prototype.toJSON = function toJSON() { + Rule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MerchantCenterLink + * Gets the default type url for Rule * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @memberof google.cloud.retail.v2alpha.Rule * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MerchantCenterLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterLink"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule"; }; - return MerchantCenterLink; - })(); - - v2alpha.MerchantCenterFeedFilter = (function() { + Rule.BoostAction = (function() { - /** - * Properties of a MerchantCenterFeedFilter. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterFeedFilter - * @property {number|Long|null} [primaryFeedId] MerchantCenterFeedFilter primaryFeedId - * @property {string|null} [primaryFeedName] MerchantCenterFeedFilter primaryFeedName - */ + /** + * Properties of a BoostAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IBoostAction + * @property {number|null} [boost] BoostAction boost + * @property {string|null} [productsFilter] BoostAction productsFilter + */ - /** - * Constructs a new MerchantCenterFeedFilter. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterFeedFilter. - * @implements IMerchantCenterFeedFilter - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set - */ - function MerchantCenterFeedFilter(properties) { - if (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 BoostAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a BoostAction. + * @implements IBoostAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set + */ + function BoostAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MerchantCenterFeedFilter primaryFeedId. - * @member {number|Long} primaryFeedId - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @instance - */ - MerchantCenterFeedFilter.prototype.primaryFeedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * BoostAction boost. + * @member {number} boost + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + */ + BoostAction.prototype.boost = 0; - /** - * MerchantCenterFeedFilter primaryFeedName. - * @member {string} primaryFeedName - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @instance - */ - MerchantCenterFeedFilter.prototype.primaryFeedName = ""; + /** + * BoostAction productsFilter. + * @member {string} productsFilter + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + */ + BoostAction.prototype.productsFilter = ""; - /** - * Creates a new MerchantCenterFeedFilter instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter instance - */ - MerchantCenterFeedFilter.create = function create(properties) { - return new MerchantCenterFeedFilter(properties); - }; + /** + * Creates a new BoostAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction instance + */ + BoostAction.create = function create(properties) { + return new BoostAction(properties); + }; - /** - * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterFeedFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.primaryFeedId != null && Object.hasOwnProperty.call(message, "primaryFeedId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.primaryFeedId); - if (message.primaryFeedName != null && Object.hasOwnProperty.call(message, "primaryFeedName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryFeedName); - return writer; - }; + /** + * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); + if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); + return writer; + }; - /** - * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterFeedFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterFeedFilter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.primaryFeedId = reader.int64(); - break; - } - case 2: { - message.primaryFeedName = reader.string(); + /** + * Decodes a BoostAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boost = reader.float(); + break; + } + case 2: { + message.productsFilter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterFeedFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a MerchantCenterFeedFilter message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterFeedFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) - if (!$util.isInteger(message.primaryFeedId) && !(message.primaryFeedId && $util.isInteger(message.primaryFeedId.low) && $util.isInteger(message.primaryFeedId.high))) - return "primaryFeedId: integer|Long expected"; - if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) - if (!$util.isString(message.primaryFeedName)) - return "primaryFeedName: string expected"; - return null; - }; + /** + * Verifies a BoostAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + if (!$util.isString(message.productsFilter)) + return "productsFilter: string expected"; + return null; + }; - /** - * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter - */ - MerchantCenterFeedFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter) - return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); - if (object.primaryFeedId != null) - if ($util.Long) - (message.primaryFeedId = $util.Long.fromValue(object.primaryFeedId)).unsigned = false; - else if (typeof object.primaryFeedId === "string") - message.primaryFeedId = parseInt(object.primaryFeedId, 10); - else if (typeof object.primaryFeedId === "number") - message.primaryFeedId = object.primaryFeedId; - else if (typeof object.primaryFeedId === "object") - message.primaryFeedId = new $util.LongBits(object.primaryFeedId.low >>> 0, object.primaryFeedId.high >>> 0).toNumber(); - if (object.primaryFeedName != null) - message.primaryFeedName = String(object.primaryFeedName); - return message; - }; + /** + * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + */ + BoostAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.BoostAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); + if (object.boost != null) + message.boost = Number(object.boost); + if (object.productsFilter != null) + message.productsFilter = String(object.productsFilter); + return message; + }; - /** - * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} message MerchantCenterFeedFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerchantCenterFeedFilter.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.primaryFeedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.primaryFeedId = options.longs === String ? "0" : 0; - object.primaryFeedName = ""; - } - if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) - if (typeof message.primaryFeedId === "number") - object.primaryFeedId = options.longs === String ? String(message.primaryFeedId) : message.primaryFeedId; - else - object.primaryFeedId = options.longs === String ? $util.Long.prototype.toString.call(message.primaryFeedId) : options.longs === Number ? new $util.LongBits(message.primaryFeedId.low >>> 0, message.primaryFeedId.high >>> 0).toNumber() : message.primaryFeedId; - if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) - object.primaryFeedName = message.primaryFeedName; - return object; - }; + /** + * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.BoostAction} message BoostAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boost = 0; + object.productsFilter = ""; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) + object.productsFilter = message.productsFilter; + return object; + }; - /** - * Converts this MerchantCenterFeedFilter to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @instance - * @returns {Object.} JSON object - */ - MerchantCenterFeedFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this BoostAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @instance + * @returns {Object.} JSON object + */ + BoostAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for MerchantCenterFeedFilter - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MerchantCenterFeedFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterFeedFilter"; - }; + /** + * Gets the default type url for BoostAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.BoostAction"; + }; - return MerchantCenterFeedFilter; - })(); + return BoostAction; + })(); - v2alpha.MerchantCenterLinkingConfig = (function() { + Rule.FilterAction = (function() { - /** - * Properties of a MerchantCenterLinkingConfig. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterLinkingConfig - * @property {Array.|null} [links] MerchantCenterLinkingConfig links - */ + /** + * Properties of a FilterAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IFilterAction + * @property {string|null} [filter] FilterAction filter + */ - /** - * Constructs a new MerchantCenterLinkingConfig. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterLinkingConfig. - * @implements IMerchantCenterLinkingConfig - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set - */ - function MerchantCenterLinkingConfig(properties) { - this.links = []; - if (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 FilterAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a FilterAction. + * @implements IFilterAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set + */ + function FilterAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MerchantCenterLinkingConfig links. - * @member {Array.} links - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @instance - */ - MerchantCenterLinkingConfig.prototype.links = $util.emptyArray; + /** + * FilterAction filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @instance + */ + FilterAction.prototype.filter = ""; - /** - * Creates a new MerchantCenterLinkingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig instance - */ - MerchantCenterLinkingConfig.create = function create(properties) { - return new MerchantCenterLinkingConfig(properties); - }; + /** + * Creates a new FilterAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction instance + */ + FilterAction.create = function create(properties) { + return new FilterAction(properties); + }; - /** - * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLinkingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.links != null && message.links.length) - for (var i = 0; i < message.links.length; ++i) - $root.google.cloud.retail.v2alpha.MerchantCenterLink.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.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); + return writer; + }; - /** - * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterLinkingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FilterAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLinkingConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.links && message.links.length)) - message.links = []; - message.links.push($root.google.cloud.retail.v2alpha.MerchantCenterLink.decode(reader, reader.uint32())); + /** + * Decodes a FilterAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterLinkingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FilterAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a MerchantCenterLinkingConfig message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterLinkingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.links != null && message.hasOwnProperty("links")) { - if (!Array.isArray(message.links)) - return "links: array expected"; - for (var i = 0; i < message.links.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterLink.verify(message.links[i]); - if (error) - return "links." + error; - } - } - return null; - }; + /** + * Verifies a FilterAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FilterAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig - */ - MerchantCenterLinkingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) + /** + * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + */ + FilterAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.FilterAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.FilterAction} message FilterAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FilterAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); - if (object.links) { - if (!Array.isArray(object.links)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: array expected"); - message.links = []; - for (var i = 0; i < object.links.length; ++i) { - if (typeof object.links[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: object expected"); - message.links[i] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.fromObject(object.links[i]); + }; + + /** + * Converts this FilterAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @instance + * @returns {Object.} JSON object + */ + FilterAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FilterAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FilterAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.FilterAction"; + }; - /** - * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} message MerchantCenterLinkingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerchantCenterLinkingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.links = []; - if (message.links && message.links.length) { - object.links = []; - for (var j = 0; j < message.links.length; ++j) - object.links[j] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.toObject(message.links[j], options); - } - return object; - }; + return FilterAction; + })(); - /** - * Converts this MerchantCenterLinkingConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @instance - * @returns {Object.} JSON object - */ - MerchantCenterLinkingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Rule.RedirectAction = (function() { - /** - * Gets the default type url for MerchantCenterLinkingConfig - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MerchantCenterLinkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterLinkingConfig"; - }; + /** + * Properties of a RedirectAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IRedirectAction + * @property {string|null} [redirectUri] RedirectAction redirectUri + */ - return MerchantCenterLinkingConfig; - })(); + /** + * Constructs a new RedirectAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a RedirectAction. + * @implements IRedirectAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set + */ + function RedirectAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - v2alpha.Catalog = (function() { + /** + * RedirectAction redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @instance + */ + RedirectAction.prototype.redirectUri = ""; - /** - * Properties of a Catalog. - * @memberof google.cloud.retail.v2alpha - * @interface ICatalog - * @property {string|null} [name] Catalog name - * @property {string|null} [displayName] Catalog displayName - * @property {google.cloud.retail.v2alpha.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig - * @property {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null} [merchantCenterLinkingConfig] Catalog merchantCenterLinkingConfig - */ + /** + * Creates a new RedirectAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction instance + */ + RedirectAction.create = function create(properties) { + return new RedirectAction(properties); + }; - /** - * Constructs a new Catalog. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Catalog. - * @implements ICatalog - * @constructor - * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set - */ - function Catalog(properties) { - if (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 RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); + return writer; + }; - /** - * Catalog name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.name = ""; + /** + * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Catalog displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.displayName = ""; + /** + * Decodes a RedirectAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.redirectUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Catalog productLevelConfig. - * @member {google.cloud.retail.v2alpha.IProductLevelConfig|null|undefined} productLevelConfig - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.productLevelConfig = null; + /** + * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Catalog merchantCenterLinkingConfig. - * @member {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null|undefined} merchantCenterLinkingConfig - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - */ - Catalog.prototype.merchantCenterLinkingConfig = null; + /** + * Verifies a RedirectAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedirectAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + return null; + }; - /** - * Creates a new Catalog instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog instance - */ - Catalog.create = function create(properties) { - return new Catalog(properties); - }; + /** + * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + */ + RedirectAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.RedirectAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + return message; + }; - /** - * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Catalog.encode = function encode(message, writer) { - 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.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) - $root.google.cloud.retail.v2alpha.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.merchantCenterLinkingConfig != null && Object.hasOwnProperty.call(message, "merchantCenterLinkingConfig")) - $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.encode(message.merchantCenterLinkingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.RedirectAction} message RedirectAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedirectAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.redirectUri = ""; + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + return object; + }; - /** - * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Catalog.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this RedirectAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @instance + * @returns {Object.} JSON object + */ + RedirectAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Catalog message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Catalog.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Catalog(); - 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 4: { - message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Gets the default type url for RedirectAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RedirectAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return message; - }; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.RedirectAction"; + }; - /** - * Decodes a Catalog message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Catalog.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return RedirectAction; + })(); - /** - * Verifies a Catalog message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Catalog.verify = function verify(message) { - if (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.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { - var error = $root.google.cloud.retail.v2alpha.ProductLevelConfig.verify(message.productLevelConfig); - if (error) - return "productLevelConfig." + error; - } - if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify(message.merchantCenterLinkingConfig); - if (error) - return "merchantCenterLinkingConfig." + error; - } - return null; - }; + Rule.TwowaySynonymsAction = (function() { - /** - * Creates a Catalog message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Catalog} Catalog - */ - Catalog.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Catalog) - return object; - var message = new $root.google.cloud.retail.v2alpha.Catalog(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.productLevelConfig != null) { - if (typeof object.productLevelConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Catalog.productLevelConfig: object expected"); - message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.fromObject(object.productLevelConfig); - } - if (object.merchantCenterLinkingConfig != null) { - if (typeof object.merchantCenterLinkingConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Catalog.merchantCenterLinkingConfig: object expected"); - message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.fromObject(object.merchantCenterLinkingConfig); - } - return message; - }; + /** + * Properties of a TwowaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface ITwowaySynonymsAction + * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms + */ - /** - * Creates a plain object from a Catalog message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {google.cloud.retail.v2alpha.Catalog} message Catalog - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Catalog.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.productLevelConfig = null; - object.merchantCenterLinkingConfig = null; + /** + * Constructs a new TwowaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a TwowaySynonymsAction. + * @implements ITwowaySynonymsAction + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set + */ + function TwowaySynonymsAction(properties) { + this.synonyms = []; + if (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.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) - object.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.toObject(message.productLevelConfig, options); - if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) - object.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.toObject(message.merchantCenterLinkingConfig, options); - return object; - }; - /** - * Converts this Catalog to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Catalog - * @instance - * @returns {Object.} JSON object - */ - Catalog.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * TwowaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @instance + */ + TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; - /** - * Gets the default type url for Catalog - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Catalog - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Catalog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Catalog"; - }; - - return Catalog; - })(); - - /** - * AttributeConfigLevel enum. - * @name google.cloud.retail.v2alpha.AttributeConfigLevel - * @enum {number} - * @property {number} ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED=0 ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED value - * @property {number} PRODUCT_LEVEL_ATTRIBUTE_CONFIG=1 PRODUCT_LEVEL_ATTRIBUTE_CONFIG value - * @property {number} CATALOG_LEVEL_ATTRIBUTE_CONFIG=2 CATALOG_LEVEL_ATTRIBUTE_CONFIG value - */ - v2alpha.AttributeConfigLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRODUCT_LEVEL_ATTRIBUTE_CONFIG"] = 1; - values[valuesById[2] = "CATALOG_LEVEL_ATTRIBUTE_CONFIG"] = 2; - return values; - })(); - - /** - * SolutionType enum. - * @name google.cloud.retail.v2alpha.SolutionType - * @enum {number} - * @property {number} SOLUTION_TYPE_UNSPECIFIED=0 SOLUTION_TYPE_UNSPECIFIED value - * @property {number} SOLUTION_TYPE_RECOMMENDATION=1 SOLUTION_TYPE_RECOMMENDATION value - * @property {number} SOLUTION_TYPE_SEARCH=2 SOLUTION_TYPE_SEARCH value - */ - v2alpha.SolutionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SOLUTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SOLUTION_TYPE_RECOMMENDATION"] = 1; - values[valuesById[2] = "SOLUTION_TYPE_SEARCH"] = 2; - return values; - })(); - - /** - * RecommendationsFilteringOption enum. - * @name google.cloud.retail.v2alpha.RecommendationsFilteringOption - * @enum {number} - * @property {number} RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED=0 RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED value - * @property {number} RECOMMENDATIONS_FILTERING_DISABLED=1 RECOMMENDATIONS_FILTERING_DISABLED value - * @property {number} RECOMMENDATIONS_FILTERING_ENABLED=3 RECOMMENDATIONS_FILTERING_ENABLED value - */ - v2alpha.RecommendationsFilteringOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RECOMMENDATIONS_FILTERING_DISABLED"] = 1; - values[valuesById[3] = "RECOMMENDATIONS_FILTERING_ENABLED"] = 3; - return values; - })(); - - /** - * SearchSolutionUseCase enum. - * @name google.cloud.retail.v2alpha.SearchSolutionUseCase - * @enum {number} - * @property {number} SEARCH_SOLUTION_USE_CASE_UNSPECIFIED=0 SEARCH_SOLUTION_USE_CASE_UNSPECIFIED value - * @property {number} SEARCH_SOLUTION_USE_CASE_SEARCH=1 SEARCH_SOLUTION_USE_CASE_SEARCH value - * @property {number} SEARCH_SOLUTION_USE_CASE_BROWSE=2 SEARCH_SOLUTION_USE_CASE_BROWSE value - */ - v2alpha.SearchSolutionUseCase = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SEARCH_SOLUTION_USE_CASE_SEARCH"] = 1; - values[valuesById[2] = "SEARCH_SOLUTION_USE_CASE_BROWSE"] = 2; - return values; - })(); - - v2alpha.Condition = (function() { - - /** - * Properties of a Condition. - * @memberof google.cloud.retail.v2alpha - * @interface ICondition - * @property {Array.|null} [queryTerms] Condition queryTerms - * @property {Array.|null} [activeTimeRange] Condition activeTimeRange - */ - - /** - * Constructs a new Condition. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Condition. - * @implements ICondition - * @constructor - * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set - */ - function Condition(properties) { - this.queryTerms = []; - this.activeTimeRange = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Condition queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Condition - * @instance - */ - Condition.prototype.queryTerms = $util.emptyArray; - - /** - * Condition activeTimeRange. - * @member {Array.} activeTimeRange - * @memberof google.cloud.retail.v2alpha.Condition - * @instance - */ - Condition.prototype.activeTimeRange = $util.emptyArray; - - /** - * Creates a new Condition instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {google.cloud.retail.v2alpha.ICondition=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition} Condition instance - */ - Condition.create = function create(properties) { - return new Condition(properties); - }; + /** + * Creates a new TwowaySynonymsAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance + */ + TwowaySynonymsAction.create = function create(properties) { + return new TwowaySynonymsAction(properties); + }; - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - $root.google.cloud.retail.v2alpha.Condition.QueryTerm.encode(message.queryTerms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.activeTimeRange != null && message.activeTimeRange.length) - for (var i = 0; i < message.activeTimeRange.length; ++i) - $root.google.cloud.retail.v2alpha.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); + return writer; + }; - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {google.cloud.retail.v2alpha.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Condition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push($root.google.cloud.retail.v2alpha.Condition.QueryTerm.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.activeTimeRange && message.activeTimeRange.length)) - message.activeTimeRange = []; - message.activeTimeRange.push($root.google.cloud.retail.v2alpha.Condition.TimeRange.decode(reader, reader.uint32())); + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Condition message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Condition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.verify(message.queryTerms[i]); - if (error) - return "queryTerms." + error; - } - } - if (message.activeTimeRange != null && message.hasOwnProperty("activeTimeRange")) { - if (!Array.isArray(message.activeTimeRange)) - return "activeTimeRange: array expected"; - for (var i = 0; i < message.activeTimeRange.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Condition.TimeRange.verify(message.activeTimeRange[i]); - if (error) - return "activeTimeRange." + error; + /** + * Verifies a TwowaySynonymsAction message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TwowaySynonymsAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; } - } - return null; - }; + return null; + }; - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition} Condition - */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition) - return object; - var message = new $root.google.cloud.retail.v2alpha.Condition(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) { - if (typeof object.queryTerms[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.queryTerms: object expected"); - message.queryTerms[i] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.fromObject(object.queryTerms[i]); + /** + * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction + */ + TwowaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); } - } - if (object.activeTimeRange) { - if (!Array.isArray(object.activeTimeRange)) - throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: array expected"); - message.activeTimeRange = []; - for (var i = 0; i < object.activeTimeRange.length; ++i) { - if (typeof object.activeTimeRange[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.activeTimeRange: object expected"); - message.activeTimeRange[i] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.fromObject(object.activeTimeRange[i]); + return message; + }; + + /** + * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} message TwowaySynonymsAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TwowaySynonymsAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; } - } - return message; - }; + return object; + }; - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {google.cloud.retail.v2alpha.Condition} message Condition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Condition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.queryTerms = []; - object.activeTimeRange = []; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = $root.google.cloud.retail.v2alpha.Condition.QueryTerm.toObject(message.queryTerms[j], options); - } - if (message.activeTimeRange && message.activeTimeRange.length) { - object.activeTimeRange = []; - for (var j = 0; j < message.activeTimeRange.length; ++j) - object.activeTimeRange[j] = $root.google.cloud.retail.v2alpha.Condition.TimeRange.toObject(message.activeTimeRange[j], options); - } - return object; - }; + /** + * Converts this TwowaySynonymsAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @instance + * @returns {Object.} JSON object + */ + TwowaySynonymsAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Condition to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition - * @instance - * @returns {Object.} JSON object - */ - Condition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for TwowaySynonymsAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TwowaySynonymsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction"; + }; - /** - * Gets the default type url for Condition - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Condition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition"; - }; + return TwowaySynonymsAction; + })(); - Condition.QueryTerm = (function() { + Rule.OnewaySynonymsAction = (function() { /** - * Properties of a QueryTerm. - * @memberof google.cloud.retail.v2alpha.Condition - * @interface IQueryTerm - * @property {string|null} [value] QueryTerm value - * @property {boolean|null} [fullMatch] QueryTerm fullMatch + * Properties of an OnewaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IOnewaySynonymsAction + * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms + * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms + * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms */ /** - * Constructs a new QueryTerm. - * @memberof google.cloud.retail.v2alpha.Condition - * @classdesc Represents a QueryTerm. - * @implements IQueryTerm + * Constructs a new OnewaySynonymsAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents an OnewaySynonymsAction. + * @implements IOnewaySynonymsAction * @constructor - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set */ - function QueryTerm(properties) { + function OnewaySynonymsAction(properties) { + this.queryTerms = []; + this.synonyms = []; + this.onewayTerms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51960,89 +57097,112 @@ } /** - * QueryTerm value. - * @member {string} value - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * OnewaySynonymsAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @instance */ - QueryTerm.prototype.value = ""; + OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; /** - * QueryTerm fullMatch. - * @member {boolean} fullMatch - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * OnewaySynonymsAction synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @instance */ - QueryTerm.prototype.fullMatch = false; + OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; /** - * Creates a new QueryTerm instance using the specified properties. + * OnewaySynonymsAction onewayTerms. + * @member {Array.} onewayTerms + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @instance + */ + OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; + + /** + * Creates a new OnewaySynonymsAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm instance + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance */ - QueryTerm.create = function create(properties) { - return new QueryTerm(properties); + OnewaySynonymsAction.create = function create(properties) { + return new OnewaySynonymsAction(properties); }; /** - * Encodes the specified QueryTerm message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryTerm.encode = function encode(message, writer) { + OnewaySynonymsAction.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.fullMatch != null && Object.hasOwnProperty.call(message, "fullMatch")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullMatch); + if (message.onewayTerms != null && message.onewayTerms.length) + for (var i = 0; i < message.onewayTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); return writer; }; /** - * Encodes the specified QueryTerm message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.QueryTerm.verify|verify} messages. + * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static - * @param {google.cloud.retail.v2alpha.Condition.IQueryTerm} message QueryTerm message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryTerm.encodeDelimited = function encodeDelimited(message, writer) { + OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryTerm message from the specified reader or buffer. + * Decodes an OnewaySynonymsAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryTerm.decode = function decode(reader, length) { + OnewaySynonymsAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.value = reader.string(); + case 3: { + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); + break; + } + case 4: { + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); break; } case 2: { - message.fullMatch = reader.bool(); + if (!(message.onewayTerms && message.onewayTerms.length)) + message.onewayTerms = []; + message.onewayTerms.push(reader.string()); break; } default: @@ -52054,132 +57214,180 @@ }; /** - * Decodes a QueryTerm message from the specified reader or buffer, length delimited. + * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryTerm.decodeDelimited = function decodeDelimited(reader) { + OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryTerm message. + * Verifies an OnewaySynonymsAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryTerm.verify = function verify(message) { + OnewaySynonymsAction.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.fullMatch != null && message.hasOwnProperty("fullMatch")) - if (typeof message.fullMatch !== "boolean") - return "fullMatch: boolean expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { + if (!Array.isArray(message.onewayTerms)) + return "onewayTerms: array expected"; + for (var i = 0; i < message.onewayTerms.length; ++i) + if (!$util.isString(message.onewayTerms[i])) + return "onewayTerms: string[] expected"; + } return null; }; /** - * Creates a QueryTerm message from a plain object. Also converts values to their respective internal types. + * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition.QueryTerm} QueryTerm + * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction */ - QueryTerm.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition.QueryTerm) + OnewaySynonymsAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Condition.QueryTerm(); - if (object.value != null) - message.value = String(object.value); - if (object.fullMatch != null) - message.fullMatch = Boolean(object.fullMatch); + var message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + if (object.onewayTerms) { + if (!Array.isArray(object.onewayTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.onewayTerms: array expected"); + message.onewayTerms = []; + for (var i = 0; i < object.onewayTerms.length; ++i) + message.onewayTerms[i] = String(object.onewayTerms[i]); + } return message; }; /** - * Creates a plain object from a QueryTerm message. Also converts values to other types if specified. + * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static - * @param {google.cloud.retail.v2alpha.Condition.QueryTerm} message QueryTerm + * @param {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} message OnewaySynonymsAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryTerm.toObject = function toObject(message, options) { + OnewaySynonymsAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.value = ""; - object.fullMatch = false; + if (options.arrays || options.defaults) { + object.onewayTerms = []; + object.queryTerms = []; + object.synonyms = []; + } + if (message.onewayTerms && message.onewayTerms.length) { + object.onewayTerms = []; + for (var j = 0; j < message.onewayTerms.length; ++j) + object.onewayTerms[j] = message.onewayTerms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.fullMatch != null && message.hasOwnProperty("fullMatch")) - object.fullMatch = message.fullMatch; return object; }; /** - * Converts this QueryTerm to JSON. + * Converts this OnewaySynonymsAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @instance * @returns {Object.} JSON object */ - QueryTerm.prototype.toJSON = function toJSON() { + OnewaySynonymsAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryTerm + * Gets the default type url for OnewaySynonymsAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Condition.QueryTerm + * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryTerm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OnewaySynonymsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition.QueryTerm"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction"; }; - return QueryTerm; + return OnewaySynonymsAction; })(); - Condition.TimeRange = (function() { + Rule.DoNotAssociateAction = (function() { /** - * Properties of a TimeRange. - * @memberof google.cloud.retail.v2alpha.Condition - * @interface ITimeRange - * @property {google.protobuf.ITimestamp|null} [startTime] TimeRange startTime - * @property {google.protobuf.ITimestamp|null} [endTime] TimeRange endTime + * Properties of a DoNotAssociateAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IDoNotAssociateAction + * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms + * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms + * @property {Array.|null} [terms] DoNotAssociateAction terms */ /** - * Constructs a new TimeRange. - * @memberof google.cloud.retail.v2alpha.Condition - * @classdesc Represents a TimeRange. - * @implements ITimeRange + * Constructs a new DoNotAssociateAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @classdesc Represents a DoNotAssociateAction. + * @implements IDoNotAssociateAction * @constructor - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set */ - function TimeRange(properties) { + function DoNotAssociateAction(properties) { + this.queryTerms = []; + this.doNotAssociateTerms = []; + this.terms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52187,89 +57395,112 @@ } /** - * TimeRange startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * DoNotAssociateAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @instance */ - TimeRange.prototype.startTime = null; + DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; /** - * TimeRange endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * DoNotAssociateAction doNotAssociateTerms. + * @member {Array.} doNotAssociateTerms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @instance */ - TimeRange.prototype.endTime = null; + DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; /** - * Creates a new TimeRange instance using the specified properties. + * DoNotAssociateAction terms. + * @member {Array.} terms + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction + * @instance + */ + DoNotAssociateAction.prototype.terms = $util.emptyArray; + + /** + * Creates a new DoNotAssociateAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange instance + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction instance */ - TimeRange.create = function create(properties) { - return new TimeRange(properties); + DoNotAssociateAction.create = function create(properties) { + return new DoNotAssociateAction(properties); }; /** - * Encodes the specified TimeRange message. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeRange.encode = function encode(message, writer) { + DoNotAssociateAction.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(); + if (message.terms != null && message.terms.length) + for (var i = 0; i < message.terms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); return writer; }; /** - * Encodes the specified TimeRange message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Condition.TimeRange.verify|verify} messages. + * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.Condition.ITimeRange} message TimeRange message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeRange.encodeDelimited = function encodeDelimited(message, writer) { + DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeRange message from the specified reader or buffer. + * Decodes a DoNotAssociateAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeRange.decode = function decode(reader, length) { + DoNotAssociateAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 2: { + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); break; } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: { + if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) + message.doNotAssociateTerms = []; + message.doNotAssociateTerms.push(reader.string()); + break; + } + case 1: { + if (!(message.terms && message.terms.length)) + message.terms = []; + message.terms.push(reader.string()); break; } default: @@ -52281,643 +57512,178 @@ }; /** - * Decodes a TimeRange message from the specified reader or buffer, length delimited. + * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeRange.decodeDelimited = function decodeDelimited(reader) { + DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeRange message. + * Verifies a DoNotAssociateAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeRange.verify = function verify(message) { + DoNotAssociateAction.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.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; + if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { + if (!Array.isArray(message.doNotAssociateTerms)) + return "doNotAssociateTerms: array expected"; + for (var i = 0; i < message.doNotAssociateTerms.length; ++i) + if (!$util.isString(message.doNotAssociateTerms[i])) + return "doNotAssociateTerms: string[] expected"; + } + if (message.terms != null && message.hasOwnProperty("terms")) { + if (!Array.isArray(message.terms)) + return "terms: array expected"; + for (var i = 0; i < message.terms.length; ++i) + if (!$util.isString(message.terms[i])) + return "terms: string[] expected"; } return null; }; /** - * Creates a TimeRange message from a plain object. Also converts values to their respective internal types. + * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Condition.TimeRange} TimeRange + * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction */ - TimeRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Condition.TimeRange) + DoNotAssociateAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Condition.TimeRange(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + var message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Condition.TimeRange.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.doNotAssociateTerms) { + if (!Array.isArray(object.doNotAssociateTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); + message.doNotAssociateTerms = []; + for (var i = 0; i < object.doNotAssociateTerms.length; ++i) + message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); + } + if (object.terms) { + if (!Array.isArray(object.terms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.terms: array expected"); + message.terms = []; + for (var i = 0; i < object.terms.length; ++i) + message.terms[i] = String(object.terms[i]); } return message; }; /** - * Creates a plain object from a TimeRange message. Also converts values to other types if specified. + * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static - * @param {google.cloud.retail.v2alpha.Condition.TimeRange} message TimeRange + * @param {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} message DoNotAssociateAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeRange.toObject = function toObject(message, options) { + DoNotAssociateAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; + if (options.arrays || options.defaults) { + object.terms = []; + object.queryTerms = []; + object.doNotAssociateTerms = []; + } + if (message.terms && message.terms.length) { + object.terms = []; + for (var j = 0; j < message.terms.length; ++j) + object.terms[j] = message.terms[j]; + } + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { + object.doNotAssociateTerms = []; + for (var j = 0; j < message.doNotAssociateTerms.length; ++j) + object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; } - 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 TimeRange to JSON. + * Converts this DoNotAssociateAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @instance * @returns {Object.} JSON object */ - TimeRange.prototype.toJSON = function toJSON() { + DoNotAssociateAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeRange + * Gets the default type url for DoNotAssociateAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Condition.TimeRange + * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DoNotAssociateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Condition.TimeRange"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.DoNotAssociateAction"; }; - return TimeRange; + return DoNotAssociateAction; })(); - return Condition; - })(); + Rule.ReplacementAction = (function() { - v2alpha.Rule = (function() { - - /** - * Properties of a Rule. - * @memberof google.cloud.retail.v2alpha - * @interface IRule - * @property {google.cloud.retail.v2alpha.Rule.IBoostAction|null} [boostAction] Rule boostAction - * @property {google.cloud.retail.v2alpha.Rule.IRedirectAction|null} [redirectAction] Rule redirectAction - * @property {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null} [onewaySynonymsAction] Rule onewaySynonymsAction - * @property {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null} [doNotAssociateAction] Rule doNotAssociateAction - * @property {google.cloud.retail.v2alpha.Rule.IReplacementAction|null} [replacementAction] Rule replacementAction - * @property {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction - * @property {google.cloud.retail.v2alpha.Rule.IFilterAction|null} [filterAction] Rule filterAction - * @property {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction - * @property {google.cloud.retail.v2alpha.ICondition|null} [condition] Rule condition - */ - - /** - * Constructs a new Rule. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Rule. - * @implements IRule - * @constructor - * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set - */ - function Rule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Rule boostAction. - * @member {google.cloud.retail.v2alpha.Rule.IBoostAction|null|undefined} boostAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.boostAction = null; - - /** - * Rule redirectAction. - * @member {google.cloud.retail.v2alpha.Rule.IRedirectAction|null|undefined} redirectAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.redirectAction = null; - - /** - * Rule onewaySynonymsAction. - * @member {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction|null|undefined} onewaySynonymsAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.onewaySynonymsAction = null; - - /** - * Rule doNotAssociateAction. - * @member {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction|null|undefined} doNotAssociateAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.doNotAssociateAction = null; - - /** - * Rule replacementAction. - * @member {google.cloud.retail.v2alpha.Rule.IReplacementAction|null|undefined} replacementAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.replacementAction = null; - - /** - * Rule ignoreAction. - * @member {google.cloud.retail.v2alpha.Rule.IIgnoreAction|null|undefined} ignoreAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.ignoreAction = null; - - /** - * Rule filterAction. - * @member {google.cloud.retail.v2alpha.Rule.IFilterAction|null|undefined} filterAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.filterAction = null; - - /** - * Rule twowaySynonymsAction. - * @member {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction|null|undefined} twowaySynonymsAction - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.twowaySynonymsAction = null; - - /** - * Rule condition. - * @member {google.cloud.retail.v2alpha.ICondition|null|undefined} condition - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Rule.prototype.condition = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Rule action. - * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - */ - Object.defineProperty(Rule.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Rule instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {google.cloud.retail.v2alpha.IRule=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule} Rule instance - */ - Rule.create = function create(properties) { - return new Rule(properties); - }; - - /** - * Encodes the specified Rule message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.cloud.retail.v2alpha.Condition.encode(message.condition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.boostAction != null && Object.hasOwnProperty.call(message, "boostAction")) - $root.google.cloud.retail.v2alpha.Rule.BoostAction.encode(message.boostAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.redirectAction != null && Object.hasOwnProperty.call(message, "redirectAction")) - $root.google.cloud.retail.v2alpha.Rule.RedirectAction.encode(message.redirectAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.onewaySynonymsAction != null && Object.hasOwnProperty.call(message, "onewaySynonymsAction")) - $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.encode(message.onewaySynonymsAction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.doNotAssociateAction != null && Object.hasOwnProperty.call(message, "doNotAssociateAction")) - $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.encode(message.doNotAssociateAction, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.replacementAction != null && Object.hasOwnProperty.call(message, "replacementAction")) - $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.encode(message.replacementAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.ignoreAction != null && Object.hasOwnProperty.call(message, "ignoreAction")) - $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.encode(message.ignoreAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.filterAction != null && Object.hasOwnProperty.call(message, "filterAction")) - $root.google.cloud.retail.v2alpha.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) - $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {google.cloud.retail.v2alpha.IRule} message Rule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Rule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Rule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule} Rule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.decode(reader, reader.uint32()); - break; - } - case 3: { - message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.decode(reader, reader.uint32()); - break; - } - case 7: { - message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.decode(reader, reader.uint32()); - break; - } - case 8: { - message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.decode(reader, reader.uint32()); - break; - } - case 9: { - message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.decode(reader, reader.uint32()); - break; - } - case 10: { - message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.decode(reader, reader.uint32()); - break; - } - case 11: { - message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); - break; - } - case 1: { - message.condition = $root.google.cloud.retail.v2alpha.Condition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Rule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule} Rule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Rule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Rule message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Rule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.BoostAction.verify(message.boostAction); - if (error) - return "boostAction." + error; - } - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.verify(message.redirectAction); - if (error) - return "redirectAction." + error; - } - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify(message.onewaySynonymsAction); - if (error) - return "onewaySynonymsAction." + error; - } - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify(message.doNotAssociateAction); - if (error) - return "doNotAssociateAction." + error; - } - } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.verify(message.replacementAction); - if (error) - return "replacementAction." + error; - } - } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.verify(message.ignoreAction); - if (error) - return "ignoreAction." + error; - } - } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.FilterAction.verify(message.filterAction); - if (error) - return "filterAction." + error; - } - } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify(message.twowaySynonymsAction); - if (error) - return "twowaySynonymsAction." + error; - } - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.cloud.retail.v2alpha.Condition.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Rule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule} Rule - */ - Rule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule(); - if (object.boostAction != null) { - if (typeof object.boostAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.boostAction: object expected"); - message.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.fromObject(object.boostAction); - } - if (object.redirectAction != null) { - if (typeof object.redirectAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.redirectAction: object expected"); - message.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.fromObject(object.redirectAction); - } - if (object.onewaySynonymsAction != null) { - if (typeof object.onewaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.onewaySynonymsAction: object expected"); - message.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.fromObject(object.onewaySynonymsAction); - } - if (object.doNotAssociateAction != null) { - if (typeof object.doNotAssociateAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.doNotAssociateAction: object expected"); - message.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.fromObject(object.doNotAssociateAction); - } - if (object.replacementAction != null) { - if (typeof object.replacementAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.replacementAction: object expected"); - message.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.fromObject(object.replacementAction); - } - if (object.ignoreAction != null) { - if (typeof object.ignoreAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.ignoreAction: object expected"); - message.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.fromObject(object.ignoreAction); - } - if (object.filterAction != null) { - if (typeof object.filterAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.filterAction: object expected"); - message.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.fromObject(object.filterAction); - } - if (object.twowaySynonymsAction != null) { - if (typeof object.twowaySynonymsAction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.twowaySynonymsAction: object expected"); - message.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Rule.condition: object expected"); - message.condition = $root.google.cloud.retail.v2alpha.Condition.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Rule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {google.cloud.retail.v2alpha.Rule} message Rule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Rule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.condition = null; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.cloud.retail.v2alpha.Condition.toObject(message.condition, options); - if (message.boostAction != null && message.hasOwnProperty("boostAction")) { - object.boostAction = $root.google.cloud.retail.v2alpha.Rule.BoostAction.toObject(message.boostAction, options); - if (options.oneofs) - object.action = "boostAction"; - } - if (message.redirectAction != null && message.hasOwnProperty("redirectAction")) { - object.redirectAction = $root.google.cloud.retail.v2alpha.Rule.RedirectAction.toObject(message.redirectAction, options); - if (options.oneofs) - object.action = "redirectAction"; - } - if (message.onewaySynonymsAction != null && message.hasOwnProperty("onewaySynonymsAction")) { - object.onewaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.toObject(message.onewaySynonymsAction, options); - if (options.oneofs) - object.action = "onewaySynonymsAction"; - } - if (message.doNotAssociateAction != null && message.hasOwnProperty("doNotAssociateAction")) { - object.doNotAssociateAction = $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.toObject(message.doNotAssociateAction, options); - if (options.oneofs) - object.action = "doNotAssociateAction"; - } - if (message.replacementAction != null && message.hasOwnProperty("replacementAction")) { - object.replacementAction = $root.google.cloud.retail.v2alpha.Rule.ReplacementAction.toObject(message.replacementAction, options); - if (options.oneofs) - object.action = "replacementAction"; - } - if (message.ignoreAction != null && message.hasOwnProperty("ignoreAction")) { - object.ignoreAction = $root.google.cloud.retail.v2alpha.Rule.IgnoreAction.toObject(message.ignoreAction, options); - if (options.oneofs) - object.action = "ignoreAction"; - } - if (message.filterAction != null && message.hasOwnProperty("filterAction")) { - object.filterAction = $root.google.cloud.retail.v2alpha.Rule.FilterAction.toObject(message.filterAction, options); - if (options.oneofs) - object.action = "filterAction"; - } - if (message.twowaySynonymsAction != null && message.hasOwnProperty("twowaySynonymsAction")) { - object.twowaySynonymsAction = $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.toObject(message.twowaySynonymsAction, options); - if (options.oneofs) - object.action = "twowaySynonymsAction"; - } - return object; - }; - - /** - * Converts this Rule to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule - * @instance - * @returns {Object.} JSON object - */ - Rule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Rule - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule"; - }; - - Rule.BoostAction = (function() { - - /** - * Properties of a BoostAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IBoostAction - * @property {number|null} [boost] BoostAction boost - * @property {string|null} [productsFilter] BoostAction productsFilter - */ + /** + * Properties of a ReplacementAction. + * @memberof google.cloud.retail.v2alpha.Rule + * @interface IReplacementAction + * @property {Array.|null} [queryTerms] ReplacementAction queryTerms + * @property {string|null} [replacementTerm] ReplacementAction replacementTerm + * @property {string|null} [term] ReplacementAction term + */ /** - * Constructs a new BoostAction. + * Constructs a new ReplacementAction. * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a BoostAction. - * @implements IBoostAction + * @classdesc Represents a ReplacementAction. + * @implements IReplacementAction * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set */ - function BoostAction(properties) { + function ReplacementAction(properties) { + this.queryTerms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52925,89 +57691,106 @@ } /** - * BoostAction boost. - * @member {number} boost - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * ReplacementAction queryTerms. + * @member {Array.} queryTerms + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @instance */ - BoostAction.prototype.boost = 0; + ReplacementAction.prototype.queryTerms = $util.emptyArray; /** - * BoostAction productsFilter. - * @member {string} productsFilter - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * ReplacementAction replacementTerm. + * @member {string} replacementTerm + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @instance */ - BoostAction.prototype.productsFilter = ""; + ReplacementAction.prototype.replacementTerm = ""; /** - * Creates a new BoostAction instance using the specified properties. + * ReplacementAction term. + * @member {string} term + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction + * @instance + */ + ReplacementAction.prototype.term = ""; + + /** + * Creates a new ReplacementAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction instance + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction instance */ - BoostAction.create = function create(properties) { - return new BoostAction(properties); + ReplacementAction.create = function create(properties) { + return new ReplacementAction(properties); }; /** - * Encodes the specified BoostAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostAction.encode = function encode(message, writer) { + ReplacementAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.boost); - if (message.productsFilter != null && Object.hasOwnProperty.call(message, "productsFilter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.productsFilter); + if (message.term != null && Object.hasOwnProperty.call(message, "term")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); + if (message.queryTerms != null && message.queryTerms.length) + for (var i = 0; i < message.queryTerms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); + if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); return writer; }; /** - * Encodes the specified BoostAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.BoostAction.verify|verify} messages. + * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IBoostAction} message BoostAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostAction.encodeDelimited = function encodeDelimited(message, writer) { + ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BoostAction message from the specified reader or buffer. + * Decodes a ReplacementAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostAction.decode = function decode(reader, length) { + ReplacementAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.boost = reader.float(); + case 2: { + if (!(message.queryTerms && message.queryTerms.length)) + message.queryTerms = []; + message.queryTerms.push(reader.string()); break; } - case 2: { - message.productsFilter = reader.string(); + case 3: { + message.replacementTerm = reader.string(); + break; + } + case 1: { + message.term = reader.string(); break; } default: @@ -53019,131 +57802,153 @@ }; /** - * Decodes a BoostAction message from the specified reader or buffer, length delimited. + * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostAction.decodeDelimited = function decodeDelimited(reader) { + ReplacementAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BoostAction message. + * Verifies a ReplacementAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BoostAction.verify = function verify(message) { + ReplacementAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - if (!$util.isString(message.productsFilter)) - return "productsFilter: string expected"; + if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { + if (!Array.isArray(message.queryTerms)) + return "queryTerms: array expected"; + for (var i = 0; i < message.queryTerms.length; ++i) + if (!$util.isString(message.queryTerms[i])) + return "queryTerms: string[] expected"; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + if (!$util.isString(message.replacementTerm)) + return "replacementTerm: string expected"; + if (message.term != null && message.hasOwnProperty("term")) + if (!$util.isString(message.term)) + return "term: string expected"; return null; }; /** - * Creates a BoostAction message from a plain object. Also converts values to their respective internal types. + * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.BoostAction} BoostAction + * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction */ - BoostAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.BoostAction) + ReplacementAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ReplacementAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.BoostAction(); - if (object.boost != null) - message.boost = Number(object.boost); - if (object.productsFilter != null) - message.productsFilter = String(object.productsFilter); + var message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); + if (object.queryTerms) { + if (!Array.isArray(object.queryTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.ReplacementAction.queryTerms: array expected"); + message.queryTerms = []; + for (var i = 0; i < object.queryTerms.length; ++i) + message.queryTerms[i] = String(object.queryTerms[i]); + } + if (object.replacementTerm != null) + message.replacementTerm = String(object.replacementTerm); + if (object.term != null) + message.term = String(object.term); return message; }; /** - * Creates a plain object from a BoostAction message. Also converts values to other types if specified. + * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static - * @param {google.cloud.retail.v2alpha.Rule.BoostAction} message BoostAction + * @param {google.cloud.retail.v2alpha.Rule.ReplacementAction} message ReplacementAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoostAction.toObject = function toObject(message, options) { + ReplacementAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.queryTerms = []; if (options.defaults) { - object.boost = 0; - object.productsFilter = ""; + object.term = ""; + object.replacementTerm = ""; } - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; - if (message.productsFilter != null && message.hasOwnProperty("productsFilter")) - object.productsFilter = message.productsFilter; + if (message.term != null && message.hasOwnProperty("term")) + object.term = message.term; + if (message.queryTerms && message.queryTerms.length) { + object.queryTerms = []; + for (var j = 0; j < message.queryTerms.length; ++j) + object.queryTerms[j] = message.queryTerms[j]; + } + if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) + object.replacementTerm = message.replacementTerm; return object; }; /** - * Converts this BoostAction to JSON. + * Converts this ReplacementAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @instance * @returns {Object.} JSON object */ - BoostAction.prototype.toJSON = function toJSON() { + ReplacementAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BoostAction + * Gets the default type url for ReplacementAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.BoostAction + * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BoostAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReplacementAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.BoostAction"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.ReplacementAction"; }; - return BoostAction; + return ReplacementAction; })(); - Rule.FilterAction = (function() { + Rule.IgnoreAction = (function() { /** - * Properties of a FilterAction. + * Properties of an IgnoreAction. * @memberof google.cloud.retail.v2alpha.Rule - * @interface IFilterAction - * @property {string|null} [filter] FilterAction filter + * @interface IIgnoreAction + * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms */ /** - * Constructs a new FilterAction. + * Constructs a new IgnoreAction. * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a FilterAction. - * @implements IFilterAction + * @classdesc Represents an IgnoreAction. + * @implements IIgnoreAction * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set */ - function FilterAction(properties) { + function IgnoreAction(properties) { + this.ignoreTerms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53151,75 +57956,78 @@ } /** - * FilterAction filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * IgnoreAction ignoreTerms. + * @member {Array.} ignoreTerms + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @instance */ - FilterAction.prototype.filter = ""; + IgnoreAction.prototype.ignoreTerms = $util.emptyArray; /** - * Creates a new FilterAction instance using the specified properties. + * Creates a new IgnoreAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction instance + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction instance */ - FilterAction.create = function create(properties) { - return new FilterAction(properties); + IgnoreAction.create = function create(properties) { + return new IgnoreAction(properties); }; /** - * Encodes the specified FilterAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FilterAction.encode = function encode(message, writer) { + IgnoreAction.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.ignoreTerms != null && message.ignoreTerms.length) + for (var i = 0; i < message.ignoreTerms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); return writer; }; /** - * Encodes the specified FilterAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.FilterAction.verify|verify} messages. + * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IFilterAction} message FilterAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FilterAction.encodeDelimited = function encodeDelimited(message, writer) { + IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FilterAction message from the specified reader or buffer. + * Decodes an IgnoreAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FilterAction.decode = function decode(reader, length) { + IgnoreAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.filter = reader.string(); + if (!(message.ignoreTerms && message.ignoreTerms.length)) + message.ignoreTerms = []; + message.ignoreTerms.push(reader.string()); break; } default: @@ -53231,122 +58039,135 @@ }; /** - * Decodes a FilterAction message from the specified reader or buffer, length delimited. + * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FilterAction.decodeDelimited = function decodeDelimited(reader) { + IgnoreAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FilterAction message. + * Verifies an IgnoreAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FilterAction.verify = function verify(message) { + IgnoreAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { + if (!Array.isArray(message.ignoreTerms)) + return "ignoreTerms: array expected"; + for (var i = 0; i < message.ignoreTerms.length; ++i) + if (!$util.isString(message.ignoreTerms[i])) + return "ignoreTerms: string[] expected"; + } return null; }; /** - * Creates a FilterAction message from a plain object. Also converts values to their respective internal types. + * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.FilterAction} FilterAction + * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction */ - FilterAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.FilterAction) + IgnoreAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.IgnoreAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.FilterAction(); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); + if (object.ignoreTerms) { + if (!Array.isArray(object.ignoreTerms)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.IgnoreAction.ignoreTerms: array expected"); + message.ignoreTerms = []; + for (var i = 0; i < object.ignoreTerms.length; ++i) + message.ignoreTerms[i] = String(object.ignoreTerms[i]); + } return message; }; /** - * Creates a plain object from a FilterAction message. Also converts values to other types if specified. + * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static - * @param {google.cloud.retail.v2alpha.Rule.FilterAction} message FilterAction + * @param {google.cloud.retail.v2alpha.Rule.IgnoreAction} message IgnoreAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FilterAction.toObject = function toObject(message, options) { + IgnoreAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.filter = ""; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (options.arrays || options.defaults) + object.ignoreTerms = []; + if (message.ignoreTerms && message.ignoreTerms.length) { + object.ignoreTerms = []; + for (var j = 0; j < message.ignoreTerms.length; ++j) + object.ignoreTerms[j] = message.ignoreTerms[j]; + } return object; }; /** - * Converts this FilterAction to JSON. + * Converts this IgnoreAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @instance * @returns {Object.} JSON object */ - FilterAction.prototype.toJSON = function toJSON() { + IgnoreAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FilterAction + * Gets the default type url for IgnoreAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.FilterAction + * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FilterAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IgnoreAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.FilterAction"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.IgnoreAction"; }; - return FilterAction; + return IgnoreAction; })(); - Rule.RedirectAction = (function() { + Rule.ForceReturnFacetAction = (function() { /** - * Properties of a RedirectAction. + * Properties of a ForceReturnFacetAction. * @memberof google.cloud.retail.v2alpha.Rule - * @interface IRedirectAction - * @property {string|null} [redirectUri] RedirectAction redirectUri + * @interface IForceReturnFacetAction + * @property {Array.|null} [facetPositionAdjustments] ForceReturnFacetAction facetPositionAdjustments */ /** - * Constructs a new RedirectAction. + * Constructs a new ForceReturnFacetAction. * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a RedirectAction. - * @implements IRedirectAction + * @classdesc Represents a ForceReturnFacetAction. + * @implements IForceReturnFacetAction * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction=} [properties] Properties to set */ - function RedirectAction(properties) { + function ForceReturnFacetAction(properties) { + this.facetPositionAdjustments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53354,75 +58175,78 @@ } /** - * RedirectAction redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * ForceReturnFacetAction facetPositionAdjustments. + * @member {Array.} facetPositionAdjustments + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @instance */ - RedirectAction.prototype.redirectUri = ""; + ForceReturnFacetAction.prototype.facetPositionAdjustments = $util.emptyArray; /** - * Creates a new RedirectAction instance using the specified properties. + * Creates a new ForceReturnFacetAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction instance + * @param {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction} ForceReturnFacetAction instance */ - RedirectAction.create = function create(properties) { - return new RedirectAction(properties); + ForceReturnFacetAction.create = function create(properties) { + return new ForceReturnFacetAction(properties); }; /** - * Encodes the specified RedirectAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RedirectAction.encode = function encode(message, writer) { + ForceReturnFacetAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.redirectUri); + if (message.facetPositionAdjustments != null && message.facetPositionAdjustments.length) + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) + $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.encode(message.facetPositionAdjustments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified RedirectAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RedirectAction.verify|verify} messages. + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IRedirectAction} message RedirectAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + ForceReturnFacetAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RedirectAction message from the specified reader or buffer. + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction} ForceReturnFacetAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RedirectAction.decode = function decode(reader, length) { + ForceReturnFacetAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.redirectUri = reader.string(); + if (!(message.facetPositionAdjustments && message.facetPositionAdjustments.length)) + message.facetPositionAdjustments = []; + message.facetPositionAdjustments.push($root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.decode(reader, reader.uint32())); break; } default: @@ -53434,346 +58258,367 @@ }; /** - * Decodes a RedirectAction message from the specified reader or buffer, length delimited. + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction} ForceReturnFacetAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RedirectAction.decodeDelimited = function decodeDelimited(reader) { + ForceReturnFacetAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RedirectAction message. + * Verifies a ForceReturnFacetAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RedirectAction.verify = function verify(message) { + ForceReturnFacetAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; + if (message.facetPositionAdjustments != null && message.hasOwnProperty("facetPositionAdjustments")) { + if (!Array.isArray(message.facetPositionAdjustments)) + return "facetPositionAdjustments: array expected"; + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify(message.facetPositionAdjustments[i]); + if (error) + return "facetPositionAdjustments." + error; + } + } return null; }; /** - * Creates a RedirectAction message from a plain object. Also converts values to their respective internal types. + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.RedirectAction} RedirectAction + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction} ForceReturnFacetAction */ - RedirectAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.RedirectAction) + ForceReturnFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.RedirectAction(); - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); + var message = new $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction(); + if (object.facetPositionAdjustments) { + if (!Array.isArray(object.facetPositionAdjustments)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.facetPositionAdjustments: array expected"); + message.facetPositionAdjustments = []; + for (var i = 0; i < object.facetPositionAdjustments.length; ++i) { + if (typeof object.facetPositionAdjustments[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.facetPositionAdjustments: object expected"); + message.facetPositionAdjustments[i] = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.fromObject(object.facetPositionAdjustments[i]); + } + } return message; }; /** - * Creates a plain object from a RedirectAction message. Also converts values to other types if specified. + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.RedirectAction} message RedirectAction + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction} message ForceReturnFacetAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RedirectAction.toObject = function toObject(message, options) { + ForceReturnFacetAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.redirectUri = ""; - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; + if (options.arrays || options.defaults) + object.facetPositionAdjustments = []; + if (message.facetPositionAdjustments && message.facetPositionAdjustments.length) { + object.facetPositionAdjustments = []; + for (var j = 0; j < message.facetPositionAdjustments.length; ++j) + object.facetPositionAdjustments[j] = $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.toObject(message.facetPositionAdjustments[j], options); + } return object; }; /** - * Converts this RedirectAction to JSON. + * Converts this ForceReturnFacetAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @instance * @returns {Object.} JSON object */ - RedirectAction.prototype.toJSON = function toJSON() { + ForceReturnFacetAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RedirectAction + * Gets the default type url for ForceReturnFacetAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.RedirectAction + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RedirectAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ForceReturnFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.RedirectAction"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction"; }; - return RedirectAction; - })(); - - Rule.TwowaySynonymsAction = (function() { + ForceReturnFacetAction.FacetPositionAdjustment = (function() { - /** - * Properties of a TwowaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface ITwowaySynonymsAction - * @property {Array.|null} [synonyms] TwowaySynonymsAction synonyms - */ + /** + * Properties of a FacetPositionAdjustment. + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction + * @interface IFacetPositionAdjustment + * @property {string|null} [attributeName] FacetPositionAdjustment attributeName + * @property {number|null} [position] FacetPositionAdjustment position + */ - /** - * Constructs a new TwowaySynonymsAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a TwowaySynonymsAction. - * @implements ITwowaySynonymsAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set - */ - function TwowaySynonymsAction(properties) { - this.synonyms = []; - if (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 FacetPositionAdjustment. + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction + * @classdesc Represents a FacetPositionAdjustment. + * @implements IFacetPositionAdjustment + * @constructor + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + */ + function FacetPositionAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * TwowaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @instance - */ - TwowaySynonymsAction.prototype.synonyms = $util.emptyArray; + /** + * FacetPositionAdjustment attributeName. + * @member {string} attributeName + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.attributeName = ""; - /** - * Creates a new TwowaySynonymsAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction instance - */ - TwowaySynonymsAction.create = function create(properties) { - return new TwowaySynonymsAction(properties); - }; + /** + * FacetPositionAdjustment position. + * @member {number} position + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.position = 0; - /** - * Encodes the specified TwowaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.synonyms[i]); - return writer; - }; + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment instance + */ + FacetPositionAdjustment.create = function create(properties) { + return new FacetPositionAdjustment(properties); + }; - /** - * Encodes the specified TwowaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ITwowaySynonymsAction} message TwowaySynonymsAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TwowaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeName != null && Object.hasOwnProperty.call(message, "attributeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeName); + if (message.position != null && Object.hasOwnProperty.call(message, "position")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.position); + return writer; + }; - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributeName = reader.string(); + break; + } + case 2: { + message.position = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a TwowaySynonymsAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TwowaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a TwowaySynonymsAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TwowaySynonymsAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; + /** + * Verifies a FacetPositionAdjustment message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetPositionAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + if (!$util.isString(message.attributeName)) + return "attributeName: string expected"; + if (message.position != null && message.hasOwnProperty("position")) + if (!$util.isInteger(message.position)) + return "position: integer expected"; + return null; + }; - /** - * Creates a TwowaySynonymsAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} TwowaySynonymsAction - */ - TwowaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction) + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + */ + FacetPositionAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment) + return object; + var message = new $root.google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + if (object.attributeName != null) + message.attributeName = String(object.attributeName); + if (object.position != null) + message.position = object.position | 0; + return message; + }; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment} message FacetPositionAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetPositionAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeName = ""; + object.position = 0; + } + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + object.attributeName = message.attributeName; + if (message.position != null && message.hasOwnProperty("position")) + object.position = message.position; return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction(); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; + }; - /** - * Creates a plain object from a TwowaySynonymsAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction} message TwowaySynonymsAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TwowaySynonymsAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * Converts this FacetPositionAdjustment to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + * @returns {Object.} JSON object + */ + FacetPositionAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this TwowaySynonymsAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @instance - * @returns {Object.} JSON object - */ - TwowaySynonymsAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for FacetPositionAdjustment + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetPositionAdjustment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.ForceReturnFacetAction.FacetPositionAdjustment"; + }; - /** - * Gets the default type url for TwowaySynonymsAction - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TwowaySynonymsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.TwowaySynonymsAction"; - }; + return FacetPositionAdjustment; + })(); - return TwowaySynonymsAction; + return ForceReturnFacetAction; })(); - Rule.OnewaySynonymsAction = (function() { + Rule.RemoveFacetAction = (function() { /** - * Properties of an OnewaySynonymsAction. + * Properties of a RemoveFacetAction. * @memberof google.cloud.retail.v2alpha.Rule - * @interface IOnewaySynonymsAction - * @property {Array.|null} [queryTerms] OnewaySynonymsAction queryTerms - * @property {Array.|null} [synonyms] OnewaySynonymsAction synonyms - * @property {Array.|null} [onewayTerms] OnewaySynonymsAction onewayTerms + * @interface IRemoveFacetAction + * @property {Array.|null} [attributeNames] RemoveFacetAction attributeNames */ /** - * Constructs a new OnewaySynonymsAction. + * Constructs a new RemoveFacetAction. * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents an OnewaySynonymsAction. - * @implements IOnewaySynonymsAction + * @classdesc Represents a RemoveFacetAction. + * @implements IRemoveFacetAction * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction=} [properties] Properties to set */ - function OnewaySynonymsAction(properties) { - this.queryTerms = []; - this.synonyms = []; - this.onewayTerms = []; + function RemoveFacetAction(properties) { + this.attributeNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53781,112 +58626,78 @@ } /** - * OnewaySynonymsAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.queryTerms = $util.emptyArray; - - /** - * OnewaySynonymsAction synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction - * @instance - */ - OnewaySynonymsAction.prototype.synonyms = $util.emptyArray; - - /** - * OnewaySynonymsAction onewayTerms. - * @member {Array.} onewayTerms - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * RemoveFacetAction attributeNames. + * @member {Array.} attributeNames + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @instance */ - OnewaySynonymsAction.prototype.onewayTerms = $util.emptyArray; + RemoveFacetAction.prototype.attributeNames = $util.emptyArray; /** - * Creates a new OnewaySynonymsAction instance using the specified properties. + * Creates a new RemoveFacetAction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction instance + * @param {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Rule.RemoveFacetAction} RemoveFacetAction instance */ - OnewaySynonymsAction.create = function create(properties) { - return new OnewaySynonymsAction(properties); + RemoveFacetAction.create = function create(properties) { + return new RemoveFacetAction(properties); }; /** - * Encodes the specified OnewaySynonymsAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RemoveFacetAction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnewaySynonymsAction.encode = function encode(message, writer) { + RemoveFacetAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.onewayTerms != null && message.onewayTerms.length) - for (var i = 0; i < message.onewayTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.onewayTerms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.queryTerms[i]); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.synonyms[i]); + if (message.attributeNames != null && message.attributeNames.length) + for (var i = 0; i < message.attributeNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeNames[i]); return writer; }; /** - * Encodes the specified OnewaySynonymsAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.verify|verify} messages. + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.RemoveFacetAction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.IOnewaySynonymsAction} message OnewaySynonymsAction message or plain object to encode + * @param {google.cloud.retail.v2alpha.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnewaySynonymsAction.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFacetAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer. + * Decodes a RemoveFacetAction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @returns {google.cloud.retail.v2alpha.Rule.RemoveFacetAction} RemoveFacetAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OnewaySynonymsAction.decode = function decode(reader, length) { + RemoveFacetAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: { - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - } - case 4: { - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - } - case 2: { - if (!(message.onewayTerms && message.onewayTerms.length)) - message.onewayTerms = []; - message.onewayTerms.push(reader.string()); + case 1: { + if (!(message.attributeNames && message.attributeNames.length)) + message.attributeNames = []; + message.attributeNames.push(reader.string()); break; } default: @@ -53898,1257 +58709,432 @@ }; /** - * Decodes an OnewaySynonymsAction message from the specified reader or buffer, length delimited. + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @returns {google.cloud.retail.v2alpha.Rule.RemoveFacetAction} RemoveFacetAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OnewaySynonymsAction.decodeDelimited = function decodeDelimited(reader) { + RemoveFacetAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OnewaySynonymsAction message. + * Verifies a RemoveFacetAction message. * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OnewaySynonymsAction.verify = function verify(message) { + RemoveFacetAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - if (message.onewayTerms != null && message.hasOwnProperty("onewayTerms")) { - if (!Array.isArray(message.onewayTerms)) - return "onewayTerms: array expected"; - for (var i = 0; i < message.onewayTerms.length; ++i) - if (!$util.isString(message.onewayTerms[i])) - return "onewayTerms: string[] expected"; + if (message.attributeNames != null && message.hasOwnProperty("attributeNames")) { + if (!Array.isArray(message.attributeNames)) + return "attributeNames: array expected"; + for (var i = 0; i < message.attributeNames.length; ++i) + if (!$util.isString(message.attributeNames[i])) + return "attributeNames: string[] expected"; } return null; }; /** - * Creates an OnewaySynonymsAction message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} OnewaySynonymsAction + * @returns {google.cloud.retail.v2alpha.Rule.RemoveFacetAction} RemoveFacetAction */ - OnewaySynonymsAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction) + RemoveFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction) return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - if (object.onewayTerms) { - if (!Array.isArray(object.onewayTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction.onewayTerms: array expected"); - message.onewayTerms = []; - for (var i = 0; i < object.onewayTerms.length; ++i) - message.onewayTerms[i] = String(object.onewayTerms[i]); + var message = new $root.google.cloud.retail.v2alpha.Rule.RemoveFacetAction(); + if (object.attributeNames) { + if (!Array.isArray(object.attributeNames)) + throw TypeError(".google.cloud.retail.v2alpha.Rule.RemoveFacetAction.attributeNames: array expected"); + message.attributeNames = []; + for (var i = 0; i < object.attributeNames.length; ++i) + message.attributeNames[i] = String(object.attributeNames[i]); } return message; }; /** - * Creates a plain object from an OnewaySynonymsAction message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static - * @param {google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction} message OnewaySynonymsAction + * @param {google.cloud.retail.v2alpha.Rule.RemoveFacetAction} message RemoveFacetAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OnewaySynonymsAction.toObject = function toObject(message, options) { + RemoveFacetAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.onewayTerms = []; - object.queryTerms = []; - object.synonyms = []; - } - if (message.onewayTerms && message.onewayTerms.length) { - object.onewayTerms = []; - for (var j = 0; j < message.onewayTerms.length; ++j) - object.onewayTerms[j] = message.onewayTerms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; + if (options.arrays || options.defaults) + object.attributeNames = []; + if (message.attributeNames && message.attributeNames.length) { + object.attributeNames = []; + for (var j = 0; j < message.attributeNames.length; ++j) + object.attributeNames[j] = message.attributeNames[j]; } return object; }; /** - * Converts this OnewaySynonymsAction to JSON. + * Converts this RemoveFacetAction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @instance * @returns {Object.} JSON object */ - OnewaySynonymsAction.prototype.toJSON = function toJSON() { + RemoveFacetAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OnewaySynonymsAction + * Gets the default type url for RemoveFacetAction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction + * @memberof google.cloud.retail.v2alpha.Rule.RemoveFacetAction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OnewaySynonymsAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.OnewaySynonymsAction"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.RemoveFacetAction"; }; - return OnewaySynonymsAction; + return RemoveFacetAction; })(); - Rule.DoNotAssociateAction = (function() { + return Rule; + })(); - /** - * Properties of a DoNotAssociateAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IDoNotAssociateAction - * @property {Array.|null} [queryTerms] DoNotAssociateAction queryTerms - * @property {Array.|null} [doNotAssociateTerms] DoNotAssociateAction doNotAssociateTerms - * @property {Array.|null} [terms] DoNotAssociateAction terms - */ + v2alpha.Audience = (function() { - /** - * Constructs a new DoNotAssociateAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a DoNotAssociateAction. - * @implements IDoNotAssociateAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set - */ - function DoNotAssociateAction(properties) { - this.queryTerms = []; - this.doNotAssociateTerms = []; - this.terms = []; - if (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 Audience. + * @memberof google.cloud.retail.v2alpha + * @interface IAudience + * @property {Array.|null} [genders] Audience genders + * @property {Array.|null} [ageGroups] Audience ageGroups + */ - /** - * DoNotAssociateAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.queryTerms = $util.emptyArray; + /** + * Constructs a new Audience. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an Audience. + * @implements IAudience + * @constructor + * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set + */ + function Audience(properties) { + this.genders = []; + this.ageGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * DoNotAssociateAction doNotAssociateTerms. - * @member {Array.} doNotAssociateTerms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.doNotAssociateTerms = $util.emptyArray; + /** + * Audience genders. + * @member {Array.} genders + * @memberof google.cloud.retail.v2alpha.Audience + * @instance + */ + Audience.prototype.genders = $util.emptyArray; - /** - * DoNotAssociateAction terms. - * @member {Array.} terms - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - */ - DoNotAssociateAction.prototype.terms = $util.emptyArray; + /** + * Audience ageGroups. + * @member {Array.} ageGroups + * @memberof google.cloud.retail.v2alpha.Audience + * @instance + */ + Audience.prototype.ageGroups = $util.emptyArray; - /** - * Creates a new DoNotAssociateAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction instance - */ - DoNotAssociateAction.create = function create(properties) { - return new DoNotAssociateAction(properties); - }; + /** + * Creates a new Audience instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Audience} Audience instance + */ + Audience.create = function create(properties) { + return new Audience(properties); + }; - /** - * Encodes the specified DoNotAssociateAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoNotAssociateAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.terms != null && message.terms.length) - for (var i = 0; i < message.terms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.terms[i]); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.doNotAssociateTerms != null && message.doNotAssociateTerms.length) - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.doNotAssociateTerms[i]); - return writer; - }; + /** + * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audience.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genders != null && message.genders.length) + for (var i = 0; i < message.genders.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); + if (message.ageGroups != null && message.ageGroups.length) + for (var i = 0; i < message.ageGroups.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); + return writer; + }; - /** - * Encodes the specified DoNotAssociateAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IDoNotAssociateAction} message DoNotAssociateAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoNotAssociateAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Audience.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoNotAssociateAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - } - case 3: { - if (!(message.doNotAssociateTerms && message.doNotAssociateTerms.length)) - message.doNotAssociateTerms = []; - message.doNotAssociateTerms.push(reader.string()); - break; - } - case 1: { - if (!(message.terms && message.terms.length)) - message.terms = []; - message.terms.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an Audience message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Audience} Audience + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audience.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Audience(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.genders && message.genders.length)) + message.genders = []; + message.genders.push(reader.string()); + break; + } + case 2: { + if (!(message.ageGroups && message.ageGroups.length)) + message.ageGroups = []; + message.ageGroups.push(reader.string()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a DoNotAssociateAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoNotAssociateAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a DoNotAssociateAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoNotAssociateAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.doNotAssociateTerms != null && message.hasOwnProperty("doNotAssociateTerms")) { - if (!Array.isArray(message.doNotAssociateTerms)) - return "doNotAssociateTerms: array expected"; - for (var i = 0; i < message.doNotAssociateTerms.length; ++i) - if (!$util.isString(message.doNotAssociateTerms[i])) - return "doNotAssociateTerms: string[] expected"; - } - if (message.terms != null && message.hasOwnProperty("terms")) { - if (!Array.isArray(message.terms)) - return "terms: array expected"; - for (var i = 0; i < message.terms.length; ++i) - if (!$util.isString(message.terms[i])) - return "terms: string[] expected"; - } - return null; - }; + /** + * Decodes an Audience message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Audience} Audience + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Audience.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a DoNotAssociateAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} DoNotAssociateAction - */ - DoNotAssociateAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.DoNotAssociateAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.doNotAssociateTerms) { - if (!Array.isArray(object.doNotAssociateTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.doNotAssociateTerms: array expected"); - message.doNotAssociateTerms = []; - for (var i = 0; i < object.doNotAssociateTerms.length; ++i) - message.doNotAssociateTerms[i] = String(object.doNotAssociateTerms[i]); - } - if (object.terms) { - if (!Array.isArray(object.terms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.DoNotAssociateAction.terms: array expected"); - message.terms = []; - for (var i = 0; i < object.terms.length; ++i) - message.terms[i] = String(object.terms[i]); - } - return message; - }; + /** + * Verifies an Audience message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Audience.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genders != null && message.hasOwnProperty("genders")) { + if (!Array.isArray(message.genders)) + return "genders: array expected"; + for (var i = 0; i < message.genders.length; ++i) + if (!$util.isString(message.genders[i])) + return "genders: string[] expected"; + } + if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { + if (!Array.isArray(message.ageGroups)) + return "ageGroups: array expected"; + for (var i = 0; i < message.ageGroups.length; ++i) + if (!$util.isString(message.ageGroups[i])) + return "ageGroups: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from a DoNotAssociateAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.DoNotAssociateAction} message DoNotAssociateAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoNotAssociateAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.terms = []; - object.queryTerms = []; - object.doNotAssociateTerms = []; - } - if (message.terms && message.terms.length) { - object.terms = []; - for (var j = 0; j < message.terms.length; ++j) - object.terms[j] = message.terms[j]; - } - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.doNotAssociateTerms && message.doNotAssociateTerms.length) { - object.doNotAssociateTerms = []; - for (var j = 0; j < message.doNotAssociateTerms.length; ++j) - object.doNotAssociateTerms[j] = message.doNotAssociateTerms[j]; - } + /** + * Creates an Audience message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Audience} Audience + */ + Audience.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Audience) return object; - }; + var message = new $root.google.cloud.retail.v2alpha.Audience(); + if (object.genders) { + if (!Array.isArray(object.genders)) + throw TypeError(".google.cloud.retail.v2alpha.Audience.genders: array expected"); + message.genders = []; + for (var i = 0; i < object.genders.length; ++i) + message.genders[i] = String(object.genders[i]); + } + if (object.ageGroups) { + if (!Array.isArray(object.ageGroups)) + throw TypeError(".google.cloud.retail.v2alpha.Audience.ageGroups: array expected"); + message.ageGroups = []; + for (var i = 0; i < object.ageGroups.length; ++i) + message.ageGroups[i] = String(object.ageGroups[i]); + } + return message; + }; - /** - * Converts this DoNotAssociateAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @instance - * @returns {Object.} JSON object - */ - DoNotAssociateAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an Audience message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {google.cloud.retail.v2alpha.Audience} message Audience + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Audience.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.genders = []; + object.ageGroups = []; + } + if (message.genders && message.genders.length) { + object.genders = []; + for (var j = 0; j < message.genders.length; ++j) + object.genders[j] = message.genders[j]; + } + if (message.ageGroups && message.ageGroups.length) { + object.ageGroups = []; + for (var j = 0; j < message.ageGroups.length; ++j) + object.ageGroups[j] = message.ageGroups[j]; + } + return object; + }; - /** - * Gets the default type url for DoNotAssociateAction - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.DoNotAssociateAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoNotAssociateAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.DoNotAssociateAction"; - }; + /** + * Converts this Audience to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Audience + * @instance + * @returns {Object.} JSON object + */ + Audience.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DoNotAssociateAction; - })(); + /** + * Gets the default type url for Audience + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Audience + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Audience.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Audience"; + }; - Rule.ReplacementAction = (function() { + return Audience; + })(); - /** - * Properties of a ReplacementAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IReplacementAction - * @property {Array.|null} [queryTerms] ReplacementAction queryTerms - * @property {string|null} [replacementTerm] ReplacementAction replacementTerm - * @property {string|null} [term] ReplacementAction term - */ + v2alpha.ColorInfo = (function() { - /** - * Constructs a new ReplacementAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents a ReplacementAction. - * @implements IReplacementAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set - */ - function ReplacementAction(properties) { - this.queryTerms = []; - if (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 ColorInfo. + * @memberof google.cloud.retail.v2alpha + * @interface IColorInfo + * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies + * @property {Array.|null} [colors] ColorInfo colors + */ - /** - * ReplacementAction queryTerms. - * @member {Array.} queryTerms - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.queryTerms = $util.emptyArray; + /** + * Constructs a new ColorInfo. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ColorInfo. + * @implements IColorInfo + * @constructor + * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set + */ + function ColorInfo(properties) { + this.colorFamilies = []; + this.colors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ReplacementAction replacementTerm. - * @member {string} replacementTerm - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.replacementTerm = ""; + /** + * ColorInfo colorFamilies. + * @member {Array.} colorFamilies + * @memberof google.cloud.retail.v2alpha.ColorInfo + * @instance + */ + ColorInfo.prototype.colorFamilies = $util.emptyArray; - /** - * ReplacementAction term. - * @member {string} term - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - */ - ReplacementAction.prototype.term = ""; + /** + * ColorInfo colors. + * @member {Array.} colors + * @memberof google.cloud.retail.v2alpha.ColorInfo + * @instance + */ + ColorInfo.prototype.colors = $util.emptyArray; - /** - * Creates a new ReplacementAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction instance - */ - ReplacementAction.create = function create(properties) { - return new ReplacementAction(properties); - }; - - /** - * Encodes the specified ReplacementAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplacementAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.term != null && Object.hasOwnProperty.call(message, "term")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.term); - if (message.queryTerms != null && message.queryTerms.length) - for (var i = 0; i < message.queryTerms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.queryTerms[i]); - if (message.replacementTerm != null && Object.hasOwnProperty.call(message, "replacementTerm")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.replacementTerm); - return writer; - }; - - /** - * Encodes the specified ReplacementAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.ReplacementAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IReplacementAction} message ReplacementAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReplacementAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReplacementAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplacementAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.queryTerms && message.queryTerms.length)) - message.queryTerms = []; - message.queryTerms.push(reader.string()); - break; - } - case 3: { - message.replacementTerm = reader.string(); - break; - } - case 1: { - message.term = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReplacementAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReplacementAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReplacementAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReplacementAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTerms != null && message.hasOwnProperty("queryTerms")) { - if (!Array.isArray(message.queryTerms)) - return "queryTerms: array expected"; - for (var i = 0; i < message.queryTerms.length; ++i) - if (!$util.isString(message.queryTerms[i])) - return "queryTerms: string[] expected"; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - if (!$util.isString(message.replacementTerm)) - return "replacementTerm: string expected"; - if (message.term != null && message.hasOwnProperty("term")) - if (!$util.isString(message.term)) - return "term: string expected"; - return null; - }; - - /** - * Creates a ReplacementAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.ReplacementAction} ReplacementAction - */ - ReplacementAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.ReplacementAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.ReplacementAction(); - if (object.queryTerms) { - if (!Array.isArray(object.queryTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.ReplacementAction.queryTerms: array expected"); - message.queryTerms = []; - for (var i = 0; i < object.queryTerms.length; ++i) - message.queryTerms[i] = String(object.queryTerms[i]); - } - if (object.replacementTerm != null) - message.replacementTerm = String(object.replacementTerm); - if (object.term != null) - message.term = String(object.term); - return message; - }; - - /** - * Creates a plain object from a ReplacementAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.ReplacementAction} message ReplacementAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReplacementAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queryTerms = []; - if (options.defaults) { - object.term = ""; - object.replacementTerm = ""; - } - if (message.term != null && message.hasOwnProperty("term")) - object.term = message.term; - if (message.queryTerms && message.queryTerms.length) { - object.queryTerms = []; - for (var j = 0; j < message.queryTerms.length; ++j) - object.queryTerms[j] = message.queryTerms[j]; - } - if (message.replacementTerm != null && message.hasOwnProperty("replacementTerm")) - object.replacementTerm = message.replacementTerm; - return object; - }; - - /** - * Converts this ReplacementAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @instance - * @returns {Object.} JSON object - */ - ReplacementAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReplacementAction - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.ReplacementAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReplacementAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.ReplacementAction"; - }; - - return ReplacementAction; - })(); - - Rule.IgnoreAction = (function() { - - /** - * Properties of an IgnoreAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @interface IIgnoreAction - * @property {Array.|null} [ignoreTerms] IgnoreAction ignoreTerms - */ - - /** - * Constructs a new IgnoreAction. - * @memberof google.cloud.retail.v2alpha.Rule - * @classdesc Represents an IgnoreAction. - * @implements IIgnoreAction - * @constructor - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set - */ - function IgnoreAction(properties) { - this.ignoreTerms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IgnoreAction ignoreTerms. - * @member {Array.} ignoreTerms - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @instance - */ - IgnoreAction.prototype.ignoreTerms = $util.emptyArray; - - /** - * Creates a new IgnoreAction instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction instance - */ - IgnoreAction.create = function create(properties) { - return new IgnoreAction(properties); - }; - - /** - * Encodes the specified IgnoreAction message. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ignoreTerms != null && message.ignoreTerms.length) - for (var i = 0; i < message.ignoreTerms.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ignoreTerms[i]); - return writer; - }; - - /** - * Encodes the specified IgnoreAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Rule.IgnoreAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IIgnoreAction} message IgnoreAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IgnoreAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IgnoreAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IgnoreAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.ignoreTerms && message.ignoreTerms.length)) - message.ignoreTerms = []; - message.ignoreTerms.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IgnoreAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IgnoreAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IgnoreAction message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IgnoreAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ignoreTerms != null && message.hasOwnProperty("ignoreTerms")) { - if (!Array.isArray(message.ignoreTerms)) - return "ignoreTerms: array expected"; - for (var i = 0; i < message.ignoreTerms.length; ++i) - if (!$util.isString(message.ignoreTerms[i])) - return "ignoreTerms: string[] expected"; - } - return null; - }; - - /** - * Creates an IgnoreAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Rule.IgnoreAction} IgnoreAction - */ - IgnoreAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Rule.IgnoreAction) - return object; - var message = new $root.google.cloud.retail.v2alpha.Rule.IgnoreAction(); - if (object.ignoreTerms) { - if (!Array.isArray(object.ignoreTerms)) - throw TypeError(".google.cloud.retail.v2alpha.Rule.IgnoreAction.ignoreTerms: array expected"); - message.ignoreTerms = []; - for (var i = 0; i < object.ignoreTerms.length; ++i) - message.ignoreTerms[i] = String(object.ignoreTerms[i]); - } - return message; - }; - - /** - * Creates a plain object from an IgnoreAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {google.cloud.retail.v2alpha.Rule.IgnoreAction} message IgnoreAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IgnoreAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.ignoreTerms = []; - if (message.ignoreTerms && message.ignoreTerms.length) { - object.ignoreTerms = []; - for (var j = 0; j < message.ignoreTerms.length; ++j) - object.ignoreTerms[j] = message.ignoreTerms[j]; - } - return object; - }; - - /** - * Converts this IgnoreAction to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @instance - * @returns {Object.} JSON object - */ - IgnoreAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IgnoreAction - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Rule.IgnoreAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IgnoreAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Rule.IgnoreAction"; - }; - - return IgnoreAction; - })(); - - return Rule; - })(); - - v2alpha.Audience = (function() { - - /** - * Properties of an Audience. - * @memberof google.cloud.retail.v2alpha - * @interface IAudience - * @property {Array.|null} [genders] Audience genders - * @property {Array.|null} [ageGroups] Audience ageGroups - */ - - /** - * Constructs a new Audience. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an Audience. - * @implements IAudience - * @constructor - * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set - */ - function Audience(properties) { - this.genders = []; - this.ageGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Audience genders. - * @member {Array.} genders - * @memberof google.cloud.retail.v2alpha.Audience - * @instance - */ - Audience.prototype.genders = $util.emptyArray; - - /** - * Audience ageGroups. - * @member {Array.} ageGroups - * @memberof google.cloud.retail.v2alpha.Audience - * @instance - */ - Audience.prototype.ageGroups = $util.emptyArray; - - /** - * Creates a new Audience instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {google.cloud.retail.v2alpha.IAudience=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Audience} Audience instance - */ - Audience.create = function create(properties) { - return new Audience(properties); - }; - - /** - * Encodes the specified Audience message. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Audience.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.genders != null && message.genders.length) - for (var i = 0; i < message.genders.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.genders[i]); - if (message.ageGroups != null && message.ageGroups.length) - for (var i = 0; i < message.ageGroups.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ageGroups[i]); - return writer; - }; - - /** - * Encodes the specified Audience message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Audience.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {google.cloud.retail.v2alpha.IAudience} message Audience message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Audience.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Audience message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Audience} Audience - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Audience.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Audience(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.genders && message.genders.length)) - message.genders = []; - message.genders.push(reader.string()); - break; - } - case 2: { - if (!(message.ageGroups && message.ageGroups.length)) - message.ageGroups = []; - message.ageGroups.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Audience message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Audience} Audience - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Audience.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Audience message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Audience.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.genders != null && message.hasOwnProperty("genders")) { - if (!Array.isArray(message.genders)) - return "genders: array expected"; - for (var i = 0; i < message.genders.length; ++i) - if (!$util.isString(message.genders[i])) - return "genders: string[] expected"; - } - if (message.ageGroups != null && message.hasOwnProperty("ageGroups")) { - if (!Array.isArray(message.ageGroups)) - return "ageGroups: array expected"; - for (var i = 0; i < message.ageGroups.length; ++i) - if (!$util.isString(message.ageGroups[i])) - return "ageGroups: string[] expected"; - } - return null; - }; - - /** - * Creates an Audience message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Audience} Audience - */ - Audience.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Audience) - return object; - var message = new $root.google.cloud.retail.v2alpha.Audience(); - if (object.genders) { - if (!Array.isArray(object.genders)) - throw TypeError(".google.cloud.retail.v2alpha.Audience.genders: array expected"); - message.genders = []; - for (var i = 0; i < object.genders.length; ++i) - message.genders[i] = String(object.genders[i]); - } - if (object.ageGroups) { - if (!Array.isArray(object.ageGroups)) - throw TypeError(".google.cloud.retail.v2alpha.Audience.ageGroups: array expected"); - message.ageGroups = []; - for (var i = 0; i < object.ageGroups.length; ++i) - message.ageGroups[i] = String(object.ageGroups[i]); - } - return message; - }; - - /** - * Creates a plain object from an Audience message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {google.cloud.retail.v2alpha.Audience} message Audience - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Audience.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.genders = []; - object.ageGroups = []; - } - if (message.genders && message.genders.length) { - object.genders = []; - for (var j = 0; j < message.genders.length; ++j) - object.genders[j] = message.genders[j]; - } - if (message.ageGroups && message.ageGroups.length) { - object.ageGroups = []; - for (var j = 0; j < message.ageGroups.length; ++j) - object.ageGroups[j] = message.ageGroups[j]; - } - return object; - }; - - /** - * Converts this Audience to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Audience - * @instance - * @returns {Object.} JSON object - */ - Audience.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Audience - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Audience - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Audience.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Audience"; - }; - - return Audience; - })(); - - v2alpha.ColorInfo = (function() { - - /** - * Properties of a ColorInfo. - * @memberof google.cloud.retail.v2alpha - * @interface IColorInfo - * @property {Array.|null} [colorFamilies] ColorInfo colorFamilies - * @property {Array.|null} [colors] ColorInfo colors - */ - - /** - * Constructs a new ColorInfo. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ColorInfo. - * @implements IColorInfo - * @constructor - * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set - */ - function ColorInfo(properties) { - this.colorFamilies = []; - this.colors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ColorInfo colorFamilies. - * @member {Array.} colorFamilies - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @instance - */ - ColorInfo.prototype.colorFamilies = $util.emptyArray; - - /** - * ColorInfo colors. - * @member {Array.} colors - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @instance - */ - ColorInfo.prototype.colors = $util.emptyArray; - - /** - * Creates a new ColorInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ColorInfo - * @static - * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo instance - */ - ColorInfo.create = function create(properties) { - return new ColorInfo(properties); - }; + /** + * Creates a new ColorInfo instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ColorInfo + * @static + * @param {google.cloud.retail.v2alpha.IColorInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ColorInfo} ColorInfo instance + */ + ColorInfo.create = function create(properties) { + return new ColorInfo(properties); + }; /** * Encodes the specified ColorInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ColorInfo.verify|verify} messages. @@ -57991,26 +61977,24 @@ return LocalInventory; })(); - v2alpha.GcsSource = (function() { + v2alpha.Promotion = (function() { /** - * Properties of a GcsSource. + * Properties of a Promotion. * @memberof google.cloud.retail.v2alpha - * @interface IGcsSource - * @property {Array.|null} [inputUris] GcsSource inputUris - * @property {string|null} [dataSchema] GcsSource dataSchema + * @interface IPromotion + * @property {string|null} [promotionId] Promotion promotionId */ /** - * Constructs a new GcsSource. + * Constructs a new Promotion. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GcsSource. - * @implements IGcsSource + * @classdesc Represents a Promotion. + * @implements IPromotion * @constructor - * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set */ - function GcsSource(properties) { - this.inputUris = []; + function Promotion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58018,92 +62002,75 @@ } /** - * GcsSource inputUris. - * @member {Array.} inputUris - * @memberof google.cloud.retail.v2alpha.GcsSource - * @instance - */ - GcsSource.prototype.inputUris = $util.emptyArray; - - /** - * GcsSource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2alpha.GcsSource + * Promotion promotionId. + * @member {string} promotionId + * @memberof google.cloud.retail.v2alpha.Promotion * @instance */ - GcsSource.prototype.dataSchema = ""; + Promotion.prototype.promotionId = ""; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new Promotion instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource instance + * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion instance */ - GcsSource.create = function create(properties) { - return new GcsSource(properties); + Promotion.create = function create(properties) { + return new Promotion(properties); }; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encode = function encode(message, writer) { + Promotion.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]); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); + if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); return writer; }; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. + * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + Promotion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a Promotion message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion * @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) { + Promotion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GcsSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Promotion(); 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; - } - case 2: { - message.dataSchema = reader.string(); + message.promotionId = reader.string(); break; } default: @@ -58115,308 +62082,314 @@ }; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a Promotion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion * @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) { + Promotion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsSource message. + * Verifies a Promotion message. * @function verify - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @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) { + Promotion.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"; - } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + if (!$util.isString(message.promotionId)) + return "promotionId: string expected"; return null; }; /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a Promotion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource + * @returns {google.cloud.retail.v2alpha.Promotion} Promotion */ - GcsSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GcsSource) + Promotion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Promotion) return object; - var message = new $root.google.cloud.retail.v2alpha.GcsSource(); - if (object.inputUris) { - if (!Array.isArray(object.inputUris)) - throw TypeError(".google.cloud.retail.v2alpha.GcsSource.inputUris: array expected"); - message.inputUris = []; - for (var i = 0; i < object.inputUris.length; ++i) - message.inputUris[i] = String(object.inputUris[i]); - } - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); + var message = new $root.google.cloud.retail.v2alpha.Promotion(); + if (object.promotionId != null) + message.promotionId = String(object.promotionId); return message; }; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * Creates a plain object from a Promotion message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static - * @param {google.cloud.retail.v2alpha.GcsSource} message GcsSource + * @param {google.cloud.retail.v2alpha.Promotion} message Promotion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsSource.toObject = function toObject(message, options) { + Promotion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.inputUris = []; if (options.defaults) - object.dataSchema = ""; - if (message.inputUris && message.inputUris.length) { - object.inputUris = []; - for (var j = 0; j < message.inputUris.length; ++j) - object.inputUris[j] = message.inputUris[j]; - } - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; + object.promotionId = ""; + if (message.promotionId != null && message.hasOwnProperty("promotionId")) + object.promotionId = message.promotionId; return object; }; /** - * Converts this GcsSource to JSON. + * Converts this Promotion to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @instance * @returns {Object.} JSON object */ - GcsSource.prototype.toJSON = function toJSON() { + Promotion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GcsSource + * Gets the default type url for Promotion * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GcsSource + * @memberof google.cloud.retail.v2alpha.Promotion * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Promotion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GcsSource"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Promotion"; }; - return GcsSource; + return Promotion; })(); - v2alpha.BigQuerySource = (function() { + v2alpha.BranchService = (function() { /** - * Properties of a BigQuerySource. + * Constructs a new BranchService service. * @memberof google.cloud.retail.v2alpha - * @interface IBigQuerySource - * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate - * @property {string|null} [projectId] BigQuerySource projectId - * @property {string|null} [datasetId] BigQuerySource datasetId - * @property {string|null} [tableId] BigQuerySource tableId - * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir - * @property {string|null} [dataSchema] BigQuerySource dataSchema + * @classdesc Represents a BranchService + * @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 BranchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BranchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BranchService; /** - * Constructs a new BigQuerySource. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a BigQuerySource. - * @implements IBigQuerySource - * @constructor - * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set + * Creates new BranchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.BranchService + * @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 {BranchService} RPC service. Useful where requests and/or responses are streamed. */ - 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]]; - } + BranchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * BigQuerySource partitionDate. - * @member {google.type.IDate|null|undefined} partitionDate - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance + * Callback as used by {@link google.cloud.retail.v2alpha.BranchService|listBranches}. + * @memberof google.cloud.retail.v2alpha.BranchService + * @typedef ListBranchesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListBranchesResponse} [response] ListBranchesResponse */ - BigQuerySource.prototype.partitionDate = null; /** - * BigQuerySource projectId. - * @member {string} projectId - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Calls ListBranches. + * @function listBranches + * @memberof google.cloud.retail.v2alpha.BranchService * @instance + * @param {google.cloud.retail.v2alpha.IListBranchesRequest} request ListBranchesRequest message or plain object + * @param {google.cloud.retail.v2alpha.BranchService.ListBranchesCallback} callback Node-style callback called with the error, if any, and ListBranchesResponse + * @returns {undefined} + * @variation 1 */ - BigQuerySource.prototype.projectId = ""; + Object.defineProperty(BranchService.prototype.listBranches = function listBranches(request, callback) { + return this.rpcCall(listBranches, $root.google.cloud.retail.v2alpha.ListBranchesRequest, $root.google.cloud.retail.v2alpha.ListBranchesResponse, request, callback); + }, "name", { value: "ListBranches" }); /** - * BigQuerySource datasetId. - * @member {string} datasetId - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Calls ListBranches. + * @function listBranches + * @memberof google.cloud.retail.v2alpha.BranchService * @instance + * @param {google.cloud.retail.v2alpha.IListBranchesRequest} request ListBranchesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BigQuerySource.prototype.datasetId = ""; /** - * BigQuerySource tableId. - * @member {string} tableId - * @memberof google.cloud.retail.v2alpha.BigQuerySource - * @instance + * Callback as used by {@link google.cloud.retail.v2alpha.BranchService|getBranch}. + * @memberof google.cloud.retail.v2alpha.BranchService + * @typedef GetBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Branch} [response] Branch */ - BigQuerySource.prototype.tableId = ""; /** - * BigQuerySource gcsStagingDir. - * @member {string} gcsStagingDir - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Calls GetBranch. + * @function getBranch + * @memberof google.cloud.retail.v2alpha.BranchService * @instance + * @param {google.cloud.retail.v2alpha.IGetBranchRequest} request GetBranchRequest message or plain object + * @param {google.cloud.retail.v2alpha.BranchService.GetBranchCallback} callback Node-style callback called with the error, if any, and Branch + * @returns {undefined} + * @variation 1 */ - BigQuerySource.prototype.gcsStagingDir = ""; + Object.defineProperty(BranchService.prototype.getBranch = function getBranch(request, callback) { + return this.rpcCall(getBranch, $root.google.cloud.retail.v2alpha.GetBranchRequest, $root.google.cloud.retail.v2alpha.Branch, request, callback); + }, "name", { value: "GetBranch" }); /** - * BigQuerySource dataSchema. - * @member {string} dataSchema - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Calls GetBranch. + * @function getBranch + * @memberof google.cloud.retail.v2alpha.BranchService * @instance + * @param {google.cloud.retail.v2alpha.IGetBranchRequest} request GetBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BigQuerySource.prototype.dataSchema = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return BranchService; + })(); + + v2alpha.ListBranchesRequest = (function() { /** - * BigQuerySource partition. - * @member {"partitionDate"|undefined} partition - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * Properties of a ListBranchesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IListBranchesRequest + * @property {string|null} [parent] ListBranchesRequest parent + * @property {google.cloud.retail.v2alpha.BranchView|null} [view] ListBranchesRequest view + */ + + /** + * Constructs a new ListBranchesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListBranchesRequest. + * @implements IListBranchesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IListBranchesRequest=} [properties] Properties to set + */ + function ListBranchesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBranchesRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @instance */ - Object.defineProperty(BigQuerySource.prototype, "partition", { - get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListBranchesRequest.prototype.parent = ""; /** - * Creates a new BigQuerySource instance using the specified properties. + * ListBranchesRequest view. + * @member {google.cloud.retail.v2alpha.BranchView} view + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest + * @instance + */ + ListBranchesRequest.prototype.view = 0; + + /** + * Creates a new ListBranchesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource instance + * @param {google.cloud.retail.v2alpha.IListBranchesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListBranchesRequest} ListBranchesRequest instance */ - BigQuerySource.create = function create(properties) { - return new BigQuerySource(properties); + ListBranchesRequest.create = function create(properties) { + return new ListBranchesRequest(properties); }; /** - * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * Encodes the specified ListBranchesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListBranchesRequest} message ListBranchesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encode = function encode(message, writer) { + ListBranchesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); - if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); - if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); - if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); - if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) - $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. + * Encodes the specified ListBranchesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static - * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListBranchesRequest} message ListBranchesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + ListBranchesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BigQuerySource message from the specified reader or buffer. + * Decodes a ListBranchesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.ListBranchesRequest} ListBranchesRequest * @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) { + ListBranchesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListBranchesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: { - message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 5: { - message.projectId = reader.string(); - break; - } case 1: { - message.datasetId = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.tableId = reader.string(); - break; - } - case 3: { - message.gcsStagingDir = reader.string(); - break; - } - case 4: { - message.dataSchema = reader.string(); + message.view = reader.int32(); break; } default: @@ -58428,175 +62401,156 @@ }; /** - * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * Decodes a ListBranchesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.ListBranchesRequest} ListBranchesRequest * @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) { + ListBranchesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BigQuerySource message. + * Verifies a ListBranchesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @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) { + ListBranchesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - properties.partition = 1; - { - var error = $root.google.type.Date.verify(message.partitionDate); - if (error) - return "partitionDate." + error; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: 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; } - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - if (!$util.isString(message.datasetId)) - return "datasetId: string expected"; - if (message.tableId != null && message.hasOwnProperty("tableId")) - if (!$util.isString(message.tableId)) - return "tableId: string expected"; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - if (!$util.isString(message.gcsStagingDir)) - return "gcsStagingDir: string expected"; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - if (!$util.isString(message.dataSchema)) - return "dataSchema: string expected"; return null; }; /** - * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * Creates a ListBranchesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource + * @returns {google.cloud.retail.v2alpha.ListBranchesRequest} ListBranchesRequest */ - BigQuerySource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.BigQuerySource) + ListBranchesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListBranchesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); - if (object.partitionDate != null) { - if (typeof object.partitionDate !== "object") - throw TypeError(".google.cloud.retail.v2alpha.BigQuerySource.partitionDate: object expected"); - message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); + var message = new $root.google.cloud.retail.v2alpha.ListBranchesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BRANCH_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BRANCH_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BRANCH_VIEW_FULL": + case 2: + message.view = 2; + break; } - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.datasetId != null) - message.datasetId = String(object.datasetId); - if (object.tableId != null) - message.tableId = String(object.tableId); - if (object.gcsStagingDir != null) - message.gcsStagingDir = String(object.gcsStagingDir); - if (object.dataSchema != null) - message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * Creates a plain object from a ListBranchesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static - * @param {google.cloud.retail.v2alpha.BigQuerySource} message BigQuerySource + * @param {google.cloud.retail.v2alpha.ListBranchesRequest} message ListBranchesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BigQuerySource.toObject = function toObject(message, options) { + ListBranchesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.datasetId = ""; - object.tableId = ""; - object.gcsStagingDir = ""; - object.dataSchema = ""; - object.projectId = ""; - } - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - object.datasetId = message.datasetId; - if (message.tableId != null && message.hasOwnProperty("tableId")) - object.tableId = message.tableId; - if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) - object.gcsStagingDir = message.gcsStagingDir; - if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) - object.dataSchema = message.dataSchema; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { - object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); - if (options.oneofs) - object.partition = "partitionDate"; + object.parent = ""; + object.view = options.enums === String ? "BRANCH_VIEW_UNSPECIFIED" : 0; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.retail.v2alpha.BranchView[message.view] === undefined ? message.view : $root.google.cloud.retail.v2alpha.BranchView[message.view] : message.view; return object; }; /** - * Converts this BigQuerySource to JSON. + * Converts this ListBranchesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @instance * @returns {Object.} JSON object */ - BigQuerySource.prototype.toJSON = function toJSON() { + ListBranchesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BigQuerySource + * Gets the default type url for ListBranchesRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @memberof google.cloud.retail.v2alpha.ListBranchesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BigQuerySource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBranchesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.BigQuerySource"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListBranchesRequest"; }; - return BigQuerySource; + return ListBranchesRequest; })(); - v2alpha.ProductInlineSource = (function() { + v2alpha.ListBranchesResponse = (function() { /** - * Properties of a ProductInlineSource. + * Properties of a ListBranchesResponse. * @memberof google.cloud.retail.v2alpha - * @interface IProductInlineSource - * @property {Array.|null} [products] ProductInlineSource products + * @interface IListBranchesResponse + * @property {Array.|null} [branches] ListBranchesResponse branches */ /** - * Constructs a new ProductInlineSource. + * Constructs a new ListBranchesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductInlineSource. - * @implements IProductInlineSource + * @classdesc Represents a ListBranchesResponse. + * @implements IListBranchesResponse * @constructor - * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListBranchesResponse=} [properties] Properties to set */ - function ProductInlineSource(properties) { - this.products = []; + function ListBranchesResponse(properties) { + this.branches = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58604,78 +62558,78 @@ } /** - * ProductInlineSource products. - * @member {Array.} products - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * ListBranchesResponse branches. + * @member {Array.} branches + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @instance */ - ProductInlineSource.prototype.products = $util.emptyArray; + ListBranchesResponse.prototype.branches = $util.emptyArray; /** - * Creates a new ProductInlineSource instance using the specified properties. + * Creates a new ListBranchesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource instance + * @param {google.cloud.retail.v2alpha.IListBranchesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListBranchesResponse} ListBranchesResponse instance */ - ProductInlineSource.create = function create(properties) { - return new ProductInlineSource(properties); + ListBranchesResponse.create = function create(properties) { + return new ListBranchesResponse(properties); }; /** - * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * Encodes the specified ListBranchesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListBranchesResponse} message ListBranchesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInlineSource.encode = function encode(message, writer) { + ListBranchesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.branches != null && message.branches.length) + for (var i = 0; i < message.branches.length; ++i) + $root.google.cloud.retail.v2alpha.Branch.encode(message.branches[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. + * Encodes the specified ListBranchesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListBranchesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static - * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListBranchesResponse} message ListBranchesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + ListBranchesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductInlineSource message from the specified reader or buffer. + * Decodes a ListBranchesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource + * @returns {google.cloud.retail.v2alpha.ListBranchesResponse} ListBranchesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInlineSource.decode = function decode(reader, length) { + ListBranchesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListBranchesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + if (!(message.branches && message.branches.length)) + message.branches = []; + message.branches.push($root.google.cloud.retail.v2alpha.Branch.decode(reader, reader.uint32())); break; } default: @@ -58687,140 +62641,140 @@ }; /** - * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. + * Decodes a ListBranchesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource + * @returns {google.cloud.retail.v2alpha.ListBranchesResponse} ListBranchesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { + ListBranchesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductInlineSource message. + * Verifies a ListBranchesResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductInlineSource.verify = function verify(message) { + ListBranchesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); + if (message.branches != null && message.hasOwnProperty("branches")) { + if (!Array.isArray(message.branches)) + return "branches: array expected"; + for (var i = 0; i < message.branches.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Branch.verify(message.branches[i]); if (error) - return "products." + error; + return "branches." + error; } } return null; }; /** - * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a ListBranchesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource + * @returns {google.cloud.retail.v2alpha.ListBranchesResponse} ListBranchesResponse */ - ProductInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductInlineSource) + ListBranchesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListBranchesResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); + var message = new $root.google.cloud.retail.v2alpha.ListBranchesResponse(); + if (object.branches) { + if (!Array.isArray(object.branches)) + throw TypeError(".google.cloud.retail.v2alpha.ListBranchesResponse.branches: array expected"); + message.branches = []; + for (var i = 0; i < object.branches.length; ++i) { + if (typeof object.branches[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListBranchesResponse.branches: object expected"); + message.branches[i] = $root.google.cloud.retail.v2alpha.Branch.fromObject(object.branches[i]); } } return message; }; /** - * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. + * Creates a plain object from a ListBranchesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static - * @param {google.cloud.retail.v2alpha.ProductInlineSource} message ProductInlineSource + * @param {google.cloud.retail.v2alpha.ListBranchesResponse} message ListBranchesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductInlineSource.toObject = function toObject(message, options) { + ListBranchesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.products = []; - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); + object.branches = []; + if (message.branches && message.branches.length) { + object.branches = []; + for (var j = 0; j < message.branches.length; ++j) + object.branches[j] = $root.google.cloud.retail.v2alpha.Branch.toObject(message.branches[j], options); } return object; }; /** - * Converts this ProductInlineSource to JSON. + * Converts this ListBranchesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @instance * @returns {Object.} JSON object */ - ProductInlineSource.prototype.toJSON = function toJSON() { + ListBranchesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProductInlineSource + * Gets the default type url for ListBranchesResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ProductInlineSource + * @memberof google.cloud.retail.v2alpha.ListBranchesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProductInlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBranchesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductInlineSource"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListBranchesResponse"; }; - return ProductInlineSource; + return ListBranchesResponse; })(); - v2alpha.UserEventInlineSource = (function() { + v2alpha.GetBranchRequest = (function() { /** - * Properties of a UserEventInlineSource. + * Properties of a GetBranchRequest. * @memberof google.cloud.retail.v2alpha - * @interface IUserEventInlineSource - * @property {Array.|null} [userEvents] UserEventInlineSource userEvents + * @interface IGetBranchRequest + * @property {string|null} [name] GetBranchRequest name + * @property {google.cloud.retail.v2alpha.BranchView|null} [view] GetBranchRequest view */ /** - * Constructs a new UserEventInlineSource. + * Constructs a new GetBranchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventInlineSource. - * @implements IUserEventInlineSource + * @classdesc Represents a GetBranchRequest. + * @implements IGetBranchRequest * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetBranchRequest=} [properties] Properties to set */ - function UserEventInlineSource(properties) { - this.userEvents = []; + function GetBranchRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -58828,78 +62782,89 @@ } /** - * UserEventInlineSource userEvents. - * @member {Array.} userEvents - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * GetBranchRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @instance */ - UserEventInlineSource.prototype.userEvents = $util.emptyArray; + GetBranchRequest.prototype.name = ""; /** - * Creates a new UserEventInlineSource instance using the specified properties. + * GetBranchRequest view. + * @member {google.cloud.retail.v2alpha.BranchView} view + * @memberof google.cloud.retail.v2alpha.GetBranchRequest + * @instance + */ + GetBranchRequest.prototype.view = 0; + + /** + * Creates a new GetBranchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource instance + * @param {google.cloud.retail.v2alpha.IGetBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetBranchRequest} GetBranchRequest instance */ - UserEventInlineSource.create = function create(properties) { - return new UserEventInlineSource(properties); + GetBranchRequest.create = function create(properties) { + return new GetBranchRequest(properties); }; /** - * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * Encodes the specified GetBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetBranchRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetBranchRequest} message GetBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInlineSource.encode = function encode(message, writer) { + GetBranchRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEvents != null && message.userEvents.length) - for (var i = 0; i < message.userEvents.length; ++i) - $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvents[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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * Encodes the specified GetBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetBranchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetBranchRequest} message GetBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + GetBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer. + * Decodes a GetBranchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.GetBranchRequest} GetBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInlineSource.decode = function decode(reader, length) { + GetBranchRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetBranchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.userEvents && message.userEvents.length)) - message.userEvents = []; - message.userEvents.push($root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32())); + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); break; } default: @@ -58911,139 +62876,156 @@ }; /** - * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * Decodes a GetBranchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.GetBranchRequest} GetBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { + GetBranchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventInlineSource message. + * Verifies a GetBranchRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventInlineSource.verify = function verify(message) { + GetBranchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userEvents != null && message.hasOwnProperty("userEvents")) { - if (!Array.isArray(message.userEvents)) - return "userEvents: array expected"; - for (var i = 0; i < message.userEvents.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvents[i]); - if (error) - return "userEvents." + error; + 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 UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * Creates a GetBranchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @returns {google.cloud.retail.v2alpha.GetBranchRequest} GetBranchRequest */ - UserEventInlineSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInlineSource) + GetBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetBranchRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); - if (object.userEvents) { - if (!Array.isArray(object.userEvents)) - throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: array expected"); - message.userEvents = []; - for (var i = 0; i < object.userEvents.length; ++i) { - if (typeof object.userEvents[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: object expected"); - message.userEvents[i] = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvents[i]); + var message = new $root.google.cloud.retail.v2alpha.GetBranchRequest(); + 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 "BRANCH_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BRANCH_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BRANCH_VIEW_FULL": + case 2: + message.view = 2; + break; } return message; }; /** - * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * Creates a plain object from a GetBranchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static - * @param {google.cloud.retail.v2alpha.UserEventInlineSource} message UserEventInlineSource + * @param {google.cloud.retail.v2alpha.GetBranchRequest} message GetBranchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventInlineSource.toObject = function toObject(message, options) { + GetBranchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.userEvents = []; - if (message.userEvents && message.userEvents.length) { - object.userEvents = []; - for (var j = 0; j < message.userEvents.length; ++j) - object.userEvents[j] = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvents[j], options); + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BRANCH_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.retail.v2alpha.BranchView[message.view] === undefined ? message.view : $root.google.cloud.retail.v2alpha.BranchView[message.view] : message.view; return object; }; /** - * Converts this UserEventInlineSource to JSON. + * Converts this GetBranchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @instance * @returns {Object.} JSON object */ - UserEventInlineSource.prototype.toJSON = function toJSON() { + GetBranchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserEventInlineSource + * Gets the default type url for GetBranchRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @memberof google.cloud.retail.v2alpha.GetBranchRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserEventInlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBranchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventInlineSource"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetBranchRequest"; }; - return UserEventInlineSource; + return GetBranchRequest; })(); - v2alpha.ImportErrorsConfig = (function() { + v2alpha.ProductLevelConfig = (function() { /** - * Properties of an ImportErrorsConfig. + * Properties of a ProductLevelConfig. * @memberof google.cloud.retail.v2alpha - * @interface IImportErrorsConfig - * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix + * @interface IProductLevelConfig + * @property {string|null} [ingestionProductType] ProductLevelConfig ingestionProductType + * @property {string|null} [merchantCenterProductIdField] ProductLevelConfig merchantCenterProductIdField */ /** - * Constructs a new ImportErrorsConfig. + * Constructs a new ProductLevelConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportErrorsConfig. - * @implements IImportErrorsConfig + * @classdesc Represents a ProductLevelConfig. + * @implements IProductLevelConfig * @constructor - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set */ - function ImportErrorsConfig(properties) { + function ProductLevelConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -59051,89 +63033,89 @@ } /** - * ImportErrorsConfig gcsPrefix. - * @member {string|null|undefined} gcsPrefix - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * ProductLevelConfig ingestionProductType. + * @member {string} ingestionProductType + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @instance */ - ImportErrorsConfig.prototype.gcsPrefix = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ProductLevelConfig.prototype.ingestionProductType = ""; /** - * ImportErrorsConfig destination. - * @member {"gcsPrefix"|undefined} destination - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * ProductLevelConfig merchantCenterProductIdField. + * @member {string} merchantCenterProductIdField + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @instance */ - Object.defineProperty(ImportErrorsConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), - set: $util.oneOfSetter($oneOfFields) - }); + ProductLevelConfig.prototype.merchantCenterProductIdField = ""; /** - * Creates a new ImportErrorsConfig instance using the specified properties. + * Creates a new ProductLevelConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig instance + * @param {google.cloud.retail.v2alpha.IProductLevelConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig instance */ - ImportErrorsConfig.create = function create(properties) { - return new ImportErrorsConfig(properties); + ProductLevelConfig.create = function create(properties) { + return new ProductLevelConfig(properties); }; /** - * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * Encodes the specified ProductLevelConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorsConfig.encode = function encode(message, writer) { + ProductLevelConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + if (message.ingestionProductType != null && Object.hasOwnProperty.call(message, "ingestionProductType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ingestionProductType); + if (message.merchantCenterProductIdField != null && Object.hasOwnProperty.call(message, "merchantCenterProductIdField")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.merchantCenterProductIdField); return writer; }; /** - * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * Encodes the specified ProductLevelConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductLevelConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static - * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductLevelConfig} message ProductLevelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + ProductLevelConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * Decodes a ProductLevelConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorsConfig.decode = function decode(reader, length) { + ProductLevelConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.gcsPrefix = reader.string(); + message.ingestionProductType = reader.string(); + break; + } + case 2: { + message.merchantCenterProductIdField = reader.string(); break; } default: @@ -59145,133 +63127,140 @@ }; /** - * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * Decodes a ProductLevelConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + ProductLevelConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportErrorsConfig message. + * Verifies a ProductLevelConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportErrorsConfig.verify = function verify(message) { + ProductLevelConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.destination = 1; - if (!$util.isString(message.gcsPrefix)) - return "gcsPrefix: string expected"; - } + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + if (!$util.isString(message.ingestionProductType)) + return "ingestionProductType: string expected"; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + if (!$util.isString(message.merchantCenterProductIdField)) + return "merchantCenterProductIdField: string expected"; return null; }; /** - * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ProductLevelConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @returns {google.cloud.retail.v2alpha.ProductLevelConfig} ProductLevelConfig */ - ImportErrorsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportErrorsConfig) + ProductLevelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductLevelConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); - if (object.gcsPrefix != null) - message.gcsPrefix = String(object.gcsPrefix); + var message = new $root.google.cloud.retail.v2alpha.ProductLevelConfig(); + if (object.ingestionProductType != null) + message.ingestionProductType = String(object.ingestionProductType); + if (object.merchantCenterProductIdField != null) + message.merchantCenterProductIdField = String(object.merchantCenterProductIdField); return message; }; /** - * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * Creates a plain object from a ProductLevelConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static - * @param {google.cloud.retail.v2alpha.ImportErrorsConfig} message ImportErrorsConfig + * @param {google.cloud.retail.v2alpha.ProductLevelConfig} message ProductLevelConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportErrorsConfig.toObject = function toObject(message, options) { + ProductLevelConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = message.gcsPrefix; - if (options.oneofs) - object.destination = "gcsPrefix"; + if (options.defaults) { + object.ingestionProductType = ""; + object.merchantCenterProductIdField = ""; } + if (message.ingestionProductType != null && message.hasOwnProperty("ingestionProductType")) + object.ingestionProductType = message.ingestionProductType; + if (message.merchantCenterProductIdField != null && message.hasOwnProperty("merchantCenterProductIdField")) + object.merchantCenterProductIdField = message.merchantCenterProductIdField; return object; }; /** - * Converts this ImportErrorsConfig to JSON. + * Converts this ProductLevelConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @instance * @returns {Object.} JSON object */ - ImportErrorsConfig.prototype.toJSON = function toJSON() { + ProductLevelConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportErrorsConfig + * Gets the default type url for ProductLevelConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @memberof google.cloud.retail.v2alpha.ProductLevelConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportErrorsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ProductLevelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportErrorsConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductLevelConfig"; }; - return ImportErrorsConfig; + return ProductLevelConfig; })(); - v2alpha.ImportProductsRequest = (function() { + v2alpha.CatalogAttribute = (function() { /** - * Properties of an ImportProductsRequest. + * Properties of a CatalogAttribute. * @memberof google.cloud.retail.v2alpha - * @interface IImportProductsRequest - * @property {string|null} [parent] ImportProductsRequest parent - * @property {string|null} [requestId] ImportProductsRequest requestId - * @property {google.cloud.retail.v2alpha.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask - * @property {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode - * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic - * @property {boolean|null} [skipDefaultBranchProtection] ImportProductsRequest skipDefaultBranchProtection + * @interface ICatalogAttribute + * @property {string|null} [key] CatalogAttribute key + * @property {boolean|null} [inUse] CatalogAttribute inUse + * @property {google.cloud.retail.v2alpha.CatalogAttribute.AttributeType|null} [type] CatalogAttribute type + * @property {google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption|null} [indexableOption] CatalogAttribute indexableOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption|null} [dynamicFacetableOption] CatalogAttribute dynamicFacetableOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption|null} [searchableOption] CatalogAttribute searchableOption + * @property {google.cloud.retail.v2alpha.RecommendationsFilteringOption|null} [recommendationsFilteringOption] CatalogAttribute recommendationsFilteringOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption|null} [exactSearchableOption] CatalogAttribute exactSearchableOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption|null} [retrievableOption] CatalogAttribute retrievableOption + * @property {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig|null} [facetConfig] CatalogAttribute facetConfig */ /** - * Constructs a new ImportProductsRequest. + * Constructs a new CatalogAttribute. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportProductsRequest. - * @implements IImportProductsRequest + * @classdesc Represents a CatalogAttribute. + * @implements ICatalogAttribute * @constructor - * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICatalogAttribute=} [properties] Properties to set */ - function ImportProductsRequest(properties) { + function CatalogAttribute(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -59279,929 +63268,2010 @@ } /** - * ImportProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.parent = ""; + CatalogAttribute.prototype.key = ""; /** - * ImportProductsRequest requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute inUse. + * @member {boolean} inUse + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.requestId = ""; + CatalogAttribute.prototype.inUse = false; /** - * ImportProductsRequest inputConfig. - * @member {google.cloud.retail.v2alpha.IProductInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute type. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.AttributeType} type + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.inputConfig = null; + CatalogAttribute.prototype.type = 0; /** - * ImportProductsRequest errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute indexableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption} indexableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.errorsConfig = null; + CatalogAttribute.prototype.indexableOption = 0; /** - * ImportProductsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute dynamicFacetableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption} dynamicFacetableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.updateMask = null; + CatalogAttribute.prototype.dynamicFacetableOption = 0; /** - * ImportProductsRequest reconciliationMode. - * @member {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} reconciliationMode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute searchableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption} searchableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.reconciliationMode = 0; + CatalogAttribute.prototype.searchableOption = 0; /** - * ImportProductsRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute recommendationsFilteringOption. + * @member {google.cloud.retail.v2alpha.RecommendationsFilteringOption} recommendationsFilteringOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.notificationPubsubTopic = ""; + CatalogAttribute.prototype.recommendationsFilteringOption = 0; /** - * ImportProductsRequest skipDefaultBranchProtection. - * @member {boolean} skipDefaultBranchProtection - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * CatalogAttribute exactSearchableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption} exactSearchableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance */ - ImportProductsRequest.prototype.skipDefaultBranchProtection = false; + CatalogAttribute.prototype.exactSearchableOption = 0; /** - * Creates a new ImportProductsRequest instance using the specified properties. + * CatalogAttribute retrievableOption. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption} retrievableOption + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.retrievableOption = 0; + + /** + * CatalogAttribute facetConfig. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig|null|undefined} facetConfig + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.facetConfig = null; + + /** + * Creates a new CatalogAttribute instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest instance + * @param {google.cloud.retail.v2alpha.ICatalogAttribute=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute instance */ - ImportProductsRequest.create = function create(properties) { - return new ImportProductsRequest(properties); + CatalogAttribute.create = function create(properties) { + return new CatalogAttribute(properties); }; /** - * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * Encodes the specified CatalogAttribute message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICatalogAttribute} message CatalogAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsRequest.encode = function encode(message, writer) { + CatalogAttribute.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); - if (message.skipDefaultBranchProtection != null && Object.hasOwnProperty.call(message, "skipDefaultBranchProtection")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.skipDefaultBranchProtection); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.indexableOption != null && Object.hasOwnProperty.call(message, "indexableOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.indexableOption); + if (message.dynamicFacetableOption != null && Object.hasOwnProperty.call(message, "dynamicFacetableOption")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dynamicFacetableOption); + if (message.searchableOption != null && Object.hasOwnProperty.call(message, "searchableOption")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.searchableOption); + if (message.recommendationsFilteringOption != null && Object.hasOwnProperty.call(message, "recommendationsFilteringOption")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.recommendationsFilteringOption); + if (message.inUse != null && Object.hasOwnProperty.call(message, "inUse")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.inUse); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.exactSearchableOption != null && Object.hasOwnProperty.call(message, "exactSearchableOption")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.exactSearchableOption); + if (message.retrievableOption != null && Object.hasOwnProperty.call(message, "retrievableOption")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.retrievableOption); + if (message.facetConfig != null && Object.hasOwnProperty.call(message, "facetConfig")) + $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.encode(message.facetConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. + * Encodes the specified CatalogAttribute message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICatalogAttribute} message CatalogAttribute message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CatalogAttribute.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportProductsRequest message from the specified reader or buffer. + * Decodes a CatalogAttribute message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsRequest.decode = function decode(reader, length) { + CatalogAttribute.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 6: { - message.requestId = reader.string(); + message.key = reader.string(); break; } - case 2: { - message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.decode(reader, reader.uint32()); + case 9: { + message.inUse = reader.bool(); break; } - case 3: { - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); + case 10: { + message.type = reader.int32(); break; } - case 4: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + case 5: { + message.indexableOption = reader.int32(); break; } - case 5: { - message.reconciliationMode = reader.int32(); + case 6: { + message.dynamicFacetableOption = reader.int32(); break; } case 7: { - message.notificationPubsubTopic = reader.string(); + message.searchableOption = reader.int32(); break; } case 8: { - message.skipDefaultBranchProtection = reader.bool(); + message.recommendationsFilteringOption = reader.int32(); break; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - + case 11: { + message.exactSearchableOption = reader.int32(); + break; + } + case 12: { + message.retrievableOption = reader.int32(); + break; + } + case 13: { + message.facetConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a CatalogAttribute message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { + CatalogAttribute.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportProductsRequest message. + * Verifies a CatalogAttribute message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportProductsRequest.verify = function verify(message) { + CatalogAttribute.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.ProductInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - switch (message.reconciliationMode) { + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.inUse != null && message.hasOwnProperty("inUse")) + if (typeof message.inUse !== "boolean") + return "inUse: boolean expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "reconciliationMode: enum value expected"; + return "type: enum value expected"; case 0: case 1: case 2: break; } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; - if (message.skipDefaultBranchProtection != null && message.hasOwnProperty("skipDefaultBranchProtection")) - if (typeof message.skipDefaultBranchProtection !== "boolean") - return "skipDefaultBranchProtection: boolean expected"; + if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) + switch (message.indexableOption) { + default: + return "indexableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) + switch (message.dynamicFacetableOption) { + default: + return "dynamicFacetableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) + switch (message.searchableOption) { + default: + return "searchableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) + switch (message.recommendationsFilteringOption) { + default: + return "recommendationsFilteringOption: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) + switch (message.exactSearchableOption) { + default: + return "exactSearchableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) + switch (message.retrievableOption) { + default: + return "retrievableOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.verify(message.facetConfig); + if (error) + return "facetConfig." + error; + } return null; }; /** - * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CatalogAttribute message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest + * @returns {google.cloud.retail.v2alpha.CatalogAttribute} CatalogAttribute */ - ImportProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsRequest) + CatalogAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.fromObject(object.inputConfig); + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute(); + if (object.key != null) + message.key = String(object.key); + if (object.inUse != null) + message.inUse = Boolean(object.inUse); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "TEXTUAL": + case 1: + message.type = 1; + break; + case "NUMERICAL": + case 2: + message.type = 2; + break; } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + switch (object.indexableOption) { + default: + if (typeof object.indexableOption === "number") { + message.indexableOption = object.indexableOption; + break; + } + break; + case "INDEXABLE_OPTION_UNSPECIFIED": + case 0: + message.indexableOption = 0; + break; + case "INDEXABLE_ENABLED": + case 1: + message.indexableOption = 1; + break; + case "INDEXABLE_DISABLED": + case 2: + message.indexableOption = 2; + break; } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + switch (object.dynamicFacetableOption) { + default: + if (typeof object.dynamicFacetableOption === "number") { + message.dynamicFacetableOption = object.dynamicFacetableOption; + break; + } + break; + case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": + case 0: + message.dynamicFacetableOption = 0; + break; + case "DYNAMIC_FACETABLE_ENABLED": + case 1: + message.dynamicFacetableOption = 1; + break; + case "DYNAMIC_FACETABLE_DISABLED": + case 2: + message.dynamicFacetableOption = 2; + break; } - switch (object.reconciliationMode) { + switch (object.searchableOption) { default: - if (typeof object.reconciliationMode === "number") { - message.reconciliationMode = object.reconciliationMode; + if (typeof object.searchableOption === "number") { + message.searchableOption = object.searchableOption; break; } break; - case "RECONCILIATION_MODE_UNSPECIFIED": + case "SEARCHABLE_OPTION_UNSPECIFIED": case 0: - message.reconciliationMode = 0; + message.searchableOption = 0; break; - case "INCREMENTAL": + case "SEARCHABLE_ENABLED": case 1: - message.reconciliationMode = 1; + message.searchableOption = 1; break; - case "FULL": + case "SEARCHABLE_DISABLED": case 2: - message.reconciliationMode = 2; + message.searchableOption = 2; break; } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); - if (object.skipDefaultBranchProtection != null) - message.skipDefaultBranchProtection = Boolean(object.skipDefaultBranchProtection); + switch (object.recommendationsFilteringOption) { + default: + if (typeof object.recommendationsFilteringOption === "number") { + message.recommendationsFilteringOption = object.recommendationsFilteringOption; + break; + } + break; + case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": + case 0: + message.recommendationsFilteringOption = 0; + break; + case "RECOMMENDATIONS_FILTERING_DISABLED": + case 1: + message.recommendationsFilteringOption = 1; + break; + case "RECOMMENDATIONS_FILTERING_ENABLED": + case 3: + message.recommendationsFilteringOption = 3; + break; + } + switch (object.exactSearchableOption) { + default: + if (typeof object.exactSearchableOption === "number") { + message.exactSearchableOption = object.exactSearchableOption; + break; + } + break; + case "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": + case 0: + message.exactSearchableOption = 0; + break; + case "EXACT_SEARCHABLE_ENABLED": + case 1: + message.exactSearchableOption = 1; + break; + case "EXACT_SEARCHABLE_DISABLED": + case 2: + message.exactSearchableOption = 2; + break; + } + switch (object.retrievableOption) { + default: + if (typeof object.retrievableOption === "number") { + message.retrievableOption = object.retrievableOption; + break; + } + break; + case "RETRIEVABLE_OPTION_UNSPECIFIED": + case 0: + message.retrievableOption = 0; + break; + case "RETRIEVABLE_ENABLED": + case 1: + message.retrievableOption = 1; + break; + case "RETRIEVABLE_DISABLED": + case 2: + message.retrievableOption = 2; + break; + } + if (object.facetConfig != null) { + if (typeof object.facetConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.facetConfig: object expected"); + message.facetConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.fromObject(object.facetConfig); + } return message; }; /** - * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CatalogAttribute message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static - * @param {google.cloud.retail.v2alpha.ImportProductsRequest} message ImportProductsRequest + * @param {google.cloud.retail.v2alpha.CatalogAttribute} message CatalogAttribute * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportProductsRequest.toObject = function toObject(message, options) { + CatalogAttribute.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; - object.updateMask = null; - object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; - object.skipDefaultBranchProtection = false; + object.key = ""; + object.indexableOption = options.enums === String ? "INDEXABLE_OPTION_UNSPECIFIED" : 0; + object.dynamicFacetableOption = options.enums === String ? "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED" : 0; + object.searchableOption = options.enums === String ? "SEARCHABLE_OPTION_UNSPECIFIED" : 0; + object.recommendationsFilteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; + object.inUse = false; + object.type = options.enums === String ? "UNKNOWN" : 0; + object.exactSearchableOption = options.enums === String ? "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" : 0; + object.retrievableOption = options.enums === String ? "RETRIEVABLE_OPTION_UNSPECIFIED" : 0; + object.facetConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; - if (message.skipDefaultBranchProtection != null && message.hasOwnProperty("skipDefaultBranchProtection")) - object.skipDefaultBranchProtection = message.skipDefaultBranchProtection; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) + object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] === undefined ? message.indexableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; + if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) + object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] === undefined ? message.dynamicFacetableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; + if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) + object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] === undefined ? message.searchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; + if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) + object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] === undefined ? message.recommendationsFilteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; + if (message.inUse != null && message.hasOwnProperty("inUse")) + object.inUse = message.inUse; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] : message.type; + if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) + object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; + if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) + object.retrievableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] === undefined ? message.retrievableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption[message.retrievableOption] : message.retrievableOption; + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) + object.facetConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.toObject(message.facetConfig, options); return object; }; /** - * Converts this ImportProductsRequest to JSON. + * Converts this CatalogAttribute to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @instance * @returns {Object.} JSON object */ - ImportProductsRequest.prototype.toJSON = function toJSON() { + CatalogAttribute.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportProductsRequest + * Gets the default type url for CatalogAttribute * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportProductsRequest + * @memberof google.cloud.retail.v2alpha.CatalogAttribute * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CatalogAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportProductsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute"; }; - /** - * ReconciliationMode enum. - * @name google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode - * @enum {number} - * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value - * @property {number} INCREMENTAL=1 INCREMENTAL value - * @property {number} FULL=2 FULL value - */ - ImportProductsRequest.ReconciliationMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INCREMENTAL"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); + CatalogAttribute.FacetConfig = (function() { - return ImportProductsRequest; - })(); + /** + * Properties of a FacetConfig. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @interface IFacetConfig + * @property {Array.|null} [facetIntervals] FacetConfig facetIntervals + * @property {Array.|null} [ignoredFacetValues] FacetConfig ignoredFacetValues + * @property {Array.|null} [mergedFacetValues] FacetConfig mergedFacetValues + * @property {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet|null} [mergedFacet] FacetConfig mergedFacet + * @property {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig|null} [rerankConfig] FacetConfig rerankConfig + */ - v2alpha.ImportUserEventsRequest = (function() { + /** + * Constructs a new FacetConfig. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute + * @classdesc Represents a FacetConfig. + * @implements IFacetConfig + * @constructor + * @param {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig=} [properties] Properties to set + */ + function FacetConfig(properties) { + this.facetIntervals = []; + this.ignoredFacetValues = []; + this.mergedFacetValues = []; + if (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 ImportUserEventsRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IImportUserEventsRequest - * @property {string|null} [parent] ImportUserEventsRequest parent - * @property {google.cloud.retail.v2alpha.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig - */ + /** + * FacetConfig facetIntervals. + * @member {Array.} facetIntervals + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.facetIntervals = $util.emptyArray; - /** - * Constructs a new ImportUserEventsRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportUserEventsRequest. - * @implements IImportUserEventsRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set - */ - function ImportUserEventsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * FacetConfig ignoredFacetValues. + * @member {Array.} ignoredFacetValues + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.ignoredFacetValues = $util.emptyArray; - /** - * ImportUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.parent = ""; + /** + * FacetConfig mergedFacetValues. + * @member {Array.} mergedFacetValues + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacetValues = $util.emptyArray; - /** - * ImportUserEventsRequest inputConfig. - * @member {google.cloud.retail.v2alpha.IUserEventInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.inputConfig = null; + /** + * FacetConfig mergedFacet. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet|null|undefined} mergedFacet + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacet = null; - /** - * ImportUserEventsRequest errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @instance - */ - ImportUserEventsRequest.prototype.errorsConfig = null; + /** + * FacetConfig rerankConfig. + * @member {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig|null|undefined} rerankConfig + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.rerankConfig = null; - /** - * Creates a new ImportUserEventsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest instance - */ - ImportUserEventsRequest.create = function create(properties) { - return new ImportUserEventsRequest(properties); - }; + /** + * Creates a new FacetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig} FacetConfig instance + */ + FacetConfig.create = function create(properties) { + return new FacetConfig(properties); + }; - /** - * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportUserEventsRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetIntervals != null && message.facetIntervals.length) + for (var i = 0; i < message.facetIntervals.length; ++i) + $root.google.cloud.retail.v2alpha.Interval.encode(message.facetIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ignoredFacetValues != null && message.ignoredFacetValues.length) + for (var i = 0; i < message.ignoredFacetValues.length; ++i) + $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.encode(message.ignoredFacetValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mergedFacetValues != null && message.mergedFacetValues.length) + for (var i = 0; i < message.mergedFacetValues.length; ++i) + $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.encode(message.mergedFacetValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergedFacet != null && Object.hasOwnProperty.call(message, "mergedFacet")) + $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.encode(message.mergedFacet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rerankConfig != null && Object.hasOwnProperty.call(message, "rerankConfig")) + $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.encode(message.rerankConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportUserEventsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.facetIntervals && message.facetIntervals.length)) + message.facetIntervals = []; + message.facetIntervals.push($root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ignoredFacetValues && message.ignoredFacetValues.length)) + message.ignoredFacetValues = []; + message.ignoredFacetValues.push($root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.mergedFacetValues && message.mergedFacetValues.length)) + message.mergedFacetValues = []; + message.mergedFacetValues.push($root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.decode(reader, reader.uint32())); + break; + } + case 4: { + message.mergedFacet = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rerankConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - case 2: { - message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.decode(reader, reader.uint32()); - break; + } + return message; + }; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetIntervals != null && message.hasOwnProperty("facetIntervals")) { + if (!Array.isArray(message.facetIntervals)) + return "facetIntervals: array expected"; + for (var i = 0; i < message.facetIntervals.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.facetIntervals[i]); + if (error) + return "facetIntervals." + error; } - case 3: { - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); - break; + } + if (message.ignoredFacetValues != null && message.hasOwnProperty("ignoredFacetValues")) { + if (!Array.isArray(message.ignoredFacetValues)) + return "ignoredFacetValues: array expected"; + for (var i = 0; i < message.ignoredFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify(message.ignoredFacetValues[i]); + if (error) + return "ignoredFacetValues." + error; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (message.mergedFacetValues != null && message.hasOwnProperty("mergedFacetValues")) { + if (!Array.isArray(message.mergedFacetValues)) + return "mergedFacetValues: array expected"; + for (var i = 0; i < message.mergedFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.verify(message.mergedFacetValues[i]); + if (error) + return "mergedFacetValues." + error; + } + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.verify(message.mergedFacet); + if (error) + return "mergedFacet." + error; + } + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.verify(message.rerankConfig); + if (error) + return "rerankConfig." + error; + } + return null; + }; - /** - * Verifies an ImportUserEventsRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportUserEventsRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.UserEventInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - return null; - }; + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig} FacetConfig + */ + FacetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig(); + if (object.facetIntervals) { + if (!Array.isArray(object.facetIntervals)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.facetIntervals: array expected"); + message.facetIntervals = []; + for (var i = 0; i < object.facetIntervals.length; ++i) { + if (typeof object.facetIntervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.facetIntervals: object expected"); + message.facetIntervals[i] = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.facetIntervals[i]); + } + } + if (object.ignoredFacetValues) { + if (!Array.isArray(object.ignoredFacetValues)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.ignoredFacetValues: array expected"); + message.ignoredFacetValues = []; + for (var i = 0; i < object.ignoredFacetValues.length; ++i) { + if (typeof object.ignoredFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.ignoredFacetValues: object expected"); + message.ignoredFacetValues[i] = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.fromObject(object.ignoredFacetValues[i]); + } + } + if (object.mergedFacetValues) { + if (!Array.isArray(object.mergedFacetValues)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.mergedFacetValues: array expected"); + message.mergedFacetValues = []; + for (var i = 0; i < object.mergedFacetValues.length; ++i) { + if (typeof object.mergedFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.mergedFacetValues: object expected"); + message.mergedFacetValues[i] = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.fromObject(object.mergedFacetValues[i]); + } + } + if (object.mergedFacet != null) { + if (typeof object.mergedFacet !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.mergedFacet: object expected"); + message.mergedFacet = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.fromObject(object.mergedFacet); + } + if (object.rerankConfig != null) { + if (typeof object.rerankConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.rerankConfig: object expected"); + message.rerankConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.fromObject(object.rerankConfig); + } + return message; + }; - /** - * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest - */ - ImportUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsRequest) + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig} message FacetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetIntervals = []; + object.ignoredFacetValues = []; + object.mergedFacetValues = []; + } + if (options.defaults) { + object.mergedFacet = null; + object.rerankConfig = null; + } + if (message.facetIntervals && message.facetIntervals.length) { + object.facetIntervals = []; + for (var j = 0; j < message.facetIntervals.length; ++j) + object.facetIntervals[j] = $root.google.cloud.retail.v2alpha.Interval.toObject(message.facetIntervals[j], options); + } + if (message.ignoredFacetValues && message.ignoredFacetValues.length) { + object.ignoredFacetValues = []; + for (var j = 0; j < message.ignoredFacetValues.length; ++j) + object.ignoredFacetValues[j] = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.toObject(message.ignoredFacetValues[j], options); + } + if (message.mergedFacetValues && message.mergedFacetValues.length) { + object.mergedFacetValues = []; + for (var j = 0; j < message.mergedFacetValues.length; ++j) + object.mergedFacetValues[j] = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.toObject(message.mergedFacetValues[j], options); + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) + object.mergedFacet = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.toObject(message.mergedFacet, options); + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) + object.rerankConfig = $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.toObject(message.rerankConfig, options); return object; - var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.fromObject(object.inputConfig); - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } - return message; - }; + }; - /** - * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {google.cloud.retail.v2alpha.ImportUserEventsRequest} message ImportUserEventsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportUserEventsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.errorsConfig = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.toObject(message.inputConfig, options); - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); - return object; - }; + /** + * Converts this FacetConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @instance + * @returns {Object.} JSON object + */ + FacetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ImportUserEventsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @instance - * @returns {Object.} JSON object - */ - ImportUserEventsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for FacetConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig"; + }; - /** - * Gets the default type url for ImportUserEventsRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportUserEventsRequest"; - }; + FacetConfig.IgnoredFacetValues = (function() { - return ImportUserEventsRequest; - })(); + /** + * Properties of an IgnoredFacetValues. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @interface IIgnoredFacetValues + * @property {Array.|null} [values] IgnoredFacetValues values + * @property {google.protobuf.ITimestamp|null} [startTime] IgnoredFacetValues startTime + * @property {google.protobuf.ITimestamp|null} [endTime] IgnoredFacetValues endTime + */ - v2alpha.ImportCompletionDataRequest = (function() { + /** + * Constructs a new IgnoredFacetValues. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @classdesc Represents an IgnoredFacetValues. + * @implements IIgnoredFacetValues + * @constructor + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + */ + function IgnoredFacetValues(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]]; + } - /** - * Properties of an ImportCompletionDataRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IImportCompletionDataRequest - * @property {string|null} [parent] ImportCompletionDataRequest parent - * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig - * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic - */ + /** + * IgnoredFacetValues values. + * @member {Array.} values + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.values = $util.emptyArray; - /** - * Constructs a new ImportCompletionDataRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportCompletionDataRequest. - * @implements IImportCompletionDataRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set - */ - function ImportCompletionDataRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * IgnoredFacetValues startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.startTime = null; - /** - * ImportCompletionDataRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.parent = ""; + /** + * IgnoredFacetValues endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.endTime = null; - /** - * ImportCompletionDataRequest inputConfig. - * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} inputConfig - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.inputConfig = null; + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues instance + */ + IgnoredFacetValues.create = function create(properties) { + return new IgnoredFacetValues(properties); + }; - /** - * ImportCompletionDataRequest notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - */ - ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Creates a new ImportCompletionDataRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest instance - */ - ImportCompletionDataRequest.create = function create(properties) { - return new ImportCompletionDataRequest(properties); - }; + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCompletionDataRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) - $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); - return writer; - }; + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCompletionDataRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); - break; + /** + * Verifies an IgnoredFacetValues message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IgnoredFacetValues.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; } - case 3: { - message.notificationPubsubTopic = reader.string(); - break; + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return null; + }; - /** - * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates an IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + */ + IgnoredFacetValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues) + return object; + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.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.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; - /** - * Verifies an ImportCompletionDataRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues} message IgnoredFacetValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IgnoredFacetValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + 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 IgnoredFacetValues to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + * @returns {Object.} JSON object + */ + IgnoredFacetValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IgnoredFacetValues + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IgnoredFacetValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IgnoredFacetValues"; + }; + + return IgnoredFacetValues; + })(); + + FacetConfig.MergedFacetValue = (function() { + + /** + * Properties of a MergedFacetValue. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @interface IMergedFacetValue + * @property {Array.|null} [values] MergedFacetValue values + * @property {string|null} [mergedValue] MergedFacetValue mergedValue + */ + + /** + * Constructs a new MergedFacetValue. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacetValue. + * @implements IMergedFacetValue + * @constructor + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + */ + function MergedFacetValue(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]]; + } + + /** + * MergedFacetValue values. + * @member {Array.} values + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.values = $util.emptyArray; + + /** + * MergedFacetValue mergedValue. + * @member {string} mergedValue + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.mergedValue = ""; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue instance + */ + MergedFacetValue.create = function create(properties) { + return new MergedFacetValue(properties); + }; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.mergedValue != null && Object.hasOwnProperty.call(message, "mergedValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mergedValue); + return writer; + }; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.mergedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacetValue message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacetValue.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + if (!$util.isString(message.mergedValue)) + return "mergedValue: string expected"; + return null; + }; + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + */ + MergedFacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue) + return object; + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.mergedValue != null) + message.mergedValue = String(object.mergedValue); + return message; + }; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue} message MergedFacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacetValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) + object.mergedValue = ""; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + object.mergedValue = message.mergedValue; + return object; + }; + + /** + * Converts this MergedFacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + * @returns {Object.} JSON object + */ + MergedFacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacetValue + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacetValue"; + }; + + return MergedFacetValue; + })(); + + FacetConfig.MergedFacet = (function() { + + /** + * Properties of a MergedFacet. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @interface IMergedFacet + * @property {string|null} [mergedFacetKey] MergedFacet mergedFacetKey + */ + + /** + * Constructs a new MergedFacet. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacet. + * @implements IMergedFacet + * @constructor + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + */ + function MergedFacet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergedFacet mergedFacetKey. + * @member {string} mergedFacetKey + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @instance + */ + MergedFacet.prototype.mergedFacetKey = ""; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet instance + */ + MergedFacet.create = function create(properties) { + return new MergedFacet(properties); + }; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mergedFacetKey != null && Object.hasOwnProperty.call(message, "mergedFacetKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mergedFacetKey); + return writer; + }; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mergedFacetKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacet message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + if (!$util.isString(message.mergedFacetKey)) + return "mergedFacetKey: string expected"; + return null; + }; + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + */ + MergedFacet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet) + return object; + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet(); + if (object.mergedFacetKey != null) + message.mergedFacetKey = String(object.mergedFacetKey); + return message; + }; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet} message MergedFacet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mergedFacetKey = ""; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + object.mergedFacetKey = message.mergedFacetKey; + return object; + }; + + /** + * Converts this MergedFacet to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @instance + * @returns {Object.} JSON object + */ + MergedFacet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacet + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.MergedFacet"; + }; + + return MergedFacet; + })(); + + FacetConfig.RerankConfig = (function() { + + /** + * Properties of a RerankConfig. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @interface IRerankConfig + * @property {boolean|null} [rerankFacet] RerankConfig rerankFacet + * @property {Array.|null} [facetValues] RerankConfig facetValues + */ + + /** + * Constructs a new RerankConfig. + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig + * @classdesc Represents a RerankConfig. + * @implements IRerankConfig + * @constructor + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + */ + function RerankConfig(properties) { + this.facetValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RerankConfig rerankFacet. + * @member {boolean} rerankFacet + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.rerankFacet = false; + + /** + * RerankConfig facetValues. + * @member {Array.} facetValues + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.facetValues = $util.emptyArray; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig instance + */ + RerankConfig.create = function create(properties) { + return new RerankConfig(properties); + }; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rerankFacet != null && Object.hasOwnProperty.call(message, "rerankFacet")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.rerankFacet); + if (message.facetValues != null && message.facetValues.length) + for (var i = 0; i < message.facetValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.facetValues[i]); + return writer; + }; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rerankFacet = reader.bool(); + break; + } + case 2: { + if (!(message.facetValues && message.facetValues.length)) + message.facetValues = []; + message.facetValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RerankConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RerankConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + if (typeof message.rerankFacet !== "boolean") + return "rerankFacet: boolean expected"; + if (message.facetValues != null && message.hasOwnProperty("facetValues")) { + if (!Array.isArray(message.facetValues)) + return "facetValues: array expected"; + for (var i = 0; i < message.facetValues.length; ++i) + if (!$util.isString(message.facetValues[i])) + return "facetValues: string[] expected"; + } + return null; + }; + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + */ + RerankConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig(); + if (object.rerankFacet != null) + message.rerankFacet = Boolean(object.rerankFacet); + if (object.facetValues) { + if (!Array.isArray(object.facetValues)) + throw TypeError(".google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig.facetValues: array expected"); + message.facetValues = []; + for (var i = 0; i < object.facetValues.length; ++i) + message.facetValues[i] = String(object.facetValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig} message RerankConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RerankConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facetValues = []; + if (options.defaults) + object.rerankFacet = false; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + object.rerankFacet = message.rerankFacet; + if (message.facetValues && message.facetValues.length) { + object.facetValues = []; + for (var j = 0; j < message.facetValues.length; ++j) + object.facetValues[j] = message.facetValues[j]; + } + return object; + }; + + /** + * Converts this RerankConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @instance + * @returns {Object.} JSON object + */ + RerankConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RerankConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RerankConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CatalogAttribute.FacetConfig.RerankConfig"; + }; + + return RerankConfig; + })(); + + return FacetConfig; + })(); + + /** + * AttributeType enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.AttributeType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} TEXTUAL=1 TEXTUAL value + * @property {number} NUMERICAL=2 NUMERICAL value */ - ImportCompletionDataRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.inputConfig); - if (error) - return "inputConfig." + error; - } - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; - return null; - }; + CatalogAttribute.AttributeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "TEXTUAL"] = 1; + values[valuesById[2] = "NUMERICAL"] = 2; + return values; + })(); /** - * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest + * IndexableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption + * @enum {number} + * @property {number} INDEXABLE_OPTION_UNSPECIFIED=0 INDEXABLE_OPTION_UNSPECIFIED value + * @property {number} INDEXABLE_ENABLED=1 INDEXABLE_ENABLED value + * @property {number} INDEXABLE_DISABLED=2 INDEXABLE_DISABLED value */ - ImportCompletionDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.inputConfig); - } - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); - return message; - }; + CatalogAttribute.IndexableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INDEXABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "INDEXABLE_ENABLED"] = 1; + values[valuesById[2] = "INDEXABLE_DISABLED"] = 2; + return values; + })(); /** - * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {google.cloud.retail.v2alpha.ImportCompletionDataRequest} message ImportCompletionDataRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * DynamicFacetableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption + * @enum {number} + * @property {number} DYNAMIC_FACETABLE_OPTION_UNSPECIFIED=0 DYNAMIC_FACETABLE_OPTION_UNSPECIFIED value + * @property {number} DYNAMIC_FACETABLE_ENABLED=1 DYNAMIC_FACETABLE_ENABLED value + * @property {number} DYNAMIC_FACETABLE_DISABLED=2 DYNAMIC_FACETABLE_DISABLED value */ - ImportCompletionDataRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.inputConfig = null; - object.notificationPubsubTopic = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.inputConfig, options); - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; - return object; - }; + CatalogAttribute.DynamicFacetableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DYNAMIC_FACETABLE_ENABLED"] = 1; + values[valuesById[2] = "DYNAMIC_FACETABLE_DISABLED"] = 2; + return values; + })(); /** - * Converts this ImportCompletionDataRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @instance - * @returns {Object.} JSON object + * SearchableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption + * @enum {number} + * @property {number} SEARCHABLE_OPTION_UNSPECIFIED=0 SEARCHABLE_OPTION_UNSPECIFIED value + * @property {number} SEARCHABLE_ENABLED=1 SEARCHABLE_ENABLED value + * @property {number} SEARCHABLE_DISABLED=2 SEARCHABLE_DISABLED value */ - ImportCompletionDataRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + CatalogAttribute.SearchableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCHABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEARCHABLE_ENABLED"] = 1; + values[valuesById[2] = "SEARCHABLE_DISABLED"] = 2; + return values; + })(); /** - * Gets the default type url for ImportCompletionDataRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * ExactSearchableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.ExactSearchableOption + * @enum {number} + * @property {number} EXACT_SEARCHABLE_OPTION_UNSPECIFIED=0 EXACT_SEARCHABLE_OPTION_UNSPECIFIED value + * @property {number} EXACT_SEARCHABLE_ENABLED=1 EXACT_SEARCHABLE_ENABLED value + * @property {number} EXACT_SEARCHABLE_DISABLED=2 EXACT_SEARCHABLE_DISABLED value */ - ImportCompletionDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportCompletionDataRequest"; - }; + CatalogAttribute.ExactSearchableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXACT_SEARCHABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXACT_SEARCHABLE_ENABLED"] = 1; + values[valuesById[2] = "EXACT_SEARCHABLE_DISABLED"] = 2; + return values; + })(); - return ImportCompletionDataRequest; + /** + * RetrievableOption enum. + * @name google.cloud.retail.v2alpha.CatalogAttribute.RetrievableOption + * @enum {number} + * @property {number} RETRIEVABLE_OPTION_UNSPECIFIED=0 RETRIEVABLE_OPTION_UNSPECIFIED value + * @property {number} RETRIEVABLE_ENABLED=1 RETRIEVABLE_ENABLED value + * @property {number} RETRIEVABLE_DISABLED=2 RETRIEVABLE_DISABLED value + */ + CatalogAttribute.RetrievableOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETRIEVABLE_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRIEVABLE_ENABLED"] = 1; + values[valuesById[2] = "RETRIEVABLE_DISABLED"] = 2; + return values; + })(); + + return CatalogAttribute; })(); - v2alpha.ProductInputConfig = (function() { + v2alpha.AttributesConfig = (function() { /** - * Properties of a ProductInputConfig. + * Properties of an AttributesConfig. * @memberof google.cloud.retail.v2alpha - * @interface IProductInputConfig - * @property {google.cloud.retail.v2alpha.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource - * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource + * @interface IAttributesConfig + * @property {string|null} [name] AttributesConfig name + * @property {Object.|null} [catalogAttributes] AttributesConfig catalogAttributes + * @property {google.cloud.retail.v2alpha.AttributeConfigLevel|null} [attributeConfigLevel] AttributesConfig attributeConfigLevel */ /** - * Constructs a new ProductInputConfig. + * Constructs a new AttributesConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductInputConfig. - * @implements IProductInputConfig + * @classdesc Represents an AttributesConfig. + * @implements IAttributesConfig * @constructor - * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAttributesConfig=} [properties] Properties to set */ - function ProductInputConfig(properties) { + function AttributesConfig(properties) { + this.catalogAttributes = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60209,117 +65279,125 @@ } /** - * ProductInputConfig productInlineSource. - * @member {google.cloud.retail.v2alpha.IProductInlineSource|null|undefined} productInlineSource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig - * @instance - */ - ProductInputConfig.prototype.productInlineSource = null; - - /** - * ProductInputConfig gcsSource. - * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * AttributesConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @instance */ - ProductInputConfig.prototype.gcsSource = null; + AttributesConfig.prototype.name = ""; /** - * ProductInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * AttributesConfig catalogAttributes. + * @member {Object.} catalogAttributes + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @instance */ - ProductInputConfig.prototype.bigQuerySource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + AttributesConfig.prototype.catalogAttributes = $util.emptyObject; /** - * ProductInputConfig source. - * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * AttributesConfig attributeConfigLevel. + * @member {google.cloud.retail.v2alpha.AttributeConfigLevel} attributeConfigLevel + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @instance */ - Object.defineProperty(ProductInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + AttributesConfig.prototype.attributeConfigLevel = 0; /** - * Creates a new ProductInputConfig instance using the specified properties. + * Creates a new AttributesConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig instance + * @param {google.cloud.retail.v2alpha.IAttributesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig instance */ - ProductInputConfig.create = function create(properties) { - return new ProductInputConfig(properties); + AttributesConfig.create = function create(properties) { + return new AttributesConfig(properties); }; /** - * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * Encodes the specified AttributesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAttributesConfig} message AttributesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encode = function encode(message, writer) { + AttributesConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) - $root.google.cloud.retail.v2alpha.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.catalogAttributes != null && Object.hasOwnProperty.call(message, "catalogAttributes")) + for (var keys = Object.keys(message.catalogAttributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.attributeConfigLevel != null && Object.hasOwnProperty.call(message, "attributeConfigLevel")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attributeConfigLevel); return writer; }; /** - * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. + * Encodes the specified AttributesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AttributesConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static - * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAttributesConfig} message AttributesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + AttributesConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer. + * Decodes an AttributesConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decode = function decode(reader, length) { + AttributesConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AttributesConfig(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); + if (message.catalogAttributes === $util.emptyObject) + message.catalogAttributes = {}; + 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.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.catalogAttributes[key] = value; break; } case 3: { - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + message.attributeConfigLevel = reader.int32(); break; } default: @@ -60331,174 +65409,193 @@ }; /** - * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. + * Decodes an AttributesConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { + AttributesConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductInputConfig message. + * Verifies an AttributesConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductInputConfig.verify = function verify(message) { + AttributesConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.ProductInlineSource.verify(message.productInlineSource); - if (error) - return "productInlineSource." + error; - } - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.catalogAttributes != null && message.hasOwnProperty("catalogAttributes")) { + if (!$util.isObject(message.catalogAttributes)) + return "catalogAttributes: object expected"; + var key = Object.keys(message.catalogAttributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttributes[key[i]]); if (error) - return "gcsSource." + error; + return "catalogAttributes." + error; } } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; + if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) + switch (message.attributeConfigLevel) { + default: + return "attributeConfigLevel: enum value expected"; + case 0: + case 1: + case 2: + break; } - } return null; }; /** - * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AttributesConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig + * @returns {google.cloud.retail.v2alpha.AttributesConfig} AttributesConfig */ - ProductInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductInputConfig) + AttributesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AttributesConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); - if (object.productInlineSource != null) { - if (typeof object.productInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.productInlineSource: object expected"); - message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.fromObject(object.productInlineSource); - } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + var message = new $root.google.cloud.retail.v2alpha.AttributesConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.catalogAttributes) { + if (typeof object.catalogAttributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AttributesConfig.catalogAttributes: object expected"); + message.catalogAttributes = {}; + for (var keys = Object.keys(object.catalogAttributes), i = 0; i < keys.length; ++i) { + if (typeof object.catalogAttributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AttributesConfig.catalogAttributes: object expected"); + message.catalogAttributes[keys[i]] = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttributes[keys[i]]); + } } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + switch (object.attributeConfigLevel) { + default: + if (typeof object.attributeConfigLevel === "number") { + message.attributeConfigLevel = object.attributeConfigLevel; + break; + } + break; + case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": + case 0: + message.attributeConfigLevel = 0; + break; + case "PRODUCT_LEVEL_ATTRIBUTE_CONFIG": + case 1: + message.attributeConfigLevel = 1; + break; + case "CATALOG_LEVEL_ATTRIBUTE_CONFIG": + case 2: + message.attributeConfigLevel = 2; + break; } return message; }; /** - * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. + * Creates a plain object from an AttributesConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static - * @param {google.cloud.retail.v2alpha.ProductInputConfig} message ProductInputConfig + * @param {google.cloud.retail.v2alpha.AttributesConfig} message AttributesConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductInputConfig.toObject = function toObject(message, options) { + AttributesConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { - object.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.toObject(message.productInlineSource, options); - if (options.oneofs) - object.source = "productInlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; + if (options.objects || options.defaults) + object.catalogAttributes = {}; + if (options.defaults) { + object.name = ""; + object.attributeConfigLevel = options.enums === String ? "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED" : 0; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.catalogAttributes && (keys2 = Object.keys(message.catalogAttributes)).length) { + object.catalogAttributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); } + if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) + object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] === undefined ? message.attributeConfigLevel : $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; /** - * Converts this ProductInputConfig to JSON. + * Converts this AttributesConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @instance * @returns {Object.} JSON object */ - ProductInputConfig.prototype.toJSON = function toJSON() { + AttributesConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProductInputConfig + * Gets the default type url for AttributesConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @memberof google.cloud.retail.v2alpha.AttributesConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProductInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AttributesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductInputConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AttributesConfig"; }; - return ProductInputConfig; + return AttributesConfig; })(); - v2alpha.UserEventInputConfig = (function() { + v2alpha.CompletionConfig = (function() { /** - * Properties of a UserEventInputConfig. + * Properties of a CompletionConfig. * @memberof google.cloud.retail.v2alpha - * @interface IUserEventInputConfig - * @property {google.cloud.retail.v2alpha.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource - * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource + * @interface ICompletionConfig + * @property {string|null} [name] CompletionConfig name + * @property {string|null} [matchingOrder] CompletionConfig matchingOrder + * @property {number|null} [maxSuggestions] CompletionConfig maxSuggestions + * @property {number|null} [minPrefixLength] CompletionConfig minPrefixLength + * @property {boolean|null} [autoLearning] CompletionConfig autoLearning + * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [suggestionsInputConfig] CompletionConfig suggestionsInputConfig + * @property {string|null} [lastSuggestionsImportOperation] CompletionConfig lastSuggestionsImportOperation + * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [denylistInputConfig] CompletionConfig denylistInputConfig + * @property {string|null} [lastDenylistImportOperation] CompletionConfig lastDenylistImportOperation + * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [allowlistInputConfig] CompletionConfig allowlistInputConfig + * @property {string|null} [lastAllowlistImportOperation] CompletionConfig lastAllowlistImportOperation */ /** - * Constructs a new UserEventInputConfig. + * Constructs a new CompletionConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventInputConfig. - * @implements IUserEventInputConfig + * @classdesc Represents a CompletionConfig. + * @implements ICompletionConfig * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICompletionConfig=} [properties] Properties to set */ - function UserEventInputConfig(properties) { + function CompletionConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60506,117 +65603,215 @@ } /** - * UserEventInputConfig userEventInlineSource. - * @member {google.cloud.retail.v2alpha.IUserEventInlineSource|null|undefined} userEventInlineSource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * CompletionConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @instance */ - UserEventInputConfig.prototype.userEventInlineSource = null; + CompletionConfig.prototype.name = ""; /** - * UserEventInputConfig gcsSource. - * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * CompletionConfig matchingOrder. + * @member {string} matchingOrder + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @instance */ - UserEventInputConfig.prototype.gcsSource = null; + CompletionConfig.prototype.matchingOrder = ""; /** - * UserEventInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * CompletionConfig maxSuggestions. + * @member {number} maxSuggestions + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @instance */ - UserEventInputConfig.prototype.bigQuerySource = null; + CompletionConfig.prototype.maxSuggestions = 0; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * CompletionConfig minPrefixLength. + * @member {number} minPrefixLength + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance + */ + CompletionConfig.prototype.minPrefixLength = 0; /** - * UserEventInputConfig source. - * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * CompletionConfig autoLearning. + * @member {boolean} autoLearning + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @instance */ - Object.defineProperty(UserEventInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + CompletionConfig.prototype.autoLearning = false; /** - * Creates a new UserEventInputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig - * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig instance + * CompletionConfig suggestionsInputConfig. + * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} suggestionsInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance */ - UserEventInputConfig.create = function create(properties) { - return new UserEventInputConfig(properties); - }; + CompletionConfig.prototype.suggestionsInputConfig = null; /** - * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig - * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * CompletionConfig lastSuggestionsImportOperation. + * @member {string} lastSuggestionsImportOperation + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance */ - UserEventInputConfig.encode = function encode(message, writer) { - if (!writer) + CompletionConfig.prototype.lastSuggestionsImportOperation = ""; + + /** + * CompletionConfig denylistInputConfig. + * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} denylistInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance + */ + CompletionConfig.prototype.denylistInputConfig = null; + + /** + * CompletionConfig lastDenylistImportOperation. + * @member {string} lastDenylistImportOperation + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance + */ + CompletionConfig.prototype.lastDenylistImportOperation = ""; + + /** + * CompletionConfig allowlistInputConfig. + * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} allowlistInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance + */ + CompletionConfig.prototype.allowlistInputConfig = null; + + /** + * CompletionConfig lastAllowlistImportOperation. + * @member {string} lastAllowlistImportOperation + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @instance + */ + CompletionConfig.prototype.lastAllowlistImportOperation = ""; + + /** + * Creates a new CompletionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @static + * @param {google.cloud.retail.v2alpha.ICompletionConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig instance + */ + CompletionConfig.create = function create(properties) { + return new CompletionConfig(properties); + }; + + /** + * Encodes the specified CompletionConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompletionConfig + * @static + * @param {google.cloud.retail.v2alpha.ICompletionConfig} message CompletionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionConfig.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); - if (message.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) - $root.google.cloud.retail.v2alpha.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.matchingOrder != null && Object.hasOwnProperty.call(message, "matchingOrder")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchingOrder); + if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSuggestions); + if (message.minPrefixLength != null && Object.hasOwnProperty.call(message, "minPrefixLength")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minPrefixLength); + if (message.suggestionsInputConfig != null && Object.hasOwnProperty.call(message, "suggestionsInputConfig")) + $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.suggestionsInputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastSuggestionsImportOperation != null && Object.hasOwnProperty.call(message, "lastSuggestionsImportOperation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastSuggestionsImportOperation); + if (message.denylistInputConfig != null && Object.hasOwnProperty.call(message, "denylistInputConfig")) + $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.denylistInputConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastDenylistImportOperation != null && Object.hasOwnProperty.call(message, "lastDenylistImportOperation")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.lastDenylistImportOperation); + if (message.allowlistInputConfig != null && Object.hasOwnProperty.call(message, "allowlistInputConfig")) + $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.allowlistInputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lastAllowlistImportOperation != null && Object.hasOwnProperty.call(message, "lastAllowlistImportOperation")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.lastAllowlistImportOperation); + if (message.autoLearning != null && Object.hasOwnProperty.call(message, "autoLearning")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoLearning); return writer; }; /** - * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. + * Encodes the specified CompletionConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static - * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionConfig} message CompletionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + CompletionConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer. + * Decodes a CompletionConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decode = function decode(reader, length) { + CompletionConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); + message.matchingOrder = reader.string(); break; } case 3: { - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + message.maxSuggestions = reader.int32(); + break; + } + case 4: { + message.minPrefixLength = reader.int32(); + break; + } + case 11: { + message.autoLearning = reader.bool(); + break; + } + case 5: { + message.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastSuggestionsImportOperation = reader.string(); + break; + } + case 7: { + message.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.lastDenylistImportOperation = reader.string(); + break; + } + case 9: { + message.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.lastAllowlistImportOperation = reader.string(); break; } default: @@ -60628,172 +65823,225 @@ }; /** - * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. + * Decodes a CompletionConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { + CompletionConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventInputConfig message. + * Verifies a CompletionConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventInputConfig.verify = function verify(message) { + CompletionConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.UserEventInlineSource.verify(message.userEventInlineSource); - if (error) - return "userEventInlineSource." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.matchingOrder != null && message.hasOwnProperty("matchingOrder")) + if (!$util.isString(message.matchingOrder)) + return "matchingOrder: string expected"; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + if (!$util.isInteger(message.maxSuggestions)) + return "maxSuggestions: integer expected"; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + if (!$util.isInteger(message.minPrefixLength)) + return "minPrefixLength: integer expected"; + if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) + if (typeof message.autoLearning !== "boolean") + return "autoLearning: boolean expected"; + if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.suggestionsInputConfig); + if (error) + return "suggestionsInputConfig." + error; } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } + if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) + if (!$util.isString(message.lastSuggestionsImportOperation)) + return "lastSuggestionsImportOperation: string expected"; + if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.denylistInputConfig); + if (error) + return "denylistInputConfig." + error; } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); - if (error) - return "bigQuerySource." + error; - } + if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) + if (!$util.isString(message.lastDenylistImportOperation)) + return "lastDenylistImportOperation: string expected"; + if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.allowlistInputConfig); + if (error) + return "allowlistInputConfig." + error; } + if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) + if (!$util.isString(message.lastAllowlistImportOperation)) + return "lastAllowlistImportOperation: string expected"; return null; }; /** - * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig + * @returns {google.cloud.retail.v2alpha.CompletionConfig} CompletionConfig */ - UserEventInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInputConfig) + CompletionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompletionConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); - if (object.userEventInlineSource != null) { - if (typeof object.userEventInlineSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.userEventInlineSource: object expected"); - message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.fromObject(object.userEventInlineSource); + var message = new $root.google.cloud.retail.v2alpha.CompletionConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.matchingOrder != null) + message.matchingOrder = String(object.matchingOrder); + if (object.maxSuggestions != null) + message.maxSuggestions = object.maxSuggestions | 0; + if (object.minPrefixLength != null) + message.minPrefixLength = object.minPrefixLength | 0; + if (object.autoLearning != null) + message.autoLearning = Boolean(object.autoLearning); + if (object.suggestionsInputConfig != null) { + if (typeof object.suggestionsInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.suggestionsInputConfig: object expected"); + message.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.suggestionsInputConfig); } - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + if (object.lastSuggestionsImportOperation != null) + message.lastSuggestionsImportOperation = String(object.lastSuggestionsImportOperation); + if (object.denylistInputConfig != null) { + if (typeof object.denylistInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.denylistInputConfig: object expected"); + message.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.denylistInputConfig); } - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + if (object.lastDenylistImportOperation != null) + message.lastDenylistImportOperation = String(object.lastDenylistImportOperation); + if (object.allowlistInputConfig != null) { + if (typeof object.allowlistInputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompletionConfig.allowlistInputConfig: object expected"); + message.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.allowlistInputConfig); } + if (object.lastAllowlistImportOperation != null) + message.lastAllowlistImportOperation = String(object.lastAllowlistImportOperation); return message; }; /** - * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a CompletionConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static - * @param {google.cloud.retail.v2alpha.UserEventInputConfig} message UserEventInputConfig + * @param {google.cloud.retail.v2alpha.CompletionConfig} message CompletionConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventInputConfig.toObject = function toObject(message, options) { + CompletionConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { - object.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.toObject(message.userEventInlineSource, options); - if (options.oneofs) - object.source = "userEventInlineSource"; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (options.defaults) { + object.name = ""; + object.matchingOrder = ""; + object.maxSuggestions = 0; + object.minPrefixLength = 0; + object.suggestionsInputConfig = null; + object.lastSuggestionsImportOperation = ""; + object.denylistInputConfig = null; + object.lastDenylistImportOperation = ""; + object.allowlistInputConfig = null; + object.lastAllowlistImportOperation = ""; + object.autoLearning = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.matchingOrder != null && message.hasOwnProperty("matchingOrder")) + object.matchingOrder = message.matchingOrder; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + object.maxSuggestions = message.maxSuggestions; + if (message.minPrefixLength != null && message.hasOwnProperty("minPrefixLength")) + object.minPrefixLength = message.minPrefixLength; + if (message.suggestionsInputConfig != null && message.hasOwnProperty("suggestionsInputConfig")) + object.suggestionsInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.suggestionsInputConfig, options); + if (message.lastSuggestionsImportOperation != null && message.hasOwnProperty("lastSuggestionsImportOperation")) + object.lastSuggestionsImportOperation = message.lastSuggestionsImportOperation; + if (message.denylistInputConfig != null && message.hasOwnProperty("denylistInputConfig")) + object.denylistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.denylistInputConfig, options); + if (message.lastDenylistImportOperation != null && message.hasOwnProperty("lastDenylistImportOperation")) + object.lastDenylistImportOperation = message.lastDenylistImportOperation; + if (message.allowlistInputConfig != null && message.hasOwnProperty("allowlistInputConfig")) + object.allowlistInputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.allowlistInputConfig, options); + if (message.lastAllowlistImportOperation != null && message.hasOwnProperty("lastAllowlistImportOperation")) + object.lastAllowlistImportOperation = message.lastAllowlistImportOperation; + if (message.autoLearning != null && message.hasOwnProperty("autoLearning")) + object.autoLearning = message.autoLearning; return object; }; /** - * Converts this UserEventInputConfig to JSON. + * Converts this CompletionConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @instance * @returns {Object.} JSON object */ - UserEventInputConfig.prototype.toJSON = function toJSON() { + CompletionConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserEventInputConfig + * Gets the default type url for CompletionConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @memberof google.cloud.retail.v2alpha.CompletionConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserEventInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CompletionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventInputConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionConfig"; }; - return UserEventInputConfig; + return CompletionConfig; })(); - v2alpha.CompletionDataInputConfig = (function() { + v2alpha.MerchantCenterLink = (function() { /** - * Properties of a CompletionDataInputConfig. + * Properties of a MerchantCenterLink. * @memberof google.cloud.retail.v2alpha - * @interface ICompletionDataInputConfig - * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource + * @interface IMerchantCenterLink + * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterLink merchantCenterAccountId + * @property {string|null} [branchId] MerchantCenterLink branchId + * @property {Array.|null} [destinations] MerchantCenterLink destinations + * @property {string|null} [regionCode] MerchantCenterLink regionCode + * @property {string|null} [languageCode] MerchantCenterLink languageCode + * @property {Array.|null} [feeds] MerchantCenterLink feeds */ /** - * Constructs a new CompletionDataInputConfig. + * Constructs a new MerchantCenterLink. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionDataInputConfig. - * @implements ICompletionDataInputConfig + * @classdesc Represents a MerchantCenterLink. + * @implements IMerchantCenterLink * @constructor - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set */ - function CompletionDataInputConfig(properties) { + function MerchantCenterLink(properties) { + this.destinations = []; + this.feeds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60801,89 +66049,151 @@ } /** - * CompletionDataInputConfig bigQuerySource. - * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * MerchantCenterLink merchantCenterAccountId. + * @member {number|Long} merchantCenterAccountId + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @instance */ - CompletionDataInputConfig.prototype.bigQuerySource = null; + MerchantCenterLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * MerchantCenterLink branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.branchId = ""; /** - * CompletionDataInputConfig source. - * @member {"bigQuerySource"|undefined} source - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * MerchantCenterLink destinations. + * @member {Array.} destinations + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @instance */ - Object.defineProperty(CompletionDataInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), - set: $util.oneOfSetter($oneOfFields) - }); + MerchantCenterLink.prototype.destinations = $util.emptyArray; /** - * Creates a new CompletionDataInputConfig instance using the specified properties. + * MerchantCenterLink regionCode. + * @member {string} regionCode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.regionCode = ""; + + /** + * MerchantCenterLink languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.languageCode = ""; + + /** + * MerchantCenterLink feeds. + * @member {Array.} feeds + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink + * @instance + */ + MerchantCenterLink.prototype.feeds = $util.emptyArray; + + /** + * Creates a new MerchantCenterLink instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig instance + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink instance */ - CompletionDataInputConfig.create = function create(properties) { - return new CompletionDataInputConfig(properties); + MerchantCenterLink.create = function create(properties) { + return new MerchantCenterLink(properties); }; /** - * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified MerchantCenterLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encode = function encode(message, writer) { + MerchantCenterLink.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) - $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.merchantCenterAccountId); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinations[i]); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.regionCode); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.encode(message.feeds[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. + * Encodes the specified MerchantCenterLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLink.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static - * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterLink} message MerchantCenterLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterLink.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer. + * Decodes a MerchantCenterLink message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decode = function decode(reader, length) { + MerchantCenterLink.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); + message.merchantCenterAccountId = reader.int64(); + break; + } + case 2: { + message.branchId = reader.string(); + break; + } + case 3: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push(reader.string()); + break; + } + case 4: { + message.regionCode = reader.string(); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + case 6: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.decode(reader, reader.uint32())); break; } default: @@ -60895,138 +66205,209 @@ }; /** - * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLink message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterLink.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionDataInputConfig message. + * Verifies a MerchantCenterLink message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionDataInputConfig.verify = function verify(message) { + MerchantCenterLink.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - properties.source = 1; - { - var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) + return "merchantCenterAccountId: integer|Long expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: 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) + if (!$util.isString(message.destinations[i])) + return "destinations: string[] expected"; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify(message.feeds[i]); if (error) - return "bigQuerySource." + error; + return "feeds." + error; } } return null; }; /** - * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLink message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig + * @returns {google.cloud.retail.v2alpha.MerchantCenterLink} MerchantCenterLink */ - CompletionDataInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDataInputConfig) + MerchantCenterLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLink) return object; - var message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); - if (object.bigQuerySource != null) { - if (typeof object.bigQuerySource !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompletionDataInputConfig.bigQuerySource: object expected"); - message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLink(); + if (object.merchantCenterAccountId != null) + if ($util.Long) + (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; + else if (typeof object.merchantCenterAccountId === "string") + message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); + else if (typeof object.merchantCenterAccountId === "number") + message.merchantCenterAccountId = object.merchantCenterAccountId; + else if (typeof object.merchantCenterAccountId === "object") + message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + message.destinations[i] = String(object.destinations[i]); + } + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLink.feeds: object expected"); + message.feeds[i] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.fromObject(object.feeds[i]); + } } return message; }; /** - * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterLink message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static - * @param {google.cloud.retail.v2alpha.CompletionDataInputConfig} message CompletionDataInputConfig + * @param {google.cloud.retail.v2alpha.MerchantCenterLink} message MerchantCenterLink * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompletionDataInputConfig.toObject = function toObject(message, options) { + MerchantCenterLink.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { - object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); - if (options.oneofs) - object.source = "bigQuerySource"; + if (options.arrays || options.defaults) { + object.destinations = []; + object.feeds = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.merchantCenterAccountId = options.longs === String ? "0" : 0; + object.branchId = ""; + object.regionCode = ""; + object.languageCode = ""; + } + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (typeof message.merchantCenterAccountId === "number") + object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; + else + object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = message.destinations[j]; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter.toObject(message.feeds[j], options); } return object; }; /** - * Converts this CompletionDataInputConfig to JSON. + * Converts this MerchantCenterLink to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @instance * @returns {Object.} JSON object */ - CompletionDataInputConfig.prototype.toJSON = function toJSON() { + MerchantCenterLink.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CompletionDataInputConfig + * Gets the default type url for MerchantCenterLink * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig + * @memberof google.cloud.retail.v2alpha.MerchantCenterLink * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CompletionDataInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MerchantCenterLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionDataInputConfig"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterLink"; }; - return CompletionDataInputConfig; + return MerchantCenterLink; })(); - v2alpha.ImportMetadata = (function() { + v2alpha.MerchantCenterFeedFilter = (function() { /** - * Properties of an ImportMetadata. + * Properties of a MerchantCenterFeedFilter. * @memberof google.cloud.retail.v2alpha - * @interface IImportMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime - * @property {number|Long|null} [successCount] ImportMetadata successCount - * @property {number|Long|null} [failureCount] ImportMetadata failureCount - * @property {string|null} [requestId] ImportMetadata requestId - * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic - * @property {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null} [transformedUserEventsMetadata] ImportMetadata transformedUserEventsMetadata + * @interface IMerchantCenterFeedFilter + * @property {number|Long|null} [primaryFeedId] MerchantCenterFeedFilter primaryFeedId + * @property {string|null} [primaryFeedName] MerchantCenterFeedFilter primaryFeedName */ /** - * Constructs a new ImportMetadata. + * Constructs a new MerchantCenterFeedFilter. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportMetadata. - * @implements IImportMetadata + * @classdesc Represents a MerchantCenterFeedFilter. + * @implements IMerchantCenterFeedFilter * @constructor - * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set */ - function ImportMetadata(properties) { + function MerchantCenterFeedFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61034,159 +66415,89 @@ } /** - * ImportMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.createTime = null; - - /** - * ImportMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.updateTime = null; - - /** - * ImportMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImportMetadata requestId. - * @member {string} requestId - * @memberof google.cloud.retail.v2alpha.ImportMetadata - * @instance - */ - ImportMetadata.prototype.requestId = ""; - - /** - * ImportMetadata notificationPubsubTopic. - * @member {string} notificationPubsubTopic - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * MerchantCenterFeedFilter primaryFeedId. + * @member {number|Long} primaryFeedId + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @instance */ - ImportMetadata.prototype.notificationPubsubTopic = ""; + MerchantCenterFeedFilter.prototype.primaryFeedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ImportMetadata transformedUserEventsMetadata. - * @member {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null|undefined} transformedUserEventsMetadata - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * MerchantCenterFeedFilter primaryFeedName. + * @member {string} primaryFeedName + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @instance */ - ImportMetadata.prototype.transformedUserEventsMetadata = null; + MerchantCenterFeedFilter.prototype.primaryFeedName = ""; /** - * Creates a new ImportMetadata instance using the specified properties. + * Creates a new MerchantCenterFeedFilter instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata instance + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter instance */ - ImportMetadata.create = function create(properties) { - return new ImportMetadata(properties); + MerchantCenterFeedFilter.create = function create(properties) { + return new MerchantCenterFeedFilter(properties); }; /** - * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encode = function encode(message, writer) { + MerchantCenterFeedFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.notificationPubsubTopic); - if (message.transformedUserEventsMetadata != null && Object.hasOwnProperty.call(message, "transformedUserEventsMetadata")) - $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.encode(message.transformedUserEventsMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.primaryFeedId != null && Object.hasOwnProperty.call(message, "primaryFeedId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.primaryFeedId); + if (message.primaryFeedName != null && Object.hasOwnProperty.call(message, "primaryFeedName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryFeedName); return writer; }; /** - * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. + * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterFeedFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterFeedFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportMetadata message from the specified reader or buffer. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decode = function decode(reader, length) { + MerchantCenterFeedFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.primaryFeedId = reader.int64(); break; } case 2: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.successCount = reader.int64(); - break; - } - case 4: { - message.failureCount = reader.int64(); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - message.notificationPubsubTopic = reader.string(); - break; - } - case 7: { - message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.decode(reader, reader.uint32()); + message.primaryFeedName = reader.string(); break; } default: @@ -61198,215 +66509,146 @@ }; /** - * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportMetadata.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterFeedFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportMetadata message. + * Verifies a MerchantCenterFeedFilter message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportMetadata.verify = function verify(message) { + MerchantCenterFeedFilter.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.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - if (!$util.isString(message.notificationPubsubTopic)) - return "notificationPubsubTopic: string expected"; - if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) { - var error = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify(message.transformedUserEventsMetadata); - if (error) - return "transformedUserEventsMetadata." + error; - } + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (!$util.isInteger(message.primaryFeedId) && !(message.primaryFeedId && $util.isInteger(message.primaryFeedId.low) && $util.isInteger(message.primaryFeedId.high))) + return "primaryFeedId: integer|Long expected"; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + if (!$util.isString(message.primaryFeedName)) + return "primaryFeedName: string expected"; return null; }; /** - * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} MerchantCenterFeedFilter */ - ImportMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportMetadata) + MerchantCenterFeedFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.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.retail.v2alpha.ImportMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterFeedFilter(); + if (object.primaryFeedId != null) if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.notificationPubsubTopic != null) - message.notificationPubsubTopic = String(object.notificationPubsubTopic); - if (object.transformedUserEventsMetadata != null) { - if (typeof object.transformedUserEventsMetadata !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.transformedUserEventsMetadata: object expected"); - message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.fromObject(object.transformedUserEventsMetadata); - } + (message.primaryFeedId = $util.Long.fromValue(object.primaryFeedId)).unsigned = false; + else if (typeof object.primaryFeedId === "string") + message.primaryFeedId = parseInt(object.primaryFeedId, 10); + else if (typeof object.primaryFeedId === "number") + message.primaryFeedId = object.primaryFeedId; + else if (typeof object.primaryFeedId === "object") + message.primaryFeedId = new $util.LongBits(object.primaryFeedId.low >>> 0, object.primaryFeedId.high >>> 0).toNumber(); + if (object.primaryFeedName != null) + message.primaryFeedName = String(object.primaryFeedName); return message; }; /** - * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.ImportMetadata} message ImportMetadata + * @param {google.cloud.retail.v2alpha.MerchantCenterFeedFilter} message MerchantCenterFeedFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportMetadata.toObject = function toObject(message, options) { + MerchantCenterFeedFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.updateTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.primaryFeedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.failureCount = options.longs === String ? "0" : 0; - object.requestId = ""; - object.notificationPubsubTopic = ""; - object.transformedUserEventsMetadata = null; + object.primaryFeedId = options.longs === String ? "0" : 0; + object.primaryFeedName = ""; } - 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.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (typeof message.primaryFeedId === "number") + object.primaryFeedId = options.longs === String ? String(message.primaryFeedId) : message.primaryFeedId; else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) - object.notificationPubsubTopic = message.notificationPubsubTopic; - if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) - object.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.toObject(message.transformedUserEventsMetadata, options); + object.primaryFeedId = options.longs === String ? $util.Long.prototype.toString.call(message.primaryFeedId) : options.longs === Number ? new $util.LongBits(message.primaryFeedId.low >>> 0, message.primaryFeedId.high >>> 0).toNumber() : message.primaryFeedId; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + object.primaryFeedName = message.primaryFeedName; return object; }; /** - * Converts this ImportMetadata to JSON. + * Converts this MerchantCenterFeedFilter to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @instance * @returns {Object.} JSON object */ - ImportMetadata.prototype.toJSON = function toJSON() { + MerchantCenterFeedFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportMetadata + * Gets the default type url for MerchantCenterFeedFilter * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterFeedFilter * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MerchantCenterFeedFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterFeedFilter"; }; - return ImportMetadata; + return MerchantCenterFeedFilter; })(); - v2alpha.TransformedUserEventsMetadata = (function() { + v2alpha.MerchantCenterLinkingConfig = (function() { /** - * Properties of a TransformedUserEventsMetadata. + * Properties of a MerchantCenterLinkingConfig. * @memberof google.cloud.retail.v2alpha - * @interface ITransformedUserEventsMetadata - * @property {number|Long|null} [sourceEventsCount] TransformedUserEventsMetadata sourceEventsCount - * @property {number|Long|null} [transformedEventsCount] TransformedUserEventsMetadata transformedEventsCount + * @interface IMerchantCenterLinkingConfig + * @property {Array.|null} [links] MerchantCenterLinkingConfig links */ /** - * Constructs a new TransformedUserEventsMetadata. + * Constructs a new MerchantCenterLinkingConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a TransformedUserEventsMetadata. - * @implements ITransformedUserEventsMetadata + * @classdesc Represents a MerchantCenterLinkingConfig. + * @implements IMerchantCenterLinkingConfig * @constructor - * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set */ - function TransformedUserEventsMetadata(properties) { + function MerchantCenterLinkingConfig(properties) { + this.links = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61414,89 +66656,78 @@ } /** - * TransformedUserEventsMetadata sourceEventsCount. - * @member {number|Long} sourceEventsCount - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * MerchantCenterLinkingConfig links. + * @member {Array.} links + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @instance */ - TransformedUserEventsMetadata.prototype.sourceEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MerchantCenterLinkingConfig.prototype.links = $util.emptyArray; /** - * TransformedUserEventsMetadata transformedEventsCount. - * @member {number|Long} transformedEventsCount - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata - * @instance + * Creates a new MerchantCenterLinkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig + * @static + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig instance */ - TransformedUserEventsMetadata.prototype.transformedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MerchantCenterLinkingConfig.create = function create(properties) { + return new MerchantCenterLinkingConfig(properties); + }; /** - * Creates a new TransformedUserEventsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata - * @static - * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata instance - */ - TransformedUserEventsMetadata.create = function create(properties) { - return new TransformedUserEventsMetadata(properties); - }; - - /** - * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * Encodes the specified MerchantCenterLinkingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransformedUserEventsMetadata.encode = function encode(message, writer) { + MerchantCenterLinkingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceEventsCount != null && Object.hasOwnProperty.call(message, "sourceEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sourceEventsCount); - if (message.transformedEventsCount != null && Object.hasOwnProperty.call(message, "transformedEventsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.transformedEventsCount); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterLink.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. + * Encodes the specified MerchantCenterLinkingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig} message MerchantCenterLinkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransformedUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterLinkingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransformedUserEventsMetadata.decode = function decode(reader, length) { + MerchantCenterLinkingConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.sourceEventsCount = reader.int64(); - break; - } - case 2: { - message.transformedEventsCount = reader.int64(); + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.cloud.retail.v2alpha.MerchantCenterLink.decode(reader, reader.uint32())); break; } default: @@ -61508,161 +66739,142 @@ }; /** - * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterLinkingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TransformedUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterLinkingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TransformedUserEventsMetadata message. + * Verifies a MerchantCenterLinkingConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TransformedUserEventsMetadata.verify = function verify(message) { + MerchantCenterLinkingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) - if (!$util.isInteger(message.sourceEventsCount) && !(message.sourceEventsCount && $util.isInteger(message.sourceEventsCount.low) && $util.isInteger(message.sourceEventsCount.high))) - return "sourceEventsCount: integer|Long expected"; - if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) - if (!$util.isInteger(message.transformedEventsCount) && !(message.transformedEventsCount && $util.isInteger(message.transformedEventsCount.low) && $util.isInteger(message.transformedEventsCount.high))) - return "transformedEventsCount: integer|Long expected"; + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterLink.verify(message.links[i]); + if (error) + return "links." + error; + } + } return null; }; /** - * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterLinkingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata + * @returns {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} MerchantCenterLinkingConfig */ - TransformedUserEventsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata) + MerchantCenterLinkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); - if (object.sourceEventsCount != null) - if ($util.Long) - (message.sourceEventsCount = $util.Long.fromValue(object.sourceEventsCount)).unsigned = false; - else if (typeof object.sourceEventsCount === "string") - message.sourceEventsCount = parseInt(object.sourceEventsCount, 10); - else if (typeof object.sourceEventsCount === "number") - message.sourceEventsCount = object.sourceEventsCount; - else if (typeof object.sourceEventsCount === "object") - message.sourceEventsCount = new $util.LongBits(object.sourceEventsCount.low >>> 0, object.sourceEventsCount.high >>> 0).toNumber(); - if (object.transformedEventsCount != null) - if ($util.Long) - (message.transformedEventsCount = $util.Long.fromValue(object.transformedEventsCount)).unsigned = false; - else if (typeof object.transformedEventsCount === "string") - message.transformedEventsCount = parseInt(object.transformedEventsCount, 10); - else if (typeof object.transformedEventsCount === "number") - message.transformedEventsCount = object.transformedEventsCount; - else if (typeof object.transformedEventsCount === "object") - message.transformedEventsCount = new $util.LongBits(object.transformedEventsCount.low >>> 0, object.transformedEventsCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig(); + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.links[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.links: object expected"); + message.links[i] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.fromObject(object.links[i]); + } + } return message; }; /** - * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterLinkingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static - * @param {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} message TransformedUserEventsMetadata + * @param {google.cloud.retail.v2alpha.MerchantCenterLinkingConfig} message MerchantCenterLinkingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransformedUserEventsMetadata.toObject = function toObject(message, options) { + MerchantCenterLinkingConfig.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.sourceEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sourceEventsCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.transformedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.transformedEventsCount = options.longs === String ? "0" : 0; + if (options.arrays || options.defaults) + object.links = []; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.cloud.retail.v2alpha.MerchantCenterLink.toObject(message.links[j], options); } - if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) - if (typeof message.sourceEventsCount === "number") - object.sourceEventsCount = options.longs === String ? String(message.sourceEventsCount) : message.sourceEventsCount; - else - object.sourceEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.sourceEventsCount) : options.longs === Number ? new $util.LongBits(message.sourceEventsCount.low >>> 0, message.sourceEventsCount.high >>> 0).toNumber() : message.sourceEventsCount; - if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) - if (typeof message.transformedEventsCount === "number") - object.transformedEventsCount = options.longs === String ? String(message.transformedEventsCount) : message.transformedEventsCount; - else - object.transformedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.transformedEventsCount) : options.longs === Number ? new $util.LongBits(message.transformedEventsCount.low >>> 0, message.transformedEventsCount.high >>> 0).toNumber() : message.transformedEventsCount; return object; }; /** - * Converts this TransformedUserEventsMetadata to JSON. + * Converts this MerchantCenterLinkingConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @instance * @returns {Object.} JSON object */ - TransformedUserEventsMetadata.prototype.toJSON = function toJSON() { + MerchantCenterLinkingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TransformedUserEventsMetadata + * Gets the default type url for MerchantCenterLinkingConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.MerchantCenterLinkingConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TransformedUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MerchantCenterLinkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.TransformedUserEventsMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterLinkingConfig"; }; - return TransformedUserEventsMetadata; + return MerchantCenterLinkingConfig; })(); - v2alpha.ImportProductsResponse = (function() { + v2alpha.Catalog = (function() { /** - * Properties of an ImportProductsResponse. + * Properties of a Catalog. * @memberof google.cloud.retail.v2alpha - * @interface IImportProductsResponse - * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig + * @interface ICatalog + * @property {string|null} [name] Catalog name + * @property {string|null} [displayName] Catalog displayName + * @property {google.cloud.retail.v2alpha.IProductLevelConfig|null} [productLevelConfig] Catalog productLevelConfig + * @property {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null} [merchantCenterLinkingConfig] Catalog merchantCenterLinkingConfig */ /** - * Constructs a new ImportProductsResponse. + * Constructs a new Catalog. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportProductsResponse. - * @implements IImportProductsResponse + * @classdesc Represents a Catalog. + * @implements ICatalog * @constructor - * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set */ - function ImportProductsResponse(properties) { - this.errorSamples = []; + function Catalog(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61670,92 +66882,117 @@ } /** - * ImportProductsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * Catalog name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Catalog * @instance */ - ImportProductsResponse.prototype.errorSamples = $util.emptyArray; + Catalog.prototype.name = ""; /** - * ImportProductsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * Catalog displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Catalog * @instance */ - ImportProductsResponse.prototype.errorsConfig = null; + Catalog.prototype.displayName = ""; /** - * Creates a new ImportProductsResponse instance using the specified properties. + * Catalog productLevelConfig. + * @member {google.cloud.retail.v2alpha.IProductLevelConfig|null|undefined} productLevelConfig + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.productLevelConfig = null; + + /** + * Catalog merchantCenterLinkingConfig. + * @member {google.cloud.retail.v2alpha.IMerchantCenterLinkingConfig|null|undefined} merchantCenterLinkingConfig + * @memberof google.cloud.retail.v2alpha.Catalog + * @instance + */ + Catalog.prototype.merchantCenterLinkingConfig = null; + + /** + * Creates a new Catalog instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse instance + * @param {google.cloud.retail.v2alpha.ICatalog=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog instance */ - ImportProductsResponse.create = function create(properties) { - return new ImportProductsResponse(properties); + Catalog.create = function create(properties) { + return new Catalog(properties); }; /** - * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * Encodes the specified Catalog message. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encode = function encode(message, writer) { + Catalog.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.productLevelConfig != null && Object.hasOwnProperty.call(message, "productLevelConfig")) + $root.google.cloud.retail.v2alpha.ProductLevelConfig.encode(message.productLevelConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.merchantCenterLinkingConfig != null && Object.hasOwnProperty.call(message, "merchantCenterLinkingConfig")) + $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.encode(message.merchantCenterLinkingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. + * Encodes the specified Catalog message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Catalog.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static - * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICatalog} message Catalog message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Catalog.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer. + * Decodes a Catalog message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decode = function decode(reader, length) { + Catalog.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Catalog(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.name = reader.string(); break; } case 2: { - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); + message.displayName = reader.string(); + break; + } + case 4: { + message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.decode(reader, reader.uint32()); break; } default: @@ -61767,156 +67004,159 @@ }; /** - * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a Catalog message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { + Catalog.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportProductsResponse message. + * Verifies a Catalog message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportProductsResponse.verify = function verify(message) { + Catalog.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + 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.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) { + var error = $root.google.cloud.retail.v2alpha.ProductLevelConfig.verify(message.productLevelConfig); + if (error) + return "productLevelConfig." + error; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.verify(message.merchantCenterLinkingConfig); if (error) - return "errorsConfig." + error; + return "merchantCenterLinkingConfig." + error; } return null; }; /** - * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Catalog message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse + * @returns {google.cloud.retail.v2alpha.Catalog} Catalog */ - ImportProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsResponse) + Catalog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Catalog) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } + var message = new $root.google.cloud.retail.v2alpha.Catalog(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.productLevelConfig != null) { + if (typeof object.productLevelConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Catalog.productLevelConfig: object expected"); + message.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.fromObject(object.productLevelConfig); } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + if (object.merchantCenterLinkingConfig != null) { + if (typeof object.merchantCenterLinkingConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Catalog.merchantCenterLinkingConfig: object expected"); + message.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.fromObject(object.merchantCenterLinkingConfig); } return message; }; /** - * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a Catalog message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static - * @param {google.cloud.retail.v2alpha.ImportProductsResponse} message ImportProductsResponse + * @param {google.cloud.retail.v2alpha.Catalog} message Catalog * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportProductsResponse.toObject = function toObject(message, options) { + Catalog.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) - object.errorsConfig = null; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.productLevelConfig = null; + object.merchantCenterLinkingConfig = null; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.productLevelConfig != null && message.hasOwnProperty("productLevelConfig")) + object.productLevelConfig = $root.google.cloud.retail.v2alpha.ProductLevelConfig.toObject(message.productLevelConfig, options); + if (message.merchantCenterLinkingConfig != null && message.hasOwnProperty("merchantCenterLinkingConfig")) + object.merchantCenterLinkingConfig = $root.google.cloud.retail.v2alpha.MerchantCenterLinkingConfig.toObject(message.merchantCenterLinkingConfig, options); return object; }; /** - * Converts this ImportProductsResponse to JSON. + * Converts this Catalog to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @instance * @returns {Object.} JSON object */ - ImportProductsResponse.prototype.toJSON = function toJSON() { + Catalog.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportProductsResponse + * Gets the default type url for Catalog * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportProductsResponse + * @memberof google.cloud.retail.v2alpha.Catalog * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Catalog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportProductsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Catalog"; }; - return ImportProductsResponse; + return Catalog; })(); - v2alpha.ImportUserEventsResponse = (function() { + v2alpha.GcsSource = (function() { /** - * Properties of an ImportUserEventsResponse. + * Properties of a GcsSource. * @memberof google.cloud.retail.v2alpha - * @interface IImportUserEventsResponse - * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples - * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig - * @property {google.cloud.retail.v2alpha.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + * @property {string|null} [dataSchema] GcsSource dataSchema */ /** - * Constructs a new ImportUserEventsResponse. + * Constructs a new GcsSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportUserEventsResponse. - * @implements IImportUserEventsResponse + * @classdesc Represents a GcsSource. + * @implements IGcsSource * @constructor - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set */ - function ImportUserEventsResponse(properties) { - this.errorSamples = []; + function GcsSource(properties) { + this.inputUris = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61924,106 +67164,92 @@ } /** - * ImportUserEventsResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse - * @instance - */ - ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; - - /** - * ImportUserEventsResponse errorsConfig. - * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance */ - ImportUserEventsResponse.prototype.errorsConfig = null; + GcsSource.prototype.inputUris = $util.emptyArray; /** - * ImportUserEventsResponse importSummary. - * @member {google.cloud.retail.v2alpha.IUserEventImportSummary|null|undefined} importSummary - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * GcsSource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance */ - ImportUserEventsResponse.prototype.importSummary = null; + GcsSource.prototype.dataSchema = ""; /** - * Creates a new ImportUserEventsResponse instance using the specified properties. + * Creates a new GcsSource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse instance + * @param {google.cloud.retail.v2alpha.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource instance */ - ImportUserEventsResponse.create = function create(properties) { - return new ImportUserEventsResponse(properties); + GcsSource.create = function create(properties) { + return new GcsSource(properties); }; /** - * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encode = function encode(message, writer) { + GcsSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) - $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) - $root.google.cloud.retail.v2alpha.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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]); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSchema); return writer; }; /** - * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GcsSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGcsSource} message GcsSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer. + * Decodes a GcsSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decode = function decode(reader, length) { + 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.retail.v2alpha.ImportUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GcsSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); break; } case 2: { - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.decode(reader, reader.uint32()); + message.dataSchema = reader.string(); break; } default: @@ -62035,168 +67261,148 @@ }; /** - * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a GcsSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + GcsSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportUserEventsResponse message. + * Verifies a GcsSource message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportUserEventsResponse.verify = function verify(message) { + GcsSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); - if (error) - return "errorSamples." + error; - } - } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { - var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); - if (error) - return "errorsConfig." + error; - } - if (message.importSummary != null && message.hasOwnProperty("importSummary")) { - var error = $root.google.cloud.retail.v2alpha.UserEventImportSummary.verify(message.importSummary); - if (error) - return "importSummary." + error; + 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"; } + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; return null; }; /** - * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse + * @returns {google.cloud.retail.v2alpha.GcsSource} GcsSource */ - ImportUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsResponse) + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GcsSource) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); - } - } - if (object.errorsConfig != null) { - if (typeof object.errorsConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorsConfig: object expected"); - message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); - } - if (object.importSummary != null) { - if (typeof object.importSummary !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.importSummary: object expected"); - message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.fromObject(object.importSummary); + var message = new $root.google.cloud.retail.v2alpha.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.retail.v2alpha.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); } + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static - * @param {google.cloud.retail.v2alpha.ImportUserEventsResponse} message ImportUserEventsResponse + * @param {google.cloud.retail.v2alpha.GcsSource} message GcsSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportUserEventsResponse.toObject = function toObject(message, options) { + GcsSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.errorSamples = []; - if (options.defaults) { - object.errorsConfig = null; - object.importSummary = null; - } - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + object.inputUris = []; + if (options.defaults) + object.dataSchema = ""; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; } - if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) - object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); - if (message.importSummary != null && message.hasOwnProperty("importSummary")) - object.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.toObject(message.importSummary, options); + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; return object; }; /** - * Converts this ImportUserEventsResponse to JSON. + * Converts this GcsSource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @instance * @returns {Object.} JSON object */ - ImportUserEventsResponse.prototype.toJSON = function toJSON() { + GcsSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportUserEventsResponse + * Gets the default type url for GcsSource * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse + * @memberof google.cloud.retail.v2alpha.GcsSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportUserEventsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GcsSource"; }; - return ImportUserEventsResponse; + return GcsSource; })(); - v2alpha.UserEventImportSummary = (function() { + v2alpha.BigQuerySource = (function() { /** - * Properties of a UserEventImportSummary. + * Properties of a BigQuerySource. * @memberof google.cloud.retail.v2alpha - * @interface IUserEventImportSummary - * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount - * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount + * @interface IBigQuerySource + * @property {google.type.IDate|null} [partitionDate] BigQuerySource partitionDate + * @property {string|null} [projectId] BigQuerySource projectId + * @property {string|null} [datasetId] BigQuerySource datasetId + * @property {string|null} [tableId] BigQuerySource tableId + * @property {string|null} [gcsStagingDir] BigQuerySource gcsStagingDir + * @property {string|null} [dataSchema] BigQuerySource dataSchema */ /** - * Constructs a new UserEventImportSummary. + * Constructs a new BigQuerySource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEventImportSummary. - * @implements IUserEventImportSummary + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource * @constructor - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set */ - function UserEventImportSummary(properties) { + function BigQuerySource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62204,89 +67410,159 @@ } /** - * UserEventImportSummary joinedEventsCount. - * @member {number|Long} joinedEventsCount - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * BigQuerySource partitionDate. + * @member {google.type.IDate|null|undefined} partitionDate + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance */ - UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + BigQuerySource.prototype.partitionDate = null; /** - * UserEventImportSummary unjoinedEventsCount. - * @member {number|Long} unjoinedEventsCount - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * BigQuerySource projectId. + * @member {string} projectId + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance */ - UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + BigQuerySource.prototype.projectId = ""; /** - * Creates a new UserEventImportSummary instance using the specified properties. + * BigQuerySource datasetId. + * @member {string} datasetId + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.datasetId = ""; + + /** + * BigQuerySource tableId. + * @member {string} tableId + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.tableId = ""; + + /** + * BigQuerySource gcsStagingDir. + * @member {string} gcsStagingDir + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.gcsStagingDir = ""; + + /** + * BigQuerySource dataSchema. + * @member {string} dataSchema + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + BigQuerySource.prototype.dataSchema = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BigQuerySource partition. + * @member {"partitionDate"|undefined} partition + * @memberof google.cloud.retail.v2alpha.BigQuerySource + * @instance + */ + Object.defineProperty(BigQuerySource.prototype, "partition", { + get: $util.oneOfGetter($oneOfFields = ["partitionDate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BigQuerySource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary instance + * @param {google.cloud.retail.v2alpha.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource instance */ - UserEventImportSummary.create = function create(properties) { - return new UserEventImportSummary(properties); + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); }; /** - * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventImportSummary.encode = function encode(message, writer) { + BigQuerySource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); - if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tableId); + if (message.gcsStagingDir != null && Object.hasOwnProperty.call(message, "gcsStagingDir")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsStagingDir); + if (message.dataSchema != null && Object.hasOwnProperty.call(message, "dataSchema")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dataSchema); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.projectId); + if (message.partitionDate != null && Object.hasOwnProperty.call(message, "partitionDate")) + $root.google.type.Date.encode(message.partitionDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BigQuerySource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode + * @param {google.cloud.retail.v2alpha.IBigQuerySource} message BigQuerySource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer. + * Decodes a BigQuerySource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventImportSummary.decode = function decode(reader, length) { + 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.retail.v2alpha.UserEventImportSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: { + message.partitionDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 5: { + message.projectId = reader.string(); + break; + } case 1: { - message.joinedEventsCount = reader.int64(); + message.datasetId = reader.string(); break; } case 2: { - message.unjoinedEventsCount = reader.int64(); + message.tableId = reader.string(); + break; + } + case 3: { + message.gcsStagingDir = reader.string(); + break; + } + case 4: { + message.dataSchema = reader.string(); break; } default: @@ -62298,160 +67574,175 @@ }; /** - * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEventImportSummary message. + * Verifies a BigQuerySource message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEventImportSummary.verify = function verify(message) { + BigQuerySource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) - return "joinedEventsCount: integer|Long expected"; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) - return "unjoinedEventsCount: integer|Long expected"; + var properties = {}; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + properties.partition = 1; + { + var error = $root.google.type.Date.verify(message.partitionDate); + if (error) + return "partitionDate." + error; + } + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + if (!$util.isString(message.gcsStagingDir)) + return "gcsStagingDir: string expected"; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + if (!$util.isString(message.dataSchema)) + return "dataSchema: string expected"; return null; }; /** - * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary + * @returns {google.cloud.retail.v2alpha.BigQuerySource} BigQuerySource */ - UserEventImportSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEventImportSummary) + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BigQuerySource) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); - if (object.joinedEventsCount != null) - if ($util.Long) - (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; - else if (typeof object.joinedEventsCount === "string") - message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); - else if (typeof object.joinedEventsCount === "number") - message.joinedEventsCount = object.joinedEventsCount; - else if (typeof object.joinedEventsCount === "object") - message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); - if (object.unjoinedEventsCount != null) - if ($util.Long) - (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; - else if (typeof object.unjoinedEventsCount === "string") - message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); - else if (typeof object.unjoinedEventsCount === "number") - message.unjoinedEventsCount = object.unjoinedEventsCount; - else if (typeof object.unjoinedEventsCount === "object") - message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.retail.v2alpha.BigQuerySource(); + if (object.partitionDate != null) { + if (typeof object.partitionDate !== "object") + throw TypeError(".google.cloud.retail.v2alpha.BigQuerySource.partitionDate: object expected"); + message.partitionDate = $root.google.type.Date.fromObject(object.partitionDate); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + if (object.gcsStagingDir != null) + message.gcsStagingDir = String(object.gcsStagingDir); + if (object.dataSchema != null) + message.dataSchema = String(object.dataSchema); return message; }; /** - * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static - * @param {google.cloud.retail.v2alpha.UserEventImportSummary} message UserEventImportSummary + * @param {google.cloud.retail.v2alpha.BigQuerySource} message BigQuerySource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEventImportSummary.toObject = function toObject(message, options) { + BigQuerySource.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.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.joinedEventsCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.unjoinedEventsCount = options.longs === String ? "0" : 0; + object.datasetId = ""; + object.tableId = ""; + object.gcsStagingDir = ""; + object.dataSchema = ""; + object.projectId = ""; + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + if (message.gcsStagingDir != null && message.hasOwnProperty("gcsStagingDir")) + object.gcsStagingDir = message.gcsStagingDir; + if (message.dataSchema != null && message.hasOwnProperty("dataSchema")) + object.dataSchema = message.dataSchema; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.partitionDate != null && message.hasOwnProperty("partitionDate")) { + object.partitionDate = $root.google.type.Date.toObject(message.partitionDate, options); + if (options.oneofs) + object.partition = "partitionDate"; } - if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) - if (typeof message.joinedEventsCount === "number") - object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; - else - object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; - if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) - if (typeof message.unjoinedEventsCount === "number") - object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; - else - object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; return object; }; /** - * Converts this UserEventImportSummary to JSON. + * Converts this BigQuerySource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @instance * @returns {Object.} JSON object */ - UserEventImportSummary.prototype.toJSON = function toJSON() { + BigQuerySource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserEventImportSummary + * Gets the default type url for BigQuerySource * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @memberof google.cloud.retail.v2alpha.BigQuerySource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserEventImportSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BigQuerySource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventImportSummary"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.BigQuerySource"; }; - return UserEventImportSummary; + return BigQuerySource; })(); - v2alpha.ImportCompletionDataResponse = (function() { + v2alpha.ProductInlineSource = (function() { /** - * Properties of an ImportCompletionDataResponse. + * Properties of a ProductInlineSource. * @memberof google.cloud.retail.v2alpha - * @interface IImportCompletionDataResponse - * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples + * @interface IProductInlineSource + * @property {Array.|null} [products] ProductInlineSource products */ /** - * Constructs a new ImportCompletionDataResponse. + * Constructs a new ProductInlineSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ImportCompletionDataResponse. - * @implements IImportCompletionDataResponse + * @classdesc Represents a ProductInlineSource. + * @implements IProductInlineSource * @constructor - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set */ - function ImportCompletionDataResponse(properties) { - this.errorSamples = []; + function ProductInlineSource(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62459,78 +67750,78 @@ } /** - * ImportCompletionDataResponse errorSamples. - * @member {Array.} errorSamples - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * ProductInlineSource products. + * @member {Array.} products + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @instance */ - ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; + ProductInlineSource.prototype.products = $util.emptyArray; /** - * Creates a new ImportCompletionDataResponse instance using the specified properties. + * Creates a new ProductInlineSource instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse instance + * @param {google.cloud.retail.v2alpha.IProductInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource instance */ - ImportCompletionDataResponse.create = function create(properties) { - return new ImportCompletionDataResponse(properties); + ProductInlineSource.create = function create(properties) { + return new ProductInlineSource(properties); }; /** - * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified ProductInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encode = function encode(message, writer) { + ProductInlineSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorSamples != null && message.errorSamples.length) - for (var i = 0; i < message.errorSamples.length; ++i) - $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * Encodes the specified ProductInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInlineSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInlineSource} message ProductInlineSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + ProductInlineSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. + * Decodes a ProductInlineSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decode = function decode(reader, length) { + ProductInlineSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.errorSamples && message.errorSamples.length)) - message.errorSamples = []; - message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); break; } default: @@ -62542,186 +67833,140 @@ }; /** - * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. + * Decodes a ProductInlineSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { + ProductInlineSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportCompletionDataResponse message. + * Verifies a ProductInlineSource message. * @function verify - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportCompletionDataResponse.verify = function verify(message) { + ProductInlineSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { - if (!Array.isArray(message.errorSamples)) - return "errorSamples: array expected"; - for (var i = 0; i < message.errorSamples.length; ++i) { - var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); if (error) - return "errorSamples." + error; + return "products." + error; } } return null; }; /** - * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInlineSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse + * @returns {google.cloud.retail.v2alpha.ProductInlineSource} ProductInlineSource */ - ImportCompletionDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse) + ProductInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductInlineSource) return object; - var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); - if (object.errorSamples) { - if (!Array.isArray(object.errorSamples)) - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: array expected"); - message.errorSamples = []; - for (var i = 0; i < object.errorSamples.length; ++i) { - if (typeof object.errorSamples[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: object expected"); - message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + var message = new $root.google.cloud.retail.v2alpha.ProductInlineSource(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInlineSource.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); } } return message; }; /** - * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a ProductInlineSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static - * @param {google.cloud.retail.v2alpha.ImportCompletionDataResponse} message ImportCompletionDataResponse + * @param {google.cloud.retail.v2alpha.ProductInlineSource} message ProductInlineSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportCompletionDataResponse.toObject = function toObject(message, options) { + ProductInlineSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.errorSamples = []; - if (message.errorSamples && message.errorSamples.length) { - object.errorSamples = []; - for (var j = 0; j < message.errorSamples.length; ++j) - object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + object.products = []; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); } return object; }; /** - * Converts this ImportCompletionDataResponse to JSON. + * Converts this ProductInlineSource to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @instance * @returns {Object.} JSON object */ - ImportCompletionDataResponse.prototype.toJSON = function toJSON() { + ProductInlineSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportCompletionDataResponse + * Gets the default type url for ProductInlineSource * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @memberof google.cloud.retail.v2alpha.ProductInlineSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportCompletionDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ProductInlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportCompletionDataResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductInlineSource"; }; - return ImportCompletionDataResponse; + return ProductInlineSource; })(); - v2alpha.Product = (function() { + v2alpha.UserEventInlineSource = (function() { /** - * Properties of a Product. + * Properties of a UserEventInlineSource. * @memberof google.cloud.retail.v2alpha - * @interface IProduct - * @property {google.protobuf.ITimestamp|null} [expireTime] Product expireTime - * @property {google.protobuf.IDuration|null} [ttl] Product ttl - * @property {string|null} [name] Product name - * @property {string|null} [id] Product id - * @property {google.cloud.retail.v2alpha.Product.Type|null} [type] Product type - * @property {string|null} [primaryProductId] Product primaryProductId - * @property {Array.|null} [collectionMemberIds] Product collectionMemberIds - * @property {string|null} [gtin] Product gtin - * @property {Array.|null} [categories] Product categories - * @property {string|null} [title] Product title - * @property {Array.|null} [brands] Product brands - * @property {string|null} [description] Product description - * @property {string|null} [languageCode] Product languageCode - * @property {Object.|null} [attributes] Product attributes - * @property {Array.|null} [tags] Product tags - * @property {google.cloud.retail.v2alpha.IPriceInfo|null} [priceInfo] Product priceInfo - * @property {google.cloud.retail.v2alpha.IRating|null} [rating] Product rating - * @property {google.protobuf.ITimestamp|null} [availableTime] Product availableTime - * @property {google.cloud.retail.v2alpha.Product.Availability|null} [availability] Product availability - * @property {google.protobuf.IInt32Value|null} [availableQuantity] Product availableQuantity - * @property {Array.|null} [fulfillmentInfo] Product fulfillmentInfo - * @property {string|null} [uri] Product uri - * @property {Array.|null} [images] Product images - * @property {google.cloud.retail.v2alpha.IAudience|null} [audience] Product audience - * @property {google.cloud.retail.v2alpha.IColorInfo|null} [colorInfo] Product colorInfo - * @property {Array.|null} [sizes] Product sizes - * @property {Array.|null} [materials] Product materials - * @property {Array.|null} [patterns] Product patterns - * @property {Array.|null} [conditions] Product conditions - * @property {Array.|null} [promotions] Product promotions - * @property {google.protobuf.ITimestamp|null} [publishTime] Product publishTime - * @property {google.protobuf.IFieldMask|null} [retrievableFields] Product retrievableFields - * @property {Array.|null} [variants] Product variants - * @property {Array.|null} [localInventories] Product localInventories + * @interface IUserEventInlineSource + * @property {Array.|null} [userEvents] UserEventInlineSource userEvents */ /** - * Constructs a new Product. + * Constructs a new UserEventInlineSource. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Product. - * @implements IProduct + * @classdesc Represents a UserEventInlineSource. + * @implements IUserEventInlineSource * @constructor - * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set */ - function Product(properties) { - this.collectionMemberIds = []; - this.categories = []; - this.brands = []; - this.attributes = {}; - this.tags = []; - this.fulfillmentInfo = []; - this.images = []; - this.sizes = []; - this.materials = []; - this.patterns = []; - this.conditions = []; - this.promotions = []; - this.variants = []; - this.localInventories = []; + function UserEventInlineSource(properties) { + this.userEvents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62729,612 +67974,624 @@ } /** - * Product expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.retail.v2alpha.Product + * UserEventInlineSource userEvents. + * @member {Array.} userEvents + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @instance */ - Product.prototype.expireTime = null; + UserEventInlineSource.prototype.userEvents = $util.emptyArray; /** - * Product ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a new UserEventInlineSource instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource instance */ - Product.prototype.ttl = null; + UserEventInlineSource.create = function create(properties) { + return new UserEventInlineSource(properties); + }; /** - * Product name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified UserEventInlineSource message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.name = ""; + UserEventInlineSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userEvents != null && message.userEvents.length) + for (var i = 0; i < message.userEvents.length; ++i) + $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Product id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified UserEventInlineSource message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInlineSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2alpha.IUserEventInlineSource} message UserEventInlineSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.id = ""; + UserEventInlineSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product type. - * @member {google.cloud.retail.v2alpha.Product.Type} type - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes a UserEventInlineSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.type = 0; + UserEventInlineSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.userEvents && message.userEvents.length)) + message.userEvents = []; + message.userEvents.push($root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product primaryProductId. - * @member {string} primaryProductId - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes a UserEventInlineSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.primaryProductId = ""; + UserEventInlineSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product collectionMemberIds. - * @member {Array.} collectionMemberIds - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Verifies a UserEventInlineSource message. + * @function verify + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.collectionMemberIds = $util.emptyArray; + UserEventInlineSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userEvents != null && message.hasOwnProperty("userEvents")) { + if (!Array.isArray(message.userEvents)) + return "userEvents: array expected"; + for (var i = 0; i < message.userEvents.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvents[i]); + if (error) + return "userEvents." + error; + } + } + return null; + }; /** - * Product gtin. - * @member {string} gtin - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a UserEventInlineSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.UserEventInlineSource} UserEventInlineSource */ - Product.prototype.gtin = ""; + UserEventInlineSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInlineSource) + return object; + var message = new $root.google.cloud.retail.v2alpha.UserEventInlineSource(); + if (object.userEvents) { + if (!Array.isArray(object.userEvents)) + throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: array expected"); + message.userEvents = []; + for (var i = 0; i < object.userEvents.length; ++i) { + if (typeof object.userEvents[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInlineSource.userEvents: object expected"); + message.userEvents[i] = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvents[i]); + } + } + return message; + }; /** - * Product categories. - * @member {Array.} categories - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a plain object from a UserEventInlineSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {google.cloud.retail.v2alpha.UserEventInlineSource} message UserEventInlineSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.categories = $util.emptyArray; + UserEventInlineSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userEvents = []; + if (message.userEvents && message.userEvents.length) { + object.userEvents = []; + for (var j = 0; j < message.userEvents.length; ++j) + object.userEvents[j] = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvents[j], options); + } + return object; + }; /** - * Product title. - * @member {string} title - * @memberof google.cloud.retail.v2alpha.Product + * Converts this UserEventInlineSource to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource * @instance + * @returns {Object.} JSON object */ - Product.prototype.title = ""; + UserEventInlineSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Product brands. - * @member {Array.} brands - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Gets the default type url for UserEventInlineSource + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.UserEventInlineSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Product.prototype.brands = $util.emptyArray; + UserEventInlineSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventInlineSource"; + }; + + return UserEventInlineSource; + })(); + + v2alpha.ImportErrorsConfig = (function() { /** - * Product description. - * @member {string} description - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Properties of an ImportErrorsConfig. + * @memberof google.cloud.retail.v2alpha + * @interface IImportErrorsConfig + * @property {string|null} [gcsPrefix] ImportErrorsConfig gcsPrefix */ - Product.prototype.description = ""; /** - * Product languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Constructs a new ImportErrorsConfig. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ImportErrorsConfig. + * @implements IImportErrorsConfig + * @constructor + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set */ - Product.prototype.languageCode = ""; + function ImportErrorsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Product attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.Product + * ImportErrorsConfig gcsPrefix. + * @member {string|null|undefined} gcsPrefix + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance */ - Product.prototype.attributes = $util.emptyObject; + ImportErrorsConfig.prototype.gcsPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Product tags. - * @member {Array.} tags - * @memberof google.cloud.retail.v2alpha.Product + * ImportErrorsConfig destination. + * @member {"gcsPrefix"|undefined} destination + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance */ - Product.prototype.tags = $util.emptyArray; + Object.defineProperty(ImportErrorsConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Product priceInfo. - * @member {google.cloud.retail.v2alpha.IPriceInfo|null|undefined} priceInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a new ImportErrorsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig instance */ - Product.prototype.priceInfo = null; + ImportErrorsConfig.create = function create(properties) { + return new ImportErrorsConfig(properties); + }; /** - * Product rating. - * @member {google.cloud.retail.v2alpha.IRating|null|undefined} rating - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ImportErrorsConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.rating = null; + ImportErrorsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPrefix); + return writer; + }; /** - * Product availableTime. - * @member {google.protobuf.ITimestamp|null|undefined} availableTime - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Encodes the specified ImportErrorsConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportErrorsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2alpha.IImportErrorsConfig} message ImportErrorsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Product.prototype.availableTime = null; + ImportErrorsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Product availability. - * @member {google.cloud.retail.v2alpha.Product.Availability} availability - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes an ImportErrorsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.availability = 0; + ImportErrorsConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Product availableQuantity. - * @member {google.protobuf.IInt32Value|null|undefined} availableQuantity - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Decodes an ImportErrorsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.prototype.availableQuantity = null; + ImportErrorsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Product fulfillmentInfo. - * @member {Array.} fulfillmentInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Verifies an ImportErrorsConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.prototype.fulfillmentInfo = $util.emptyArray; + ImportErrorsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.destination = 1; + if (!$util.isString(message.gcsPrefix)) + return "gcsPrefix: string expected"; + } + return null; + }; /** - * Product uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates an ImportErrorsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ImportErrorsConfig} ImportErrorsConfig */ - Product.prototype.uri = ""; + ImportErrorsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportErrorsConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.ImportErrorsConfig(); + if (object.gcsPrefix != null) + message.gcsPrefix = String(object.gcsPrefix); + return message; + }; /** - * Product images. - * @member {Array.} images - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Creates a plain object from an ImportErrorsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {google.cloud.retail.v2alpha.ImportErrorsConfig} message ImportErrorsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Product.prototype.images = $util.emptyArray; + ImportErrorsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = message.gcsPrefix; + if (options.oneofs) + object.destination = "gcsPrefix"; + } + return object; + }; /** - * Product audience. - * @member {google.cloud.retail.v2alpha.IAudience|null|undefined} audience - * @memberof google.cloud.retail.v2alpha.Product + * Converts this ImportErrorsConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig * @instance + * @returns {Object.} JSON object */ - Product.prototype.audience = null; + ImportErrorsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Product colorInfo. - * @member {google.cloud.retail.v2alpha.IColorInfo|null|undefined} colorInfo - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Gets the default type url for ImportErrorsConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ImportErrorsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Product.prototype.colorInfo = null; + ImportErrorsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportErrorsConfig"; + }; + + return ImportErrorsConfig; + })(); + + v2alpha.ImportProductsRequest = (function() { /** - * Product sizes. - * @member {Array.} sizes - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Properties of an ImportProductsRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IImportProductsRequest + * @property {string|null} [parent] ImportProductsRequest parent + * @property {string|null} [requestId] ImportProductsRequest requestId + * @property {google.cloud.retail.v2alpha.IProductInputConfig|null} [inputConfig] ImportProductsRequest inputConfig + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsRequest errorsConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] ImportProductsRequest updateMask + * @property {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode|null} [reconciliationMode] ImportProductsRequest reconciliationMode + * @property {string|null} [notificationPubsubTopic] ImportProductsRequest notificationPubsubTopic + * @property {boolean|null} [skipDefaultBranchProtection] ImportProductsRequest skipDefaultBranchProtection */ - Product.prototype.sizes = $util.emptyArray; /** - * Product materials. - * @member {Array.} materials - * @memberof google.cloud.retail.v2alpha.Product - * @instance + * Constructs a new ImportProductsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ImportProductsRequest. + * @implements IImportProductsRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set */ - Product.prototype.materials = $util.emptyArray; + function ImportProductsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Product patterns. - * @member {Array.} patterns - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.patterns = $util.emptyArray; + ImportProductsRequest.prototype.parent = ""; /** - * Product conditions. - * @member {Array.} conditions - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.conditions = $util.emptyArray; + ImportProductsRequest.prototype.requestId = ""; /** - * Product promotions. - * @member {Array.} promotions - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest inputConfig. + * @member {google.cloud.retail.v2alpha.IProductInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.promotions = $util.emptyArray; + ImportProductsRequest.prototype.inputConfig = null; /** - * Product publishTime. - * @member {google.protobuf.ITimestamp|null|undefined} publishTime - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.publishTime = null; + ImportProductsRequest.prototype.errorsConfig = null; /** - * Product retrievableFields. - * @member {google.protobuf.IFieldMask|null|undefined} retrievableFields - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.retrievableFields = null; + ImportProductsRequest.prototype.updateMask = null; /** - * Product variants. - * @member {Array.} variants - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest reconciliationMode. + * @member {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} reconciliationMode + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.variants = $util.emptyArray; + ImportProductsRequest.prototype.reconciliationMode = 0; /** - * Product localInventories. - * @member {Array.} localInventories - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Product.prototype.localInventories = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ImportProductsRequest.prototype.notificationPubsubTopic = ""; /** - * Product expiration. - * @member {"expireTime"|"ttl"|undefined} expiration - * @memberof google.cloud.retail.v2alpha.Product + * ImportProductsRequest skipDefaultBranchProtection. + * @member {boolean} skipDefaultBranchProtection + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance */ - Object.defineProperty(Product.prototype, "expiration", { - get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), - set: $util.oneOfSetter($oneOfFields) - }); + ImportProductsRequest.prototype.skipDefaultBranchProtection = false; /** - * Creates a new Product instance using the specified properties. + * Creates a new ImportProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IProduct=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Product} Product instance + * @param {google.cloud.retail.v2alpha.IImportProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest instance */ - Product.create = function create(properties) { - return new Product(properties); + ImportProductsRequest.create = function create(properties) { + return new ImportProductsRequest(properties); }; /** - * Encodes the specified Product message. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * Encodes the specified ImportProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encode = function encode(message, writer) { + ImportProductsRequest.encode = function encode(message, writer) { 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.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.primaryProductId != null && Object.hasOwnProperty.call(message, "primaryProductId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.primaryProductId); - if (message.collectionMemberIds != null && message.collectionMemberIds.length) - for (var i = 0; i < message.collectionMemberIds.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.collectionMemberIds[i]); - if (message.gtin != null && Object.hasOwnProperty.call(message, "gtin")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.gtin); - if (message.categories != null && message.categories.length) - for (var i = 0; i < message.categories.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.categories[i]); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.title); - if (message.brands != null && message.brands.length) - for (var i = 0; i < message.brands.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.brands[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.languageCode); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.tags[i]); - if (message.priceInfo != null && Object.hasOwnProperty.call(message, "priceInfo")) - $root.google.cloud.retail.v2alpha.PriceInfo.encode(message.priceInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) - $root.google.cloud.retail.v2alpha.Rating.encode(message.rating, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.availableTime != null && Object.hasOwnProperty.call(message, "availableTime")) - $root.google.protobuf.Timestamp.encode(message.availableTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.availability); - if (message.availableQuantity != null && Object.hasOwnProperty.call(message, "availableQuantity")) - $root.google.protobuf.Int32Value.encode(message.availableQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.fulfillmentInfo != null && message.fulfillmentInfo.length) - for (var i = 0; i < message.fulfillmentInfo.length; ++i) - $root.google.cloud.retail.v2alpha.FulfillmentInfo.encode(message.fulfillmentInfo[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.uri); - if (message.images != null && message.images.length) - for (var i = 0; i < message.images.length; ++i) - $root.google.cloud.retail.v2alpha.Image.encode(message.images[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - $root.google.cloud.retail.v2alpha.Audience.encode(message.audience, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.colorInfo != null && Object.hasOwnProperty.call(message, "colorInfo")) - $root.google.cloud.retail.v2alpha.ColorInfo.encode(message.colorInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.sizes != null && message.sizes.length) - for (var i = 0; i < message.sizes.length; ++i) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.sizes[i]); - if (message.materials != null && message.materials.length) - for (var i = 0; i < message.materials.length; ++i) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.materials[i]); - if (message.patterns != null && message.patterns.length) - for (var i = 0; i < message.patterns.length; ++i) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.patterns[i]); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.conditions[i]); - if (message.retrievableFields != null && Object.hasOwnProperty.call(message, "retrievableFields")) - $root.google.protobuf.FieldMask.encode(message.retrievableFields, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.variants != null && message.variants.length) - for (var i = 0; i < message.variants.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.variants[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime")) - $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.promotions != null && message.promotions.length) - for (var i = 0; i < message.promotions.length; ++i) - $root.google.cloud.retail.v2alpha.Promotion.encode(message.promotions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.localInventories != null && message.localInventories.length) - for (var i = 0; i < message.localInventories.length; ++i) - $root.google.cloud.retail.v2alpha.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.ProductInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reconciliationMode != null && Object.hasOwnProperty.call(message, "reconciliationMode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.reconciliationMode); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.notificationPubsubTopic); + if (message.skipDefaultBranchProtection != null && Object.hasOwnProperty.call(message, "skipDefaultBranchProtection")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.skipDefaultBranchProtection); return writer; }; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Product.verify|verify} messages. + * Encodes the specified ImportProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IProduct} message Product message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} message ImportProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encodeDelimited = function encodeDelimited(message, writer) { + ImportProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes an ImportProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Product} Product + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decode = function decode(reader, length) { + ImportProductsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Product(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 16: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + case 1: { + message.parent = reader.string(); break; } - case 1: { - message.name = reader.string(); + case 6: { + message.requestId = reader.string(); break; } case 2: { - message.id = reader.string(); + message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.decode(reader, reader.uint32()); break; } case 3: { - message.type = reader.int32(); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; } case 4: { - message.primaryProductId = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 5: { - if (!(message.collectionMemberIds && message.collectionMemberIds.length)) - message.collectionMemberIds = []; - message.collectionMemberIds.push(reader.string()); - break; - } - case 6: { - message.gtin = reader.string(); + message.reconciliationMode = reader.int32(); break; } case 7: { - if (!(message.categories && message.categories.length)) - message.categories = []; - message.categories.push(reader.string()); + message.notificationPubsubTopic = reader.string(); break; } case 8: { - message.title = reader.string(); - break; - } - case 9: { - if (!(message.brands && message.brands.length)) - message.brands = []; - message.brands.push(reader.string()); - break; - } - case 10: { - message.description = reader.string(); - break; - } - case 11: { - message.languageCode = reader.string(); - break; - } - case 12: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 13: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 14: { - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.decode(reader, reader.uint32()); - break; - } - case 15: { - message.rating = $root.google.cloud.retail.v2alpha.Rating.decode(reader, reader.uint32()); - break; - } - case 18: { - message.availableTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 19: { - message.availability = reader.int32(); - break; - } - case 20: { - message.availableQuantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); - break; - } - case 21: { - if (!(message.fulfillmentInfo && message.fulfillmentInfo.length)) - message.fulfillmentInfo = []; - message.fulfillmentInfo.push($root.google.cloud.retail.v2alpha.FulfillmentInfo.decode(reader, reader.uint32())); - break; - } - case 22: { - message.uri = reader.string(); - break; - } - case 23: { - if (!(message.images && message.images.length)) - message.images = []; - message.images.push($root.google.cloud.retail.v2alpha.Image.decode(reader, reader.uint32())); - break; - } - case 24: { - message.audience = $root.google.cloud.retail.v2alpha.Audience.decode(reader, reader.uint32()); - break; - } - case 25: { - message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.decode(reader, reader.uint32()); - break; - } - case 26: { - if (!(message.sizes && message.sizes.length)) - message.sizes = []; - message.sizes.push(reader.string()); - break; - } - case 27: { - if (!(message.materials && message.materials.length)) - message.materials = []; - message.materials.push(reader.string()); - break; - } - case 28: { - if (!(message.patterns && message.patterns.length)) - message.patterns = []; - message.patterns.push(reader.string()); - break; - } - case 29: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push(reader.string()); - break; - } - case 34: { - if (!(message.promotions && message.promotions.length)) - message.promotions = []; - message.promotions.push($root.google.cloud.retail.v2alpha.Promotion.decode(reader, reader.uint32())); - break; - } - case 33: { - message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 30: { - message.retrievableFields = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 31: { - if (!(message.variants && message.variants.length)) - message.variants = []; - message.variants.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); - break; - } - case 35: { - if (!(message.localInventories && message.localInventories.length)) - message.localInventories = []; - message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); + message.skipDefaultBranchProtection = reader.bool(); break; } default: @@ -63346,754 +68603,236 @@ }; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Product} Product + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decodeDelimited = function decodeDelimited(reader) { + ImportProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Product message. + * Verifies an ImportProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.verify = function verify(message) { + ImportProductsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - properties.expiration = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - if (properties.expiration === 1) - return "expiration: multiple values"; - properties.expiration = 1; - { - var error = $root.google.protobuf.Duration.verify(message.ttl); - if (error) - return "ttl." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string 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: - break; - } - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - if (!$util.isString(message.primaryProductId)) - return "primaryProductId: string expected"; - if (message.collectionMemberIds != null && message.hasOwnProperty("collectionMemberIds")) { - if (!Array.isArray(message.collectionMemberIds)) - return "collectionMemberIds: array expected"; - for (var i = 0; i < message.collectionMemberIds.length; ++i) - if (!$util.isString(message.collectionMemberIds[i])) - return "collectionMemberIds: string[] expected"; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - if (!$util.isString(message.gtin)) - return "gtin: string expected"; - if (message.categories != null && message.hasOwnProperty("categories")) { - if (!Array.isArray(message.categories)) - return "categories: array expected"; - for (var i = 0; i < message.categories.length; ++i) - if (!$util.isString(message.categories[i])) - return "categories: string[] expected"; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.brands != null && message.hasOwnProperty("brands")) { - if (!Array.isArray(message.brands)) - return "brands: array expected"; - for (var i = 0; i < message.brands.length; ++i) - if (!$util.isString(message.brands[i])) - return "brands: string[] expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - 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"; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) { - var error = $root.google.cloud.retail.v2alpha.PriceInfo.verify(message.priceInfo); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.ProductInputConfig.verify(message.inputConfig); if (error) - return "priceInfo." + error; + return "inputConfig." + error; } - if (message.rating != null && message.hasOwnProperty("rating")) { - var error = $root.google.cloud.retail.v2alpha.Rating.verify(message.rating); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); if (error) - return "rating." + error; + return "errorsConfig." + error; } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.availableTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "availableTime." + error; + return "updateMask." + error; } - if (message.availability != null && message.hasOwnProperty("availability")) - switch (message.availability) { + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + switch (message.reconciliationMode) { default: - return "availability: enum value expected"; + return "reconciliationMode: enum value expected"; case 0: case 1: case 2: - case 3: - case 4: break; } - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.availableQuantity); - if (error) - return "availableQuantity." + error; - } - if (message.fulfillmentInfo != null && message.hasOwnProperty("fulfillmentInfo")) { - if (!Array.isArray(message.fulfillmentInfo)) - return "fulfillmentInfo: array expected"; - for (var i = 0; i < message.fulfillmentInfo.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.FulfillmentInfo.verify(message.fulfillmentInfo[i]); - if (error) - return "fulfillmentInfo." + error; - } - } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.images != null && message.hasOwnProperty("images")) { - if (!Array.isArray(message.images)) - return "images: array expected"; - for (var i = 0; i < message.images.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Image.verify(message.images[i]); - if (error) - return "images." + error; - } - } - if (message.audience != null && message.hasOwnProperty("audience")) { - var error = $root.google.cloud.retail.v2alpha.Audience.verify(message.audience); - if (error) - return "audience." + error; - } - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) { - var error = $root.google.cloud.retail.v2alpha.ColorInfo.verify(message.colorInfo); - if (error) - return "colorInfo." + error; - } - if (message.sizes != null && message.hasOwnProperty("sizes")) { - if (!Array.isArray(message.sizes)) - return "sizes: array expected"; - for (var i = 0; i < message.sizes.length; ++i) - if (!$util.isString(message.sizes[i])) - return "sizes: string[] expected"; - } - if (message.materials != null && message.hasOwnProperty("materials")) { - if (!Array.isArray(message.materials)) - return "materials: array expected"; - for (var i = 0; i < message.materials.length; ++i) - if (!$util.isString(message.materials[i])) - return "materials: string[] expected"; - } - if (message.patterns != null && message.hasOwnProperty("patterns")) { - if (!Array.isArray(message.patterns)) - return "patterns: array expected"; - for (var i = 0; i < message.patterns.length; ++i) - if (!$util.isString(message.patterns[i])) - return "patterns: string[] expected"; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) - if (!$util.isString(message.conditions[i])) - return "conditions: string[] expected"; - } - if (message.promotions != null && message.hasOwnProperty("promotions")) { - if (!Array.isArray(message.promotions)) - return "promotions: array expected"; - for (var i = 0; i < message.promotions.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Promotion.verify(message.promotions[i]); - if (error) - return "promotions." + error; - } - } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.publishTime); - if (error) - return "publishTime." + error; - } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) { - var error = $root.google.protobuf.FieldMask.verify(message.retrievableFields); - if (error) - return "retrievableFields." + error; - } - if (message.variants != null && message.hasOwnProperty("variants")) { - if (!Array.isArray(message.variants)) - return "variants: array expected"; - for (var i = 0; i < message.variants.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.variants[i]); - if (error) - return "variants." + error; - } - } - if (message.localInventories != null && message.hasOwnProperty("localInventories")) { - if (!Array.isArray(message.localInventories)) - return "localInventories: array expected"; - for (var i = 0; i < message.localInventories.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.LocalInventory.verify(message.localInventories[i]); - if (error) - return "localInventories." + error; - } - } + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.skipDefaultBranchProtection != null && message.hasOwnProperty("skipDefaultBranchProtection")) + if (typeof message.skipDefaultBranchProtection !== "boolean") + return "skipDefaultBranchProtection: boolean expected"; return null; }; /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Product} Product + * @returns {google.cloud.retail.v2alpha.ImportProductsRequest} ImportProductsRequest */ - Product.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Product) + ImportProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.Product(); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); - } - if (object.name != null) - message.name = String(object.name); - if (object.id != null) - message.id = String(object.id); - 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 "PRIMARY": - case 1: - message.type = 1; - break; - case "VARIANT": - case 2: - message.type = 2; - break; - case "COLLECTION": - case 3: - message.type = 3; - break; - } - if (object.primaryProductId != null) - message.primaryProductId = String(object.primaryProductId); - if (object.collectionMemberIds) { - if (!Array.isArray(object.collectionMemberIds)) - throw TypeError(".google.cloud.retail.v2alpha.Product.collectionMemberIds: array expected"); - message.collectionMemberIds = []; - for (var i = 0; i < object.collectionMemberIds.length; ++i) - message.collectionMemberIds[i] = String(object.collectionMemberIds[i]); - } - if (object.gtin != null) - message.gtin = String(object.gtin); - if (object.categories) { - if (!Array.isArray(object.categories)) - throw TypeError(".google.cloud.retail.v2alpha.Product.categories: array expected"); - message.categories = []; - for (var i = 0; i < object.categories.length; ++i) - message.categories[i] = String(object.categories[i]); - } - if (object.title != null) - message.title = String(object.title); - if (object.brands) { - if (!Array.isArray(object.brands)) - throw TypeError(".google.cloud.retail.v2alpha.Product.brands: array expected"); - message.brands = []; - for (var i = 0; i < object.brands.length; ++i) - message.brands[i] = String(object.brands[i]); - } - if (object.description != null) - message.description = String(object.description); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.retail.v2alpha.Product.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.priceInfo != null) { - if (typeof object.priceInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.priceInfo: object expected"); - message.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.fromObject(object.priceInfo); + var message = new $root.google.cloud.retail.v2alpha.ImportProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.fromObject(object.inputConfig); } - if (object.rating != null) { - if (typeof object.rating !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.rating: object expected"); - message.rating = $root.google.cloud.retail.v2alpha.Rating.fromObject(object.rating); + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); } - if (object.availableTime != null) { - if (typeof object.availableTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.availableTime: object expected"); - message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - switch (object.availability) { + switch (object.reconciliationMode) { default: - if (typeof object.availability === "number") { - message.availability = object.availability; + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; break; } break; - case "AVAILABILITY_UNSPECIFIED": + case "RECONCILIATION_MODE_UNSPECIFIED": case 0: - message.availability = 0; + message.reconciliationMode = 0; break; - case "IN_STOCK": + case "INCREMENTAL": case 1: - message.availability = 1; + message.reconciliationMode = 1; break; - case "OUT_OF_STOCK": + case "FULL": case 2: - message.availability = 2; - break; - case "PREORDER": - case 3: - message.availability = 3; - break; - case "BACKORDER": - case 4: - message.availability = 4; + message.reconciliationMode = 2; break; } - if (object.availableQuantity != null) { - if (typeof object.availableQuantity !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.availableQuantity: object expected"); - message.availableQuantity = $root.google.protobuf.Int32Value.fromObject(object.availableQuantity); - } - if (object.fulfillmentInfo) { - if (!Array.isArray(object.fulfillmentInfo)) - throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: array expected"); - message.fulfillmentInfo = []; - for (var i = 0; i < object.fulfillmentInfo.length; ++i) { - if (typeof object.fulfillmentInfo[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.fulfillmentInfo: object expected"); - message.fulfillmentInfo[i] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.fromObject(object.fulfillmentInfo[i]); - } - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.images) { - if (!Array.isArray(object.images)) - throw TypeError(".google.cloud.retail.v2alpha.Product.images: array expected"); - message.images = []; - for (var i = 0; i < object.images.length; ++i) { - if (typeof object.images[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.images: object expected"); - message.images[i] = $root.google.cloud.retail.v2alpha.Image.fromObject(object.images[i]); - } - } - if (object.audience != null) { - if (typeof object.audience !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.audience: object expected"); - message.audience = $root.google.cloud.retail.v2alpha.Audience.fromObject(object.audience); - } - if (object.colorInfo != null) { - if (typeof object.colorInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.colorInfo: object expected"); - message.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.fromObject(object.colorInfo); - } - if (object.sizes) { - if (!Array.isArray(object.sizes)) - throw TypeError(".google.cloud.retail.v2alpha.Product.sizes: array expected"); - message.sizes = []; - for (var i = 0; i < object.sizes.length; ++i) - message.sizes[i] = String(object.sizes[i]); - } - if (object.materials) { - if (!Array.isArray(object.materials)) - throw TypeError(".google.cloud.retail.v2alpha.Product.materials: array expected"); - message.materials = []; - for (var i = 0; i < object.materials.length; ++i) - message.materials[i] = String(object.materials[i]); - } - if (object.patterns) { - if (!Array.isArray(object.patterns)) - throw TypeError(".google.cloud.retail.v2alpha.Product.patterns: array expected"); - message.patterns = []; - for (var i = 0; i < object.patterns.length; ++i) - message.patterns[i] = String(object.patterns[i]); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.retail.v2alpha.Product.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) - message.conditions[i] = String(object.conditions[i]); - } - if (object.promotions) { - if (!Array.isArray(object.promotions)) - throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: array expected"); - message.promotions = []; - for (var i = 0; i < object.promotions.length; ++i) { - if (typeof object.promotions[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.promotions: object expected"); - message.promotions[i] = $root.google.cloud.retail.v2alpha.Promotion.fromObject(object.promotions[i]); - } - } - if (object.publishTime != null) { - if (typeof object.publishTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.publishTime: object expected"); - message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime); - } - if (object.retrievableFields != null) { - if (typeof object.retrievableFields !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.retrievableFields: object expected"); - message.retrievableFields = $root.google.protobuf.FieldMask.fromObject(object.retrievableFields); - } - if (object.variants) { - if (!Array.isArray(object.variants)) - throw TypeError(".google.cloud.retail.v2alpha.Product.variants: array expected"); - message.variants = []; - for (var i = 0; i < object.variants.length; ++i) { - if (typeof object.variants[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.variants: object expected"); - message.variants[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.variants[i]); - } - } - if (object.localInventories) { - if (!Array.isArray(object.localInventories)) - throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: array expected"); - message.localInventories = []; - for (var i = 0; i < object.localInventories.length; ++i) { - if (typeof object.localInventories[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Product.localInventories: object expected"); - message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); - } - } + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.skipDefaultBranchProtection != null) + message.skipDefaultBranchProtection = Boolean(object.skipDefaultBranchProtection); return message; }; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. + * Creates a plain object from an ImportProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static - * @param {google.cloud.retail.v2alpha.Product} message Product + * @param {google.cloud.retail.v2alpha.ImportProductsRequest} message ImportProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Product.toObject = function toObject(message, options) { + ImportProductsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionMemberIds = []; - object.categories = []; - object.brands = []; - object.tags = []; - object.fulfillmentInfo = []; - object.images = []; - object.sizes = []; - object.materials = []; - object.patterns = []; - object.conditions = []; - object.variants = []; - object.promotions = []; - object.localInventories = []; - } - if (options.objects || options.defaults) - object.attributes = {}; if (options.defaults) { - object.name = ""; - object.id = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.primaryProductId = ""; - object.gtin = ""; - object.title = ""; - object.description = ""; - object.languageCode = ""; - object.priceInfo = null; - object.rating = null; - object.availableTime = null; - object.availability = options.enums === String ? "AVAILABILITY_UNSPECIFIED" : 0; - object.availableQuantity = null; - object.uri = ""; - object.audience = null; - object.colorInfo = null; - object.retrievableFields = null; - object.publishTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; - if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) - object.primaryProductId = message.primaryProductId; - if (message.collectionMemberIds && message.collectionMemberIds.length) { - object.collectionMemberIds = []; - for (var j = 0; j < message.collectionMemberIds.length; ++j) - object.collectionMemberIds[j] = message.collectionMemberIds[j]; - } - if (message.gtin != null && message.hasOwnProperty("gtin")) - object.gtin = message.gtin; - if (message.categories && message.categories.length) { - object.categories = []; - for (var j = 0; j < message.categories.length; ++j) - object.categories[j] = message.categories[j]; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.brands && message.brands.length) { - object.brands = []; - for (var j = 0; j < message.brands.length; ++j) - object.brands[j] = message.brands[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.priceInfo != null && message.hasOwnProperty("priceInfo")) - object.priceInfo = $root.google.cloud.retail.v2alpha.PriceInfo.toObject(message.priceInfo, options); - if (message.rating != null && message.hasOwnProperty("rating")) - object.rating = $root.google.cloud.retail.v2alpha.Rating.toObject(message.rating, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (options.oneofs) - object.expiration = "expireTime"; - } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - if (options.oneofs) - object.expiration = "ttl"; - } - if (message.availableTime != null && message.hasOwnProperty("availableTime")) - object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); - if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] === undefined ? message.availability : $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; - if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) - object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); - if (message.fulfillmentInfo && message.fulfillmentInfo.length) { - object.fulfillmentInfo = []; - for (var j = 0; j < message.fulfillmentInfo.length; ++j) - object.fulfillmentInfo[j] = $root.google.cloud.retail.v2alpha.FulfillmentInfo.toObject(message.fulfillmentInfo[j], options); - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.images && message.images.length) { - object.images = []; - for (var j = 0; j < message.images.length; ++j) - object.images[j] = $root.google.cloud.retail.v2alpha.Image.toObject(message.images[j], options); - } - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = $root.google.cloud.retail.v2alpha.Audience.toObject(message.audience, options); - if (message.colorInfo != null && message.hasOwnProperty("colorInfo")) - object.colorInfo = $root.google.cloud.retail.v2alpha.ColorInfo.toObject(message.colorInfo, options); - if (message.sizes && message.sizes.length) { - object.sizes = []; - for (var j = 0; j < message.sizes.length; ++j) - object.sizes[j] = message.sizes[j]; - } - if (message.materials && message.materials.length) { - object.materials = []; - for (var j = 0; j < message.materials.length; ++j) - object.materials[j] = message.materials[j]; - } - if (message.patterns && message.patterns.length) { - object.patterns = []; - for (var j = 0; j < message.patterns.length; ++j) - object.patterns[j] = message.patterns[j]; - } - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = message.conditions[j]; - } - if (message.retrievableFields != null && message.hasOwnProperty("retrievableFields")) - object.retrievableFields = $root.google.protobuf.FieldMask.toObject(message.retrievableFields, options); - if (message.variants && message.variants.length) { - object.variants = []; - for (var j = 0; j < message.variants.length; ++j) - object.variants[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.variants[j], options); - } - if (message.publishTime != null && message.hasOwnProperty("publishTime")) - object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options); - if (message.promotions && message.promotions.length) { - object.promotions = []; - for (var j = 0; j < message.promotions.length; ++j) - object.promotions[j] = $root.google.cloud.retail.v2alpha.Promotion.toObject(message.promotions[j], options); - } - if (message.localInventories && message.localInventories.length) { - object.localInventories = []; - for (var j = 0; j < message.localInventories.length; ++j) - object.localInventories[j] = $root.google.cloud.retail.v2alpha.LocalInventory.toObject(message.localInventories[j], options); + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; + object.updateMask = null; + object.reconciliationMode = options.enums === String ? "RECONCILIATION_MODE_UNSPECIFIED" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; + object.skipDefaultBranchProtection = false; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.ProductInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.skipDefaultBranchProtection != null && message.hasOwnProperty("skipDefaultBranchProtection")) + object.skipDefaultBranchProtection = message.skipDefaultBranchProtection; return object; }; /** - * Converts this Product to JSON. + * Converts this ImportProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @instance * @returns {Object.} JSON object */ - Product.prototype.toJSON = function toJSON() { + ImportProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Product + * Gets the default type url for ImportProductsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Product + * @memberof google.cloud.retail.v2alpha.ImportProductsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Product"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportProductsRequest"; }; /** - * Type enum. - * @name google.cloud.retail.v2alpha.Product.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PRIMARY=1 PRIMARY value - * @property {number} VARIANT=2 VARIANT value - * @property {number} COLLECTION=3 COLLECTION value - */ - Product.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIMARY"] = 1; - values[valuesById[2] = "VARIANT"] = 2; - values[valuesById[3] = "COLLECTION"] = 3; - return values; - })(); - - /** - * Availability enum. - * @name google.cloud.retail.v2alpha.Product.Availability + * ReconciliationMode enum. + * @name google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode * @enum {number} - * @property {number} AVAILABILITY_UNSPECIFIED=0 AVAILABILITY_UNSPECIFIED value - * @property {number} IN_STOCK=1 IN_STOCK value - * @property {number} OUT_OF_STOCK=2 OUT_OF_STOCK value - * @property {number} PREORDER=3 PREORDER value - * @property {number} BACKORDER=4 BACKORDER value + * @property {number} RECONCILIATION_MODE_UNSPECIFIED=0 RECONCILIATION_MODE_UNSPECIFIED value + * @property {number} INCREMENTAL=1 INCREMENTAL value + * @property {number} FULL=2 FULL value */ - Product.Availability = (function() { + ImportProductsRequest.ReconciliationMode = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AVAILABILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "IN_STOCK"] = 1; - values[valuesById[2] = "OUT_OF_STOCK"] = 2; - values[valuesById[3] = "PREORDER"] = 3; - values[valuesById[4] = "BACKORDER"] = 4; + values[valuesById[0] = "RECONCILIATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCREMENTAL"] = 1; + values[valuesById[2] = "FULL"] = 2; return values; })(); - return Product; + return ImportProductsRequest; })(); - v2alpha.Promotion = (function() { + v2alpha.ImportUserEventsRequest = (function() { /** - * Properties of a Promotion. + * Properties of an ImportUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPromotion - * @property {string|null} [promotionId] Promotion promotionId + * @interface IImportUserEventsRequest + * @property {string|null} [parent] ImportUserEventsRequest parent + * @property {google.cloud.retail.v2alpha.IUserEventInputConfig|null} [inputConfig] ImportUserEventsRequest inputConfig + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsRequest errorsConfig */ /** - * Constructs a new Promotion. + * Constructs a new ImportUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Promotion. - * @implements IPromotion + * @classdesc Represents an ImportUserEventsRequest. + * @implements IImportUserEventsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set */ - function Promotion(properties) { + function ImportUserEventsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64101,75 +68840,103 @@ } /** - * Promotion promotionId. - * @member {string} promotionId - * @memberof google.cloud.retail.v2alpha.Promotion + * ImportUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @instance */ - Promotion.prototype.promotionId = ""; + ImportUserEventsRequest.prototype.parent = ""; /** - * Creates a new Promotion instance using the specified properties. + * ImportUserEventsRequest inputConfig. + * @member {google.cloud.retail.v2alpha.IUserEventInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.inputConfig = null; + + /** + * ImportUserEventsRequest errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest + * @instance + */ + ImportUserEventsRequest.prototype.errorsConfig = null; + + /** + * Creates a new ImportUserEventsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IPromotion=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest instance */ - Promotion.create = function create(properties) { - return new Promotion(properties); + ImportUserEventsRequest.create = function create(properties) { + return new ImportUserEventsRequest(properties); }; /** - * Encodes the specified Promotion message. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encode = function encode(message, writer) { + ImportUserEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.promotionId != null && Object.hasOwnProperty.call(message, "promotionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.promotionId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.UserEventInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Promotion message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Promotion.verify|verify} messages. + * Encodes the specified ImportUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IPromotion} message Promotion message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsRequest} message ImportUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Promotion.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Promotion message from the specified reader or buffer. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decode = function decode(reader, length) { + ImportUserEventsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Promotion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.promotionId = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; } default: @@ -64181,146 +68948,151 @@ }; /** - * Decodes a Promotion message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Promotion.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Promotion message. + * Verifies an ImportUserEventsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Promotion.verify = function verify(message) { + ImportUserEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - if (!$util.isString(message.promotionId)) - return "promotionId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.UserEventInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } return null; }; /** - * Creates a Promotion message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Promotion} Promotion + * @returns {google.cloud.retail.v2alpha.ImportUserEventsRequest} ImportUserEventsRequest */ - Promotion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Promotion) + ImportUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.Promotion(); - if (object.promotionId != null) - message.promotionId = String(object.promotionId); + var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.fromObject(object.inputConfig); + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsRequest.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + } return message; }; /** - * Creates a plain object from a Promotion message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.Promotion} message Promotion + * @param {google.cloud.retail.v2alpha.ImportUserEventsRequest} message ImportUserEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Promotion.toObject = function toObject(message, options) { + ImportUserEventsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.promotionId = ""; - if (message.promotionId != null && message.hasOwnProperty("promotionId")) - object.promotionId = message.promotionId; + if (options.defaults) { + object.parent = ""; + object.inputConfig = null; + object.errorsConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.UserEventInputConfig.toObject(message.inputConfig, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this Promotion to JSON. + * Converts this ImportUserEventsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @instance * @returns {Object.} JSON object */ - Promotion.prototype.toJSON = function toJSON() { + ImportUserEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Promotion + * Gets the default type url for ImportUserEventsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Promotion + * @memberof google.cloud.retail.v2alpha.ImportUserEventsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Promotion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Promotion"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportUserEventsRequest"; }; - return Promotion; + return ImportUserEventsRequest; })(); - v2alpha.UserEvent = (function() { + v2alpha.ImportCompletionDataRequest = (function() { /** - * Properties of a UserEvent. + * Properties of an ImportCompletionDataRequest. * @memberof google.cloud.retail.v2alpha - * @interface IUserEvent - * @property {string|null} [eventType] UserEvent eventType - * @property {string|null} [visitorId] UserEvent visitorId - * @property {string|null} [sessionId] UserEvent sessionId - * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime - * @property {Array.|null} [experimentIds] UserEvent experimentIds - * @property {string|null} [attributionToken] UserEvent attributionToken - * @property {Array.|null} [productDetails] UserEvent productDetails - * @property {google.cloud.retail.v2alpha.ICompletionDetail|null} [completionDetail] UserEvent completionDetail - * @property {Object.|null} [attributes] UserEvent attributes - * @property {string|null} [cartId] UserEvent cartId - * @property {google.cloud.retail.v2alpha.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction - * @property {string|null} [searchQuery] UserEvent searchQuery - * @property {string|null} [filter] UserEvent filter - * @property {string|null} [orderBy] UserEvent orderBy - * @property {number|null} [offset] UserEvent offset - * @property {Array.|null} [pageCategories] UserEvent pageCategories - * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] UserEvent userInfo - * @property {string|null} [uri] UserEvent uri - * @property {string|null} [referrerUri] UserEvent referrerUri - * @property {string|null} [pageViewId] UserEvent pageViewId - * @property {string|null} [entity] UserEvent entity + * @interface IImportCompletionDataRequest + * @property {string|null} [parent] ImportCompletionDataRequest parent + * @property {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null} [inputConfig] ImportCompletionDataRequest inputConfig + * @property {string|null} [notificationPubsubTopic] ImportCompletionDataRequest notificationPubsubTopic */ /** - * Constructs a new UserEvent. + * Constructs a new ImportCompletionDataRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a UserEvent. - * @implements IUserEvent + * @classdesc Represents an ImportCompletionDataRequest. + * @implements IImportCompletionDataRequest * @constructor - * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set */ - function UserEvent(properties) { - this.experimentIds = []; - this.productDetails = []; - this.attributes = {}; - this.pageCategories = []; + function ImportCompletionDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64328,386 +69100,103 @@ } /** - * UserEvent eventType. - * @member {string} eventType - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportCompletionDataRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - UserEvent.prototype.eventType = ""; + ImportCompletionDataRequest.prototype.parent = ""; /** - * UserEvent visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportCompletionDataRequest inputConfig. + * @member {google.cloud.retail.v2alpha.ICompletionDataInputConfig|null|undefined} inputConfig + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - UserEvent.prototype.visitorId = ""; + ImportCompletionDataRequest.prototype.inputConfig = null; /** - * UserEvent sessionId. - * @member {string} sessionId - * @memberof google.cloud.retail.v2alpha.UserEvent + * ImportCompletionDataRequest notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance */ - UserEvent.prototype.sessionId = ""; + ImportCompletionDataRequest.prototype.notificationPubsubTopic = ""; /** - * UserEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.eventTime = null; - - /** - * UserEvent experimentIds. - * @member {Array.} experimentIds - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.experimentIds = $util.emptyArray; - - /** - * UserEvent attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.attributionToken = ""; - - /** - * UserEvent productDetails. - * @member {Array.} productDetails - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.productDetails = $util.emptyArray; - - /** - * UserEvent completionDetail. - * @member {google.cloud.retail.v2alpha.ICompletionDetail|null|undefined} completionDetail - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.completionDetail = null; - - /** - * UserEvent attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.attributes = $util.emptyObject; - - /** - * UserEvent cartId. - * @member {string} cartId - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.cartId = ""; - - /** - * UserEvent purchaseTransaction. - * @member {google.cloud.retail.v2alpha.IPurchaseTransaction|null|undefined} purchaseTransaction - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.purchaseTransaction = null; - - /** - * UserEvent searchQuery. - * @member {string} searchQuery - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.searchQuery = ""; - - /** - * UserEvent filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.filter = ""; - - /** - * UserEvent orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.orderBy = ""; - - /** - * UserEvent offset. - * @member {number} offset - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.offset = 0; - - /** - * UserEvent pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.pageCategories = $util.emptyArray; - - /** - * UserEvent userInfo. - * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.userInfo = null; - - /** - * UserEvent uri. - * @member {string} uri - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.uri = ""; - - /** - * UserEvent referrerUri. - * @member {string} referrerUri - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.referrerUri = ""; - - /** - * UserEvent pageViewId. - * @member {string} pageViewId - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.pageViewId = ""; - - /** - * UserEvent entity. - * @member {string} entity - * @memberof google.cloud.retail.v2alpha.UserEvent - * @instance - */ - UserEvent.prototype.entity = ""; - - /** - * Creates a new UserEvent instance using the specified properties. + * Creates a new ImportCompletionDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest instance */ - UserEvent.create = function create(properties) { - return new UserEvent(properties); + ImportCompletionDataRequest.create = function create(properties) { + return new ImportCompletionDataRequest(properties); }; /** - * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * Encodes the specified ImportCompletionDataRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encode = function encode(message, writer) { + ImportCompletionDataRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.experimentIds != null && message.experimentIds.length) - for (var i = 0; i < message.experimentIds.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.productDetails != null && message.productDetails.length) - for (var i = 0; i < message.productDetails.length; ++i) - $root.google.cloud.retail.v2alpha.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); - if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) - $root.google.cloud.retail.v2alpha.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); - if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); - if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); - if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) - $root.google.cloud.retail.v2alpha.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.entity); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.encode(message.inputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.notificationPubsubTopic); return writer; }; /** - * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. + * Encodes the specified ImportCompletionDataRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static - * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} message ImportCompletionDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserEvent.encodeDelimited = function encodeDelimited(message, writer) { + ImportCompletionDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserEvent message from the specified reader or buffer. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decode = function decode(reader, length) { + ImportCompletionDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEvent(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.eventType = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.visitorId = reader.string(); - break; - } - case 21: { - message.sessionId = reader.string(); + message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.decode(reader, reader.uint32()); break; } case 3: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.experimentIds && message.experimentIds.length)) - message.experimentIds = []; - message.experimentIds.push(reader.string()); - break; - } - case 5: { - message.attributionToken = reader.string(); - break; - } - case 6: { - if (!(message.productDetails && message.productDetails.length)) - message.productDetails = []; - message.productDetails.push($root.google.cloud.retail.v2alpha.ProductDetail.decode(reader, reader.uint32())); - break; - } - case 22: { - message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.decode(reader, reader.uint32()); - break; - } - case 7: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 8: { - message.cartId = reader.string(); - break; - } - case 9: { - message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.decode(reader, reader.uint32()); - break; - } - case 10: { - message.searchQuery = reader.string(); - break; - } - case 16: { - message.filter = reader.string(); - break; - } - case 17: { - message.orderBy = reader.string(); - break; - } - case 18: { - message.offset = reader.int32(); - break; - } - case 11: { - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); - break; - } - case 12: { - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); - break; - } - case 13: { - message.uri = reader.string(); - break; - } - case 14: { - message.referrerUri = reader.string(); - break; - } - case 15: { - message.pageViewId = reader.string(); - break; - } - case 23: { - message.entity = reader.string(); + message.notificationPubsubTopic = reader.string(); break; } default: @@ -64719,367 +69208,146 @@ }; /** - * Decodes a UserEvent message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserEvent.decodeDelimited = function decodeDelimited(reader) { + ImportCompletionDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserEvent message. + * Verifies an ImportCompletionDataRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserEvent.verify = function verify(message) { + ImportCompletionDataRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.eventType != null && message.hasOwnProperty("eventType")) - if (!$util.isString(message.eventType)) - return "eventType: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { - if (!Array.isArray(message.experimentIds)) - return "experimentIds: array expected"; - for (var i = 0; i < message.experimentIds.length; ++i) - if (!$util.isString(message.experimentIds[i])) - return "experimentIds: string[] expected"; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.productDetails != null && message.hasOwnProperty("productDetails")) { - if (!Array.isArray(message.productDetails)) - return "productDetails: array expected"; - for (var i = 0; i < message.productDetails.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.ProductDetail.verify(message.productDetails[i]); - if (error) - return "productDetails." + error; - } - } - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { - var error = $root.google.cloud.retail.v2alpha.CompletionDetail.verify(message.completionDetail); - if (error) - return "completionDetail." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.cartId != null && message.hasOwnProperty("cartId")) - if (!$util.isString(message.cartId)) - return "cartId: string expected"; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { - var error = $root.google.cloud.retail.v2alpha.PurchaseTransaction.verify(message.purchaseTransaction); - if (error) - return "purchaseTransaction." + error; - } - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - if (!$util.isString(message.searchQuery)) - return "searchQuery: 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.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; - } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.verify(message.inputConfig); if (error) - return "userInfo." + error; + return "inputConfig." + error; } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - if (!$util.isString(message.referrerUri)) - return "referrerUri: string expected"; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - if (!$util.isString(message.pageViewId)) - return "pageViewId: string expected"; - if (message.entity != null && message.hasOwnProperty("entity")) - if (!$util.isString(message.entity)) - return "entity: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; return null; }; /** - * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataRequest} ImportCompletionDataRequest */ - UserEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UserEvent) + ImportCompletionDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.UserEvent(); - if (object.eventType != null) - message.eventType = String(object.eventType); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.experimentIds) { - if (!Array.isArray(object.experimentIds)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.experimentIds: array expected"); - message.experimentIds = []; - for (var i = 0; i < object.experimentIds.length; ++i) - message.experimentIds[i] = String(object.experimentIds[i]); - } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.productDetails) { - if (!Array.isArray(object.productDetails)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: array expected"); - message.productDetails = []; - for (var i = 0; i < object.productDetails.length; ++i) { - if (typeof object.productDetails[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: object expected"); - message.productDetails[i] = $root.google.cloud.retail.v2alpha.ProductDetail.fromObject(object.productDetails[i]); - } - } - if (object.completionDetail != null) { - if (typeof object.completionDetail !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.completionDetail: object expected"); - message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.fromObject(object.completionDetail); - } - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - if (object.cartId != null) - message.cartId = String(object.cartId); - if (object.purchaseTransaction != null) { - if (typeof object.purchaseTransaction !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.purchaseTransaction: object expected"); - message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.fromObject(object.purchaseTransaction); - } - if (object.searchQuery != null) - message.searchQuery = String(object.searchQuery); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); - } - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UserEvent.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.fromObject(object.inputConfig); } - if (object.uri != null) - message.uri = String(object.uri); - if (object.referrerUri != null) - message.referrerUri = String(object.referrerUri); - if (object.pageViewId != null) - message.pageViewId = String(object.pageViewId); - if (object.entity != null) - message.entity = String(object.entity); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); return message; }; /** - * Creates a plain object from a UserEvent message. Also converts values to other types if specified. + * Creates a plain object from an ImportCompletionDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static - * @param {google.cloud.retail.v2alpha.UserEvent} message UserEvent + * @param {google.cloud.retail.v2alpha.ImportCompletionDataRequest} message ImportCompletionDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserEvent.toObject = function toObject(message, options) { + ImportCompletionDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.experimentIds = []; - object.productDetails = []; - object.pageCategories = []; - } - if (options.objects || options.defaults) - object.attributes = {}; if (options.defaults) { - object.eventType = ""; - object.visitorId = ""; - object.eventTime = null; - object.attributionToken = ""; - object.cartId = ""; - object.purchaseTransaction = null; - object.searchQuery = ""; - object.userInfo = null; - object.uri = ""; - object.referrerUri = ""; - object.pageViewId = ""; - object.filter = ""; - object.orderBy = ""; - object.offset = 0; - object.sessionId = ""; - object.completionDetail = null; - object.entity = ""; - } - if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = message.eventType; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.experimentIds && message.experimentIds.length) { - object.experimentIds = []; - for (var j = 0; j < message.experimentIds.length; ++j) - object.experimentIds[j] = message.experimentIds[j]; - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.productDetails && message.productDetails.length) { - object.productDetails = []; - for (var j = 0; j < message.productDetails.length; ++j) - object.productDetails[j] = $root.google.cloud.retail.v2alpha.ProductDetail.toObject(message.productDetails[j], options); - } - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.cartId != null && message.hasOwnProperty("cartId")) - object.cartId = message.cartId; - if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) - object.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.toObject(message.purchaseTransaction, options); - if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) - object.searchQuery = message.searchQuery; - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; + object.parent = ""; + object.inputConfig = null; + object.notificationPubsubTopic = ""; } - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) - object.referrerUri = message.referrerUri; - if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) - object.pageViewId = message.pageViewId; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) - object.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.toObject(message.completionDetail, options); - if (message.entity != null && message.hasOwnProperty("entity")) - object.entity = message.entity; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.retail.v2alpha.CompletionDataInputConfig.toObject(message.inputConfig, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; return object; }; /** - * Converts this UserEvent to JSON. + * Converts this ImportCompletionDataRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @instance * @returns {Object.} JSON object */ - UserEvent.prototype.toJSON = function toJSON() { + ImportCompletionDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserEvent + * Gets the default type url for ImportCompletionDataRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UserEvent + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportCompletionDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEvent"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportCompletionDataRequest"; }; - return UserEvent; + return ImportCompletionDataRequest; })(); - v2alpha.ProductDetail = (function() { + v2alpha.ProductInputConfig = (function() { /** - * Properties of a ProductDetail. + * Properties of a ProductInputConfig. * @memberof google.cloud.retail.v2alpha - * @interface IProductDetail - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] ProductDetail product - * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity + * @interface IProductInputConfig + * @property {google.cloud.retail.v2alpha.IProductInlineSource|null} [productInlineSource] ProductInputConfig productInlineSource + * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] ProductInputConfig gcsSource + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] ProductInputConfig bigQuerySource */ /** - * Constructs a new ProductDetail. + * Constructs a new ProductInputConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductDetail. - * @implements IProductDetail + * @classdesc Represents a ProductInputConfig. + * @implements IProductInputConfig * @constructor - * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set */ - function ProductDetail(properties) { + function ProductInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65087,89 +69355,117 @@ } /** - * ProductDetail product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.ProductDetail + * ProductInputConfig productInlineSource. + * @member {google.cloud.retail.v2alpha.IProductInlineSource|null|undefined} productInlineSource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - ProductDetail.prototype.product = null; + ProductInputConfig.prototype.productInlineSource = null; /** - * ProductDetail quantity. - * @member {google.protobuf.IInt32Value|null|undefined} quantity - * @memberof google.cloud.retail.v2alpha.ProductDetail + * ProductInputConfig gcsSource. + * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance */ - ProductDetail.prototype.quantity = null; + ProductInputConfig.prototype.gcsSource = null; /** - * Creates a new ProductDetail instance using the specified properties. + * ProductInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @instance + */ + ProductInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProductInputConfig source. + * @member {"productInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.ProductInputConfig + * @instance + */ + Object.defineProperty(ProductInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["productInlineSource", "gcsSource", "bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProductInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail instance + * @param {google.cloud.retail.v2alpha.IProductInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig instance */ - ProductDetail.create = function create(properties) { - return new ProductDetail(properties); + ProductInputConfig.create = function create(properties) { + return new ProductInputConfig(properties); }; /** - * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * Encodes the specified ProductInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductDetail.encode = function encode(message, writer) { + ProductInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) - $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productInlineSource != null && Object.hasOwnProperty.call(message, "productInlineSource")) + $root.google.cloud.retail.v2alpha.ProductInlineSource.encode(message.productInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. + * Encodes the specified ProductInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static - * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductInputConfig} message ProductInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { + ProductInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductDetail message from the specified reader or buffer. + * Decodes a ProductInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductDetail.decode = function decode(reader, length) { + ProductInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductDetail(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.decode(reader, reader.uint32()); break; } case 2: { - message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); break; } default: @@ -65181,143 +69477,174 @@ }; /** - * Decodes a ProductDetail message from the specified reader or buffer, length delimited. + * Decodes a ProductInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductDetail.decodeDelimited = function decodeDelimited(reader) { + ProductInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductDetail message. + * Verifies a ProductInputConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductDetail.verify = function verify(message) { + ProductInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; + var properties = {}; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.ProductInlineSource.verify(message.productInlineSource); + if (error) + return "productInlineSource." + error; + } } - if (message.quantity != null && message.hasOwnProperty("quantity")) { - var error = $root.google.protobuf.Int32Value.verify(message.quantity); - if (error) - return "quantity." + error; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.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.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } } return null; }; /** - * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. + * Creates a ProductInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail + * @returns {google.cloud.retail.v2alpha.ProductInputConfig} ProductInputConfig */ - ProductDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ProductDetail) + ProductInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductInputConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.ProductDetail(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + var message = new $root.google.cloud.retail.v2alpha.ProductInputConfig(); + if (object.productInlineSource != null) { + if (typeof object.productInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.productInlineSource: object expected"); + message.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.fromObject(object.productInlineSource); } - if (object.quantity != null) { - if (typeof object.quantity !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.quantity: object expected"); - message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); } return message; }; /** - * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. + * Creates a plain object from a ProductInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static - * @param {google.cloud.retail.v2alpha.ProductDetail} message ProductDetail + * @param {google.cloud.retail.v2alpha.ProductInputConfig} message ProductInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductDetail.toObject = function toObject(message, options) { + ProductInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.product = null; - object.quantity = null; + if (message.productInlineSource != null && message.hasOwnProperty("productInlineSource")) { + object.productInlineSource = $root.google.cloud.retail.v2alpha.ProductInlineSource.toObject(message.productInlineSource, options); + if (options.oneofs) + object.source = "productInlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.quantity != null && message.hasOwnProperty("quantity")) - object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); return object; }; /** - * Converts this ProductDetail to JSON. + * Converts this ProductInputConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @instance * @returns {Object.} JSON object */ - ProductDetail.prototype.toJSON = function toJSON() { + ProductInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ProductDetail + * Gets the default type url for ProductInputConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ProductDetail + * @memberof google.cloud.retail.v2alpha.ProductInputConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ProductDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ProductInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductDetail"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductInputConfig"; }; - return ProductDetail; + return ProductInputConfig; })(); - v2alpha.CompletionDetail = (function() { + v2alpha.UserEventInputConfig = (function() { /** - * Properties of a CompletionDetail. + * Properties of a UserEventInputConfig. * @memberof google.cloud.retail.v2alpha - * @interface ICompletionDetail - * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken - * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion - * @property {number|null} [selectedPosition] CompletionDetail selectedPosition + * @interface IUserEventInputConfig + * @property {google.cloud.retail.v2alpha.IUserEventInlineSource|null} [userEventInlineSource] UserEventInputConfig userEventInlineSource + * @property {google.cloud.retail.v2alpha.IGcsSource|null} [gcsSource] UserEventInputConfig gcsSource + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] UserEventInputConfig bigQuerySource */ /** - * Constructs a new CompletionDetail. + * Constructs a new UserEventInputConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionDetail. - * @implements ICompletionDetail + * @classdesc Represents a UserEventInputConfig. + * @implements IUserEventInputConfig * @constructor - * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set */ - function CompletionDetail(properties) { + function UserEventInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65325,103 +69652,117 @@ } /** - * CompletionDetail completionAttributionToken. - * @member {string} completionAttributionToken - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * UserEventInputConfig userEventInlineSource. + * @member {google.cloud.retail.v2alpha.IUserEventInlineSource|null|undefined} userEventInlineSource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - CompletionDetail.prototype.completionAttributionToken = ""; + UserEventInputConfig.prototype.userEventInlineSource = null; /** - * CompletionDetail selectedSuggestion. - * @member {string} selectedSuggestion - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * UserEventInputConfig gcsSource. + * @member {google.cloud.retail.v2alpha.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - CompletionDetail.prototype.selectedSuggestion = ""; + UserEventInputConfig.prototype.gcsSource = null; /** - * CompletionDetail selectedPosition. - * @member {number} selectedPosition - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * UserEventInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance */ - CompletionDetail.prototype.selectedPosition = 0; + UserEventInputConfig.prototype.bigQuerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new CompletionDetail instance using the specified properties. + * UserEventInputConfig source. + * @member {"userEventInlineSource"|"gcsSource"|"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig + * @instance + */ + Object.defineProperty(UserEventInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["userEventInlineSource", "gcsSource", "bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UserEventInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail instance + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig instance */ - CompletionDetail.create = function create(properties) { - return new CompletionDetail(properties); + UserEventInputConfig.create = function create(properties) { + return new UserEventInputConfig(properties); }; /** - * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * Encodes the specified UserEventInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDetail.encode = function encode(message, writer) { + UserEventInputConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); - if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); - if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); + if (message.userEventInlineSource != null && Object.hasOwnProperty.call(message, "userEventInlineSource")) + $root.google.cloud.retail.v2alpha.UserEventInlineSource.encode(message.userEventInlineSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.retail.v2alpha.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. + * Encodes the specified UserEventInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventInputConfig} message UserEventInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { + UserEventInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompletionDetail message from the specified reader or buffer. + * Decodes a UserEventInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDetail.decode = function decode(reader, length) { + UserEventInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.completionAttributionToken = reader.string(); + message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.decode(reader, reader.uint32()); break; } case 2: { - message.selectedSuggestion = reader.string(); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.decode(reader, reader.uint32()); break; } case 3: { - message.selectedPosition = reader.int32(); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); break; } default: @@ -65433,143 +69774,172 @@ }; /** - * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. + * Decodes a UserEventInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompletionDetail.decodeDelimited = function decodeDelimited(reader) { + UserEventInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompletionDetail message. + * Verifies a UserEventInputConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompletionDetail.verify = function verify(message) { + UserEventInputConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - if (!$util.isString(message.completionAttributionToken)) - return "completionAttributionToken: string expected"; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - if (!$util.isString(message.selectedSuggestion)) - return "selectedSuggestion: string expected"; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - if (!$util.isInteger(message.selectedPosition)) - return "selectedPosition: integer expected"; + var properties = {}; + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.UserEventInlineSource.verify(message.userEventInlineSource); + if (error) + return "userEventInlineSource." + error; + } + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.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.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } return null; }; /** - * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail + * @returns {google.cloud.retail.v2alpha.UserEventInputConfig} UserEventInputConfig */ - CompletionDetail.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDetail) + UserEventInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventInputConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); - if (object.completionAttributionToken != null) - message.completionAttributionToken = String(object.completionAttributionToken); - if (object.selectedSuggestion != null) - message.selectedSuggestion = String(object.selectedSuggestion); - if (object.selectedPosition != null) - message.selectedPosition = object.selectedPosition | 0; + var message = new $root.google.cloud.retail.v2alpha.UserEventInputConfig(); + if (object.userEventInlineSource != null) { + if (typeof object.userEventInlineSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.userEventInlineSource: object expected"); + message.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.fromObject(object.userEventInlineSource); + } + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.fromObject(object.gcsSource); + } + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEventInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + } return message; }; /** - * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. + * Creates a plain object from a UserEventInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static - * @param {google.cloud.retail.v2alpha.CompletionDetail} message CompletionDetail + * @param {google.cloud.retail.v2alpha.UserEventInputConfig} message UserEventInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompletionDetail.toObject = function toObject(message, options) { + UserEventInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.completionAttributionToken = ""; - object.selectedSuggestion = ""; - object.selectedPosition = 0; + if (message.userEventInlineSource != null && message.hasOwnProperty("userEventInlineSource")) { + object.userEventInlineSource = $root.google.cloud.retail.v2alpha.UserEventInlineSource.toObject(message.userEventInlineSource, options); + if (options.oneofs) + object.source = "userEventInlineSource"; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.retail.v2alpha.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; } - if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) - object.completionAttributionToken = message.completionAttributionToken; - if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) - object.selectedSuggestion = message.selectedSuggestion; - if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) - object.selectedPosition = message.selectedPosition; return object; }; /** - * Converts this CompletionDetail to JSON. + * Converts this UserEventInputConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @instance * @returns {Object.} JSON object */ - CompletionDetail.prototype.toJSON = function toJSON() { + UserEventInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CompletionDetail + * Gets the default type url for UserEventInputConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @memberof google.cloud.retail.v2alpha.UserEventInputConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CompletionDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UserEventInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionDetail"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventInputConfig"; }; - return CompletionDetail; + return UserEventInputConfig; })(); - v2alpha.PurchaseTransaction = (function() { + v2alpha.CompletionDataInputConfig = (function() { /** - * Properties of a PurchaseTransaction. + * Properties of a CompletionDataInputConfig. * @memberof google.cloud.retail.v2alpha - * @interface IPurchaseTransaction - * @property {string|null} [id] PurchaseTransaction id - * @property {number|null} [revenue] PurchaseTransaction revenue - * @property {number|null} [tax] PurchaseTransaction tax - * @property {number|null} [cost] PurchaseTransaction cost - * @property {string|null} [currencyCode] PurchaseTransaction currencyCode + * @interface ICompletionDataInputConfig + * @property {google.cloud.retail.v2alpha.IBigQuerySource|null} [bigQuerySource] CompletionDataInputConfig bigQuerySource */ /** - * Constructs a new PurchaseTransaction. + * Constructs a new CompletionDataInputConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurchaseTransaction. - * @implements IPurchaseTransaction + * @classdesc Represents a CompletionDataInputConfig. + * @implements ICompletionDataInputConfig * @constructor - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set */ - function PurchaseTransaction(properties) { + function CompletionDataInputConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65577,131 +69947,89 @@ } /** - * PurchaseTransaction id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.id = ""; - - /** - * PurchaseTransaction revenue. - * @member {number} revenue - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.revenue = 0; - - /** - * PurchaseTransaction tax. - * @member {number} tax - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * CompletionDataInputConfig bigQuerySource. + * @member {google.cloud.retail.v2alpha.IBigQuerySource|null|undefined} bigQuerySource + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance */ - PurchaseTransaction.prototype.tax = 0; + CompletionDataInputConfig.prototype.bigQuerySource = null; - /** - * PurchaseTransaction cost. - * @member {number} cost - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction - * @instance - */ - PurchaseTransaction.prototype.cost = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * PurchaseTransaction currencyCode. - * @member {string} currencyCode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * CompletionDataInputConfig source. + * @member {"bigQuerySource"|undefined} source + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance */ - PurchaseTransaction.prototype.currencyCode = ""; + Object.defineProperty(CompletionDataInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["bigQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new PurchaseTransaction instance using the specified properties. + * Creates a new CompletionDataInputConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction instance + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig instance */ - PurchaseTransaction.create = function create(properties) { - return new PurchaseTransaction(properties); + CompletionDataInputConfig.create = function create(properties) { + return new CompletionDataInputConfig(properties); }; /** - * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * Encodes the specified CompletionDataInputConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurchaseTransaction.encode = function encode(message, writer) { + CompletionDataInputConfig.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.revenue != null && Object.hasOwnProperty.call(message, "revenue")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); - if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); - if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + if (message.bigQuerySource != null && Object.hasOwnProperty.call(message, "bigQuerySource")) + $root.google.cloud.retail.v2alpha.BigQuerySource.encode(message.bigQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. + * Encodes the specified CompletionDataInputConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDataInputConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static - * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDataInputConfig} message CompletionDataInputConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { + CompletionDataInputConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurchaseTransaction.decode = function decode(reader, length) { + CompletionDataInputConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.revenue = reader.float(); - break; - } - case 3: { - message.tax = reader.float(); - break; - } - case 4: { - message.cost = reader.float(); - break; - } - case 5: { - message.currencyCode = reader.string(); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.decode(reader, reader.uint32()); break; } default: @@ -65713,692 +70041,298 @@ }; /** - * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. + * Decodes a CompletionDataInputConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { + CompletionDataInputConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurchaseTransaction message. + * Verifies a CompletionDataInputConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurchaseTransaction.verify = function verify(message) { + CompletionDataInputConfig.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.revenue != null && message.hasOwnProperty("revenue")) - if (typeof message.revenue !== "number") - return "revenue: number expected"; - if (message.tax != null && message.hasOwnProperty("tax")) - if (typeof message.tax !== "number") - return "tax: number expected"; - if (message.cost != null && message.hasOwnProperty("cost")) - if (typeof message.cost !== "number") - return "cost: number expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; + var properties = {}; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + properties.source = 1; + { + var error = $root.google.cloud.retail.v2alpha.BigQuerySource.verify(message.bigQuerySource); + if (error) + return "bigQuerySource." + error; + } + } return null; }; /** - * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDataInputConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction + * @returns {google.cloud.retail.v2alpha.CompletionDataInputConfig} CompletionDataInputConfig */ - PurchaseTransaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurchaseTransaction) + CompletionDataInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDataInputConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); - if (object.id != null) - message.id = String(object.id); - if (object.revenue != null) - message.revenue = Number(object.revenue); - if (object.tax != null) - message.tax = Number(object.tax); - if (object.cost != null) - message.cost = Number(object.cost); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); + var message = new $root.google.cloud.retail.v2alpha.CompletionDataInputConfig(); + if (object.bigQuerySource != null) { + if (typeof object.bigQuerySource !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompletionDataInputConfig.bigQuerySource: object expected"); + message.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.fromObject(object.bigQuerySource); + } return message; }; /** - * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. + * Creates a plain object from a CompletionDataInputConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static - * @param {google.cloud.retail.v2alpha.PurchaseTransaction} message PurchaseTransaction + * @param {google.cloud.retail.v2alpha.CompletionDataInputConfig} message CompletionDataInputConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurchaseTransaction.toObject = function toObject(message, options) { + CompletionDataInputConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.id = ""; - object.revenue = 0; - object.tax = 0; - object.cost = 0; - object.currencyCode = ""; + if (message.bigQuerySource != null && message.hasOwnProperty("bigQuerySource")) { + object.bigQuerySource = $root.google.cloud.retail.v2alpha.BigQuerySource.toObject(message.bigQuerySource, options); + if (options.oneofs) + object.source = "bigQuerySource"; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.revenue != null && message.hasOwnProperty("revenue")) - object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; - if (message.tax != null && message.hasOwnProperty("tax")) - object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; - if (message.cost != null && message.hasOwnProperty("cost")) - object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; return object; }; /** - * Converts this PurchaseTransaction to JSON. + * Converts this CompletionDataInputConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @instance * @returns {Object.} JSON object */ - PurchaseTransaction.prototype.toJSON = function toJSON() { + CompletionDataInputConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurchaseTransaction + * Gets the default type url for CompletionDataInputConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @memberof google.cloud.retail.v2alpha.CompletionDataInputConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurchaseTransaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CompletionDataInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurchaseTransaction"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionDataInputConfig"; }; - return PurchaseTransaction; + return CompletionDataInputConfig; })(); - v2alpha.CatalogService = (function() { + v2alpha.ImportMetadata = (function() { /** - * Constructs a new CatalogService service. + * Properties of an ImportMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CatalogService - * @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 CatalogService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; - - /** - * Creates new CatalogService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.CatalogService - * @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 {CatalogService} RPC service. Useful where requests and/or responses are streamed. - */ - CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|listCatalogs}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef ListCatalogsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} [response] ListCatalogsResponse - */ - - /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { - return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2alpha.ListCatalogsRequest, $root.google.cloud.retail.v2alpha.ListCatalogsResponse, request, callback); - }, "name", { value: "ListCatalogs" }); - - /** - * Calls ListCatalogs. - * @function listCatalogs - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCatalog}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef UpdateCatalogCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Catalog} [response] Catalog - */ - - /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { - return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2alpha.UpdateCatalogRequest, $root.google.cloud.retail.v2alpha.Catalog, request, callback); - }, "name", { value: "UpdateCatalog" }); - - /** - * Calls UpdateCatalog. - * @function updateCatalog - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|setDefaultBranch}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef SetDefaultBranchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { - return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "SetDefaultBranch" }); - - /** - * Calls SetDefaultBranch. - * @function setDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getDefaultBranch}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef GetDefaultBranchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} [response] GetDefaultBranchResponse - */ - - /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { - return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest, $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse, request, callback); - }, "name", { value: "GetDefaultBranch" }); - - /** - * Calls GetDefaultBranch. - * @function getDefaultBranch - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getCompletionConfig}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef GetCompletionConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.CompletionConfig} [response] CompletionConfig - */ - - /** - * Calls GetCompletionConfig. - * @function getCompletionConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.GetCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.getCompletionConfig = function getCompletionConfig(request, callback) { - return this.rpcCall(getCompletionConfig, $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest, $root.google.cloud.retail.v2alpha.CompletionConfig, request, callback); - }, "name", { value: "GetCompletionConfig" }); - - /** - * Calls GetCompletionConfig. - * @function getCompletionConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCompletionConfig}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef UpdateCompletionConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.CompletionConfig} [response] CompletionConfig - */ - - /** - * Calls UpdateCompletionConfig. - * @function updateCompletionConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.updateCompletionConfig = function updateCompletionConfig(request, callback) { - return this.rpcCall(updateCompletionConfig, $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, $root.google.cloud.retail.v2alpha.CompletionConfig, request, callback); - }, "name", { value: "UpdateCompletionConfig" }); - - /** - * Calls UpdateCompletionConfig. - * @function updateCompletionConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getAttributesConfig}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef GetAttributesConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig - */ - - /** - * Calls GetAttributesConfig. - * @function getAttributesConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.GetAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.getAttributesConfig = function getAttributesConfig(request, callback) { - return this.rpcCall(getAttributesConfig, $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); - }, "name", { value: "GetAttributesConfig" }); - - /** - * Calls GetAttributesConfig. - * @function getAttributesConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateAttributesConfig}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef UpdateAttributesConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig - */ - - /** - * Calls UpdateAttributesConfig. - * @function updateAttributesConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.updateAttributesConfig = function updateAttributesConfig(request, callback) { - return this.rpcCall(updateAttributesConfig, $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); - }, "name", { value: "UpdateAttributesConfig" }); - - /** - * Calls UpdateAttributesConfig. - * @function updateAttributesConfig - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|addCatalogAttribute}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef AddCatalogAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig - */ - - /** - * Calls AddCatalogAttribute. - * @function addCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.AddCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.addCatalogAttribute = function addCatalogAttribute(request, callback) { - return this.rpcCall(addCatalogAttribute, $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); - }, "name", { value: "AddCatalogAttribute" }); - - /** - * Calls AddCatalogAttribute. - * @function addCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|removeCatalogAttribute}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef RemoveCatalogAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig - */ - - /** - * Calls RemoveCatalogAttribute. - * @function removeCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CatalogService.prototype.removeCatalogAttribute = function removeCatalogAttribute(request, callback) { - return this.rpcCall(removeCatalogAttribute, $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); - }, "name", { value: "RemoveCatalogAttribute" }); - - /** - * Calls RemoveCatalogAttribute. - * @function removeCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @interface IImportMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ImportMetadata updateTime + * @property {number|Long|null} [successCount] ImportMetadata successCount + * @property {number|Long|null} [failureCount] ImportMetadata failureCount + * @property {string|null} [requestId] ImportMetadata requestId + * @property {string|null} [notificationPubsubTopic] ImportMetadata notificationPubsubTopic + * @property {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null} [transformedUserEventsMetadata] ImportMetadata transformedUserEventsMetadata */ /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef BatchRemoveCatalogAttributesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} [response] BatchRemoveCatalogAttributesResponse + * Constructs a new ImportMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ImportMetadata. + * @implements IImportMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set */ + function ImportMetadata(properties) { + if (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 BatchRemoveCatalogAttributes. - * @function batchRemoveCatalogAttributes - * @memberof google.cloud.retail.v2alpha.CatalogService + * ImportMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback} callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(CatalogService.prototype.batchRemoveCatalogAttributes = function batchRemoveCatalogAttributes(request, callback) { - return this.rpcCall(batchRemoveCatalogAttributes, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, request, callback); - }, "name", { value: "BatchRemoveCatalogAttributes" }); + ImportMetadata.prototype.createTime = null; /** - * Calls BatchRemoveCatalogAttributes. - * @function batchRemoveCatalogAttributes - * @memberof google.cloud.retail.v2alpha.CatalogService + * ImportMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. - * @memberof google.cloud.retail.v2alpha.CatalogService - * @typedef ReplaceCatalogAttributeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig */ + ImportMetadata.prototype.updateTime = null; /** - * Calls ReplaceCatalogAttribute. - * @function replaceCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService + * ImportMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object - * @param {google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(CatalogService.prototype.replaceCatalogAttribute = function replaceCatalogAttribute(request, callback) { - return this.rpcCall(replaceCatalogAttribute, $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); - }, "name", { value: "ReplaceCatalogAttribute" }); + ImportMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls ReplaceCatalogAttribute. - * @function replaceCatalogAttribute - * @memberof google.cloud.retail.v2alpha.CatalogService + * ImportMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CatalogService; - })(); - - v2alpha.ListCatalogsRequest = (function() { - - /** - * Properties of a ListCatalogsRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IListCatalogsRequest - * @property {string|null} [parent] ListCatalogsRequest parent - * @property {number|null} [pageSize] ListCatalogsRequest pageSize - * @property {string|null} [pageToken] ListCatalogsRequest pageToken - */ - - /** - * Constructs a new ListCatalogsRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListCatalogsRequest. - * @implements IListCatalogsRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set */ - function ListCatalogsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ImportMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ListCatalogsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * ImportMetadata requestId. + * @member {string} requestId + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - ListCatalogsRequest.prototype.parent = ""; + ImportMetadata.prototype.requestId = ""; /** - * ListCatalogsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * ImportMetadata notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - ListCatalogsRequest.prototype.pageSize = 0; + ImportMetadata.prototype.notificationPubsubTopic = ""; /** - * ListCatalogsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * ImportMetadata transformedUserEventsMetadata. + * @member {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata|null|undefined} transformedUserEventsMetadata + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance */ - ListCatalogsRequest.prototype.pageToken = ""; + ImportMetadata.prototype.transformedUserEventsMetadata = null; /** - * Creates a new ListCatalogsRequest instance using the specified properties. + * Creates a new ImportMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest instance + * @param {google.cloud.retail.v2alpha.IImportMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata instance */ - ListCatalogsRequest.create = function create(properties) { - return new ListCatalogsRequest(properties); + ImportMetadata.create = function create(properties) { + return new ImportMetadata(properties); }; /** - * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified ImportMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encode = function encode(message, writer) { + ImportMetadata.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.notificationPubsubTopic != null && Object.hasOwnProperty.call(message, "notificationPubsubTopic")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.notificationPubsubTopic); + if (message.transformedUserEventsMetadata != null && Object.hasOwnProperty.call(message, "transformedUserEventsMetadata")) + $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.encode(message.transformedUserEventsMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. + * Encodes the specified ImportMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportMetadata} message ImportMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer. + * Decodes an ImportMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decode = function decode(reader, length) { + ImportMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.pageSize = reader.int32(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + message.notificationPubsubTopic = reader.string(); + break; + } + case 7: { + message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.decode(reader, reader.uint32()); break; } default: @@ -66410,141 +70344,215 @@ }; /** - * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { + ImportMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCatalogsRequest message. + * Verifies an ImportMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCatalogsRequest.verify = function verify(message) { + ImportMetadata.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.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.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) { + var error = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify(message.transformedUserEventsMetadata); + if (error) + return "transformedUserEventsMetadata." + error; + } return null; }; /** - * Creates a ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest + * @returns {google.cloud.retail.v2alpha.ImportMetadata} ImportMetadata */ - ListCatalogsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsRequest) + ImportMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); - 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 ListCatalogsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest - * @static - * @param {google.cloud.retail.v2alpha.ListCatalogsRequest} message ListCatalogsRequest + var message = new $root.google.cloud.retail.v2alpha.ImportMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.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.retail.v2alpha.ImportMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.transformedUserEventsMetadata != null) { + if (typeof object.transformedUserEventsMetadata !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportMetadata.transformedUserEventsMetadata: object expected"); + message.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.fromObject(object.transformedUserEventsMetadata); + } + return message; + }; + + /** + * Creates a plain object from an ImportMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ImportMetadata + * @static + * @param {google.cloud.retail.v2alpha.ImportMetadata} message ImportMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCatalogsRequest.toObject = function toObject(message, options) { + ImportMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + object.requestId = ""; + object.notificationPubsubTopic = ""; + object.transformedUserEventsMetadata = null; } - 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.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.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.transformedUserEventsMetadata != null && message.hasOwnProperty("transformedUserEventsMetadata")) + object.transformedUserEventsMetadata = $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata.toObject(message.transformedUserEventsMetadata, options); return object; }; /** - * Converts this ListCatalogsRequest to JSON. + * Converts this ImportMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @instance * @returns {Object.} JSON object */ - ListCatalogsRequest.prototype.toJSON = function toJSON() { + ImportMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListCatalogsRequest + * Gets the default type url for ImportMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @memberof google.cloud.retail.v2alpha.ImportMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListCatalogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListCatalogsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportMetadata"; }; - return ListCatalogsRequest; + return ImportMetadata; })(); - v2alpha.ListCatalogsResponse = (function() { + v2alpha.TransformedUserEventsMetadata = (function() { /** - * Properties of a ListCatalogsResponse. + * Properties of a TransformedUserEventsMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IListCatalogsResponse - * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs - * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken + * @interface ITransformedUserEventsMetadata + * @property {number|Long|null} [sourceEventsCount] TransformedUserEventsMetadata sourceEventsCount + * @property {number|Long|null} [transformedEventsCount] TransformedUserEventsMetadata transformedEventsCount */ /** - * Constructs a new ListCatalogsResponse. + * Constructs a new TransformedUserEventsMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListCatalogsResponse. - * @implements IListCatalogsResponse + * @classdesc Represents a TransformedUserEventsMetadata. + * @implements ITransformedUserEventsMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set */ - function ListCatalogsResponse(properties) { - this.catalogs = []; + function TransformedUserEventsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66552,92 +70560,89 @@ } /** - * ListCatalogsResponse catalogs. - * @member {Array.} catalogs - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * TransformedUserEventsMetadata sourceEventsCount. + * @member {number|Long} sourceEventsCount + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @instance */ - ListCatalogsResponse.prototype.catalogs = $util.emptyArray; + TransformedUserEventsMetadata.prototype.sourceEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ListCatalogsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * TransformedUserEventsMetadata transformedEventsCount. + * @member {number|Long} transformedEventsCount + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @instance */ - ListCatalogsResponse.prototype.nextPageToken = ""; + TransformedUserEventsMetadata.prototype.transformedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ListCatalogsResponse instance using the specified properties. + * Creates a new TransformedUserEventsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse instance + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata instance */ - ListCatalogsResponse.create = function create(properties) { - return new ListCatalogsResponse(properties); + TransformedUserEventsMetadata.create = function create(properties) { + return new TransformedUserEventsMetadata(properties); }; /** - * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * Encodes the specified TransformedUserEventsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsResponse.encode = function encode(message, writer) { + TransformedUserEventsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalogs != null && message.catalogs.length) - for (var i = 0; i < message.catalogs.length; ++i) - $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalogs[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.sourceEventsCount != null && Object.hasOwnProperty.call(message, "sourceEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sourceEventsCount); + if (message.transformedEventsCount != null && Object.hasOwnProperty.call(message, "transformedEventsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.transformedEventsCount); return writer; }; /** - * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. + * Encodes the specified TransformedUserEventsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TransformedUserEventsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ITransformedUserEventsMetadata} message TransformedUserEventsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + TransformedUserEventsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer. + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsResponse.decode = function decode(reader, length) { + TransformedUserEventsMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.catalogs && message.catalogs.length)) - message.catalogs = []; - message.catalogs.push($root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32())); + message.sourceEventsCount = reader.int64(); break; } case 2: { - message.nextPageToken = reader.string(); + message.transformedEventsCount = reader.int64(); break; } default: @@ -66649,149 +70654,161 @@ }; /** - * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. + * Decodes a TransformedUserEventsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { + TransformedUserEventsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListCatalogsResponse message. + * Verifies a TransformedUserEventsMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListCatalogsResponse.verify = function verify(message) { + TransformedUserEventsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalogs != null && message.hasOwnProperty("catalogs")) { - if (!Array.isArray(message.catalogs)) - return "catalogs: array expected"; - for (var i = 0; i < message.catalogs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalogs[i]); - if (error) - return "catalogs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) + if (!$util.isInteger(message.sourceEventsCount) && !(message.sourceEventsCount && $util.isInteger(message.sourceEventsCount.low) && $util.isInteger(message.sourceEventsCount.high))) + return "sourceEventsCount: integer|Long expected"; + if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) + if (!$util.isInteger(message.transformedEventsCount) && !(message.transformedEventsCount && $util.isInteger(message.transformedEventsCount.low) && $util.isInteger(message.transformedEventsCount.high))) + return "transformedEventsCount: integer|Long expected"; return null; }; /** - * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TransformedUserEventsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse + * @returns {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} TransformedUserEventsMetadata */ - ListCatalogsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsResponse) + TransformedUserEventsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); - if (object.catalogs) { - if (!Array.isArray(object.catalogs)) - throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: array expected"); - message.catalogs = []; - for (var i = 0; i < object.catalogs.length; ++i) { - if (typeof object.catalogs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: object expected"); - message.catalogs[i] = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalogs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.retail.v2alpha.TransformedUserEventsMetadata(); + if (object.sourceEventsCount != null) + if ($util.Long) + (message.sourceEventsCount = $util.Long.fromValue(object.sourceEventsCount)).unsigned = false; + else if (typeof object.sourceEventsCount === "string") + message.sourceEventsCount = parseInt(object.sourceEventsCount, 10); + else if (typeof object.sourceEventsCount === "number") + message.sourceEventsCount = object.sourceEventsCount; + else if (typeof object.sourceEventsCount === "object") + message.sourceEventsCount = new $util.LongBits(object.sourceEventsCount.low >>> 0, object.sourceEventsCount.high >>> 0).toNumber(); + if (object.transformedEventsCount != null) + if ($util.Long) + (message.transformedEventsCount = $util.Long.fromValue(object.transformedEventsCount)).unsigned = false; + else if (typeof object.transformedEventsCount === "string") + message.transformedEventsCount = parseInt(object.transformedEventsCount, 10); + else if (typeof object.transformedEventsCount === "number") + message.transformedEventsCount = object.transformedEventsCount; + else if (typeof object.transformedEventsCount === "object") + message.transformedEventsCount = new $util.LongBits(object.transformedEventsCount.low >>> 0, object.transformedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. + * Creates a plain object from a TransformedUserEventsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static - * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} message ListCatalogsResponse + * @param {google.cloud.retail.v2alpha.TransformedUserEventsMetadata} message TransformedUserEventsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCatalogsResponse.toObject = function toObject(message, options) { + TransformedUserEventsMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.catalogs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.catalogs && message.catalogs.length) { - object.catalogs = []; - for (var j = 0; j < message.catalogs.length; ++j) - object.catalogs[j] = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalogs[j], options); + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sourceEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sourceEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.transformedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transformedEventsCount = options.longs === String ? "0" : 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.sourceEventsCount != null && message.hasOwnProperty("sourceEventsCount")) + if (typeof message.sourceEventsCount === "number") + object.sourceEventsCount = options.longs === String ? String(message.sourceEventsCount) : message.sourceEventsCount; + else + object.sourceEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.sourceEventsCount) : options.longs === Number ? new $util.LongBits(message.sourceEventsCount.low >>> 0, message.sourceEventsCount.high >>> 0).toNumber() : message.sourceEventsCount; + if (message.transformedEventsCount != null && message.hasOwnProperty("transformedEventsCount")) + if (typeof message.transformedEventsCount === "number") + object.transformedEventsCount = options.longs === String ? String(message.transformedEventsCount) : message.transformedEventsCount; + else + object.transformedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.transformedEventsCount) : options.longs === Number ? new $util.LongBits(message.transformedEventsCount.low >>> 0, message.transformedEventsCount.high >>> 0).toNumber() : message.transformedEventsCount; return object; }; /** - * Converts this ListCatalogsResponse to JSON. + * Converts this TransformedUserEventsMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @instance * @returns {Object.} JSON object */ - ListCatalogsResponse.prototype.toJSON = function toJSON() { + TransformedUserEventsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListCatalogsResponse + * Gets the default type url for TransformedUserEventsMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse + * @memberof google.cloud.retail.v2alpha.TransformedUserEventsMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListCatalogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TransformedUserEventsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListCatalogsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.TransformedUserEventsMetadata"; }; - return ListCatalogsResponse; + return TransformedUserEventsMetadata; })(); - v2alpha.UpdateCatalogRequest = (function() { + v2alpha.ImportProductsResponse = (function() { /** - * Properties of an UpdateCatalogRequest. + * Properties of an ImportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateCatalogRequest - * @property {google.cloud.retail.v2alpha.ICatalog|null} [catalog] UpdateCatalogRequest catalog - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask + * @interface IImportProductsResponse + * @property {Array.|null} [errorSamples] ImportProductsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportProductsResponse errorsConfig */ /** - * Constructs a new UpdateCatalogRequest. + * Constructs a new ImportProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateCatalogRequest. - * @implements IUpdateCatalogRequest + * @classdesc Represents an ImportProductsResponse. + * @implements IImportProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set */ - function UpdateCatalogRequest(properties) { + function ImportProductsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66799,89 +70816,92 @@ } /** - * UpdateCatalogRequest catalog. - * @member {google.cloud.retail.v2alpha.ICatalog|null|undefined} catalog - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * ImportProductsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance */ - UpdateCatalogRequest.prototype.catalog = null; + ImportProductsResponse.prototype.errorSamples = $util.emptyArray; /** - * UpdateCatalogRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * ImportProductsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance */ - UpdateCatalogRequest.prototype.updateMask = null; + ImportProductsResponse.prototype.errorsConfig = null; /** - * Creates a new UpdateCatalogRequest instance using the specified properties. + * Creates a new ImportProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest instance + * @param {google.cloud.retail.v2alpha.IImportProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse instance */ - UpdateCatalogRequest.create = function create(properties) { - return new UpdateCatalogRequest(properties); + ImportProductsResponse.create = function create(properties) { + return new ImportProductsResponse(properties); }; /** - * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * Encodes the specified ImportProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCatalogRequest.encode = function encode(message, writer) { + ImportProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalog, 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.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. + * Encodes the specified ImportProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportProductsResponse} message ImportProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer. + * Decodes an ImportProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCatalogRequest.decode = function decode(reader, length) { + ImportProductsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.catalog = $root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32()); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; } default: @@ -66893,144 +70913,156 @@ }; /** - * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { + ImportProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateCatalogRequest message. + * Verifies an ImportProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateCatalogRequest.verify = function verify(message) { + ImportProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) { - var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalog); - if (error) - return "catalog." + error; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); if (error) - return "updateMask." + error; + return "errorsConfig." + error; } return null; }; /** - * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest + * @returns {google.cloud.retail.v2alpha.ImportProductsResponse} ImportProductsResponse */ - UpdateCatalogRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCatalogRequest) + ImportProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportProductsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); - if (object.catalog != null) { - if (typeof object.catalog !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.catalog: object expected"); - message.catalog = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalog); + var message = new $root.google.cloud.retail.v2alpha.ImportProductsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportProductsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); } return message; }; /** - * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static - * @param {google.cloud.retail.v2alpha.UpdateCatalogRequest} message UpdateCatalogRequest + * @param {google.cloud.retail.v2alpha.ImportProductsResponse} message ImportProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCatalogRequest.toObject = function toObject(message, options) { + ImportProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.catalog = null; - object.updateMask = null; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (options.defaults) + object.errorsConfig = null; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalog, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); return object; }; /** - * Converts this UpdateCatalogRequest to JSON. + * Converts this ImportProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @instance * @returns {Object.} JSON object */ - UpdateCatalogRequest.prototype.toJSON = function toJSON() { + ImportProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateCatalogRequest + * Gets the default type url for ImportProductsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest + * @memberof google.cloud.retail.v2alpha.ImportProductsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateCatalogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateCatalogRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportProductsResponse"; }; - return UpdateCatalogRequest; + return ImportProductsResponse; })(); - v2alpha.SetDefaultBranchRequest = (function() { + v2alpha.ImportUserEventsResponse = (function() { /** - * Properties of a SetDefaultBranchRequest. + * Properties of an ImportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @interface ISetDefaultBranchRequest - * @property {string|null} [catalog] SetDefaultBranchRequest catalog - * @property {string|null} [branchId] SetDefaultBranchRequest branchId - * @property {string|null} [note] SetDefaultBranchRequest note - * @property {boolean|null} [force] SetDefaultBranchRequest force + * @interface IImportUserEventsResponse + * @property {Array.|null} [errorSamples] ImportUserEventsResponse errorSamples + * @property {google.cloud.retail.v2alpha.IImportErrorsConfig|null} [errorsConfig] ImportUserEventsResponse errorsConfig + * @property {google.cloud.retail.v2alpha.IUserEventImportSummary|null} [importSummary] ImportUserEventsResponse importSummary */ /** - * Constructs a new SetDefaultBranchRequest. + * Constructs a new ImportUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetDefaultBranchRequest. - * @implements ISetDefaultBranchRequest + * @classdesc Represents an ImportUserEventsResponse. + * @implements IImportUserEventsResponse * @constructor - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set */ - function SetDefaultBranchRequest(properties) { + function ImportUserEventsResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67038,117 +71070,106 @@ } /** - * SetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest - * @instance - */ - SetDefaultBranchRequest.prototype.catalog = ""; - - /** - * SetDefaultBranchRequest branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * ImportUserEventsResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - SetDefaultBranchRequest.prototype.branchId = ""; + ImportUserEventsResponse.prototype.errorSamples = $util.emptyArray; /** - * SetDefaultBranchRequest note. - * @member {string} note - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * ImportUserEventsResponse errorsConfig. + * @member {google.cloud.retail.v2alpha.IImportErrorsConfig|null|undefined} errorsConfig + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - SetDefaultBranchRequest.prototype.note = ""; + ImportUserEventsResponse.prototype.errorsConfig = null; /** - * SetDefaultBranchRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * ImportUserEventsResponse importSummary. + * @member {google.cloud.retail.v2alpha.IUserEventImportSummary|null|undefined} importSummary + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance */ - SetDefaultBranchRequest.prototype.force = false; + ImportUserEventsResponse.prototype.importSummary = null; /** - * Creates a new SetDefaultBranchRequest instance using the specified properties. + * Creates a new ImportUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest instance + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse instance */ - SetDefaultBranchRequest.create = function create(properties) { - return new SetDefaultBranchRequest(properties); + ImportUserEventsResponse.create = function create(properties) { + return new ImportUserEventsResponse(properties); }; /** - * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetDefaultBranchRequest.encode = function encode(message, writer) { + ImportUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.errorsConfig != null && Object.hasOwnProperty.call(message, "errorsConfig")) + $root.google.cloud.retail.v2alpha.ImportErrorsConfig.encode(message.errorsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.importSummary != null && Object.hasOwnProperty.call(message, "importSummary")) + $root.google.cloud.retail.v2alpha.UserEventImportSummary.encode(message.importSummary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified ImportUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportUserEventsResponse} message ImportUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetDefaultBranchRequest.decode = function decode(reader, length) { + ImportUserEventsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.catalog = reader.string(); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; } case 2: { - message.branchId = reader.string(); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.decode(reader, reader.uint32()); break; } case 3: { - message.note = reader.string(); - break; - } - case 4: { - message.force = reader.bool(); + message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.decode(reader, reader.uint32()); break; } default: @@ -67160,147 +71181,168 @@ }; /** - * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + ImportUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetDefaultBranchRequest message. + * Verifies an ImportUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetDefaultBranchRequest.verify = function verify(message) { + ImportUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: string expected"; - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) { + var error = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.verify(message.errorsConfig); + if (error) + return "errorsConfig." + error; + } + if (message.importSummary != null && message.hasOwnProperty("importSummary")) { + var error = $root.google.cloud.retail.v2alpha.UserEventImportSummary.verify(message.importSummary); + if (error) + return "importSummary." + error; + } return null; }; /** - * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.ImportUserEventsResponse} ImportUserEventsResponse */ - SetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest) + ImportUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.note != null) - message.note = String(object.note); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.retail.v2alpha.ImportUserEventsResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } + } + if (object.errorsConfig != null) { + if (typeof object.errorsConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.errorsConfig: object expected"); + message.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.fromObject(object.errorsConfig); + } + if (object.importSummary != null) { + if (typeof object.importSummary !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportUserEventsResponse.importSummary: object expected"); + message.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.fromObject(object.importSummary); + } return message; }; /** - * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.SetDefaultBranchRequest} message SetDefaultBranchRequest + * @param {google.cloud.retail.v2alpha.ImportUserEventsResponse} message ImportUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetDefaultBranchRequest.toObject = function toObject(message, options) { + ImportUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.errorSamples = []; if (options.defaults) { - object.catalog = ""; - object.branchId = ""; - object.note = ""; - object.force = false; + object.errorsConfig = null; + object.importSummary = null; } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); + } + if (message.errorsConfig != null && message.hasOwnProperty("errorsConfig")) + object.errorsConfig = $root.google.cloud.retail.v2alpha.ImportErrorsConfig.toObject(message.errorsConfig, options); + if (message.importSummary != null && message.hasOwnProperty("importSummary")) + object.importSummary = $root.google.cloud.retail.v2alpha.UserEventImportSummary.toObject(message.importSummary, options); return object; }; /** - * Converts this SetDefaultBranchRequest to JSON. + * Converts this ImportUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @instance * @returns {Object.} JSON object */ - SetDefaultBranchRequest.prototype.toJSON = function toJSON() { + ImportUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetDefaultBranchRequest + * Gets the default type url for ImportUserEventsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.ImportUserEventsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetDefaultBranchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetDefaultBranchRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportUserEventsResponse"; }; - return SetDefaultBranchRequest; + return ImportUserEventsResponse; })(); - v2alpha.GetDefaultBranchRequest = (function() { + v2alpha.UserEventImportSummary = (function() { /** - * Properties of a GetDefaultBranchRequest. + * Properties of a UserEventImportSummary. * @memberof google.cloud.retail.v2alpha - * @interface IGetDefaultBranchRequest - * @property {string|null} [catalog] GetDefaultBranchRequest catalog + * @interface IUserEventImportSummary + * @property {number|Long|null} [joinedEventsCount] UserEventImportSummary joinedEventsCount + * @property {number|Long|null} [unjoinedEventsCount] UserEventImportSummary unjoinedEventsCount */ /** - * Constructs a new GetDefaultBranchRequest. + * Constructs a new UserEventImportSummary. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetDefaultBranchRequest. - * @implements IGetDefaultBranchRequest + * @classdesc Represents a UserEventImportSummary. + * @implements IUserEventImportSummary * @constructor - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set */ - function GetDefaultBranchRequest(properties) { + function UserEventImportSummary(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67308,75 +71350,89 @@ } /** - * GetDefaultBranchRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * UserEventImportSummary joinedEventsCount. + * @member {number|Long} joinedEventsCount + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @instance */ - GetDefaultBranchRequest.prototype.catalog = ""; + UserEventImportSummary.prototype.joinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GetDefaultBranchRequest instance using the specified properties. + * UserEventImportSummary unjoinedEventsCount. + * @member {number|Long} unjoinedEventsCount + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary + * @instance + */ + UserEventImportSummary.prototype.unjoinedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UserEventImportSummary instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest instance + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary instance */ - GetDefaultBranchRequest.create = function create(properties) { - return new GetDefaultBranchRequest(properties); + UserEventImportSummary.create = function create(properties) { + return new UserEventImportSummary(properties); }; /** - * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified UserEventImportSummary message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encode = function encode(message, writer) { + UserEventImportSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.joinedEventsCount != null && Object.hasOwnProperty.call(message, "joinedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.joinedEventsCount); + if (message.unjoinedEventsCount != null && Object.hasOwnProperty.call(message, "unjoinedEventsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unjoinedEventsCount); return writer; }; /** - * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. + * Encodes the specified UserEventImportSummary message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEventImportSummary.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEventImportSummary} message UserEventImportSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { + UserEventImportSummary.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. + * Decodes a UserEventImportSummary message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decode = function decode(reader, length) { + UserEventImportSummary.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.catalog = reader.string(); + message.joinedEventsCount = reader.int64(); + break; + } + case 2: { + message.unjoinedEventsCount = reader.int64(); break; } default: @@ -67388,124 +71444,160 @@ }; /** - * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. + * Decodes a UserEventImportSummary message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { + UserEventImportSummary.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDefaultBranchRequest message. + * Verifies a UserEventImportSummary message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDefaultBranchRequest.verify = function verify(message) { + UserEventImportSummary.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (!$util.isInteger(message.joinedEventsCount) && !(message.joinedEventsCount && $util.isInteger(message.joinedEventsCount.low) && $util.isInteger(message.joinedEventsCount.high))) + return "joinedEventsCount: integer|Long expected"; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (!$util.isInteger(message.unjoinedEventsCount) && !(message.unjoinedEventsCount && $util.isInteger(message.unjoinedEventsCount.low) && $util.isInteger(message.unjoinedEventsCount.high))) + return "unjoinedEventsCount: integer|Long expected"; return null; }; /** - * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserEventImportSummary message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest + * @returns {google.cloud.retail.v2alpha.UserEventImportSummary} UserEventImportSummary */ - GetDefaultBranchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest) + UserEventImportSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEventImportSummary) return object; - var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); + var message = new $root.google.cloud.retail.v2alpha.UserEventImportSummary(); + if (object.joinedEventsCount != null) + if ($util.Long) + (message.joinedEventsCount = $util.Long.fromValue(object.joinedEventsCount)).unsigned = false; + else if (typeof object.joinedEventsCount === "string") + message.joinedEventsCount = parseInt(object.joinedEventsCount, 10); + else if (typeof object.joinedEventsCount === "number") + message.joinedEventsCount = object.joinedEventsCount; + else if (typeof object.joinedEventsCount === "object") + message.joinedEventsCount = new $util.LongBits(object.joinedEventsCount.low >>> 0, object.joinedEventsCount.high >>> 0).toNumber(); + if (object.unjoinedEventsCount != null) + if ($util.Long) + (message.unjoinedEventsCount = $util.Long.fromValue(object.unjoinedEventsCount)).unsigned = false; + else if (typeof object.unjoinedEventsCount === "string") + message.unjoinedEventsCount = parseInt(object.unjoinedEventsCount, 10); + else if (typeof object.unjoinedEventsCount === "number") + message.unjoinedEventsCount = object.unjoinedEventsCount; + else if (typeof object.unjoinedEventsCount === "object") + message.unjoinedEventsCount = new $util.LongBits(object.unjoinedEventsCount.low >>> 0, object.unjoinedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. + * Creates a plain object from a UserEventImportSummary message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static - * @param {google.cloud.retail.v2alpha.GetDefaultBranchRequest} message GetDefaultBranchRequest + * @param {google.cloud.retail.v2alpha.UserEventImportSummary} message UserEventImportSummary * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDefaultBranchRequest.toObject = function toObject(message, options) { + UserEventImportSummary.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.catalog = ""; - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.joinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.joinedEventsCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.unjoinedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.unjoinedEventsCount = options.longs === String ? "0" : 0; + } + if (message.joinedEventsCount != null && message.hasOwnProperty("joinedEventsCount")) + if (typeof message.joinedEventsCount === "number") + object.joinedEventsCount = options.longs === String ? String(message.joinedEventsCount) : message.joinedEventsCount; + else + object.joinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.joinedEventsCount) : options.longs === Number ? new $util.LongBits(message.joinedEventsCount.low >>> 0, message.joinedEventsCount.high >>> 0).toNumber() : message.joinedEventsCount; + if (message.unjoinedEventsCount != null && message.hasOwnProperty("unjoinedEventsCount")) + if (typeof message.unjoinedEventsCount === "number") + object.unjoinedEventsCount = options.longs === String ? String(message.unjoinedEventsCount) : message.unjoinedEventsCount; + else + object.unjoinedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.unjoinedEventsCount) : options.longs === Number ? new $util.LongBits(message.unjoinedEventsCount.low >>> 0, message.unjoinedEventsCount.high >>> 0).toNumber() : message.unjoinedEventsCount; return object; }; /** - * Converts this GetDefaultBranchRequest to JSON. + * Converts this UserEventImportSummary to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @instance * @returns {Object.} JSON object */ - GetDefaultBranchRequest.prototype.toJSON = function toJSON() { + UserEventImportSummary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetDefaultBranchRequest + * Gets the default type url for UserEventImportSummary * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest + * @memberof google.cloud.retail.v2alpha.UserEventImportSummary * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetDefaultBranchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UserEventImportSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetDefaultBranchRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEventImportSummary"; }; - return GetDefaultBranchRequest; + return UserEventImportSummary; })(); - v2alpha.GetDefaultBranchResponse = (function() { + v2alpha.ImportCompletionDataResponse = (function() { /** - * Properties of a GetDefaultBranchResponse. + * Properties of an ImportCompletionDataResponse. * @memberof google.cloud.retail.v2alpha - * @interface IGetDefaultBranchResponse - * @property {string|null} [branch] GetDefaultBranchResponse branch - * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime - * @property {string|null} [note] GetDefaultBranchResponse note + * @interface IImportCompletionDataResponse + * @property {Array.|null} [errorSamples] ImportCompletionDataResponse errorSamples */ /** - * Constructs a new GetDefaultBranchResponse. + * Constructs a new ImportCompletionDataResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetDefaultBranchResponse. - * @implements IGetDefaultBranchResponse + * @classdesc Represents an ImportCompletionDataResponse. + * @implements IImportCompletionDataResponse * @constructor - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set */ - function GetDefaultBranchResponse(properties) { + function ImportCompletionDataResponse(properties) { + this.errorSamples = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67513,103 +71605,78 @@ } /** - * GetDefaultBranchResponse branch. - * @member {string} branch - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * ImportCompletionDataResponse errorSamples. + * @member {Array.} errorSamples + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @instance */ - GetDefaultBranchResponse.prototype.branch = ""; + ImportCompletionDataResponse.prototype.errorSamples = $util.emptyArray; /** - * GetDefaultBranchResponse setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance + * Creates a new ImportCompletionDataResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse instance */ - GetDefaultBranchResponse.prototype.setTime = null; + ImportCompletionDataResponse.create = function create(properties) { + return new ImportCompletionDataResponse(properties); + }; /** - * GetDefaultBranchResponse note. - * @member {string} note - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @instance + * Encodes the specified ImportCompletionDataResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse + * @static + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchResponse.prototype.note = ""; - - /** - * Creates a new GetDefaultBranchResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse instance - */ - GetDefaultBranchResponse.create = function create(properties) { - return new GetDefaultBranchResponse(properties); - }; - - /** - * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse - * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDefaultBranchResponse.encode = function encode(message, writer) { + ImportCompletionDataResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.errorSamples != null && message.errorSamples.length) + for (var i = 0; i < message.errorSamples.length; ++i) + $root.google.rpc.Status.encode(message.errorSamples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * Encodes the specified ImportCompletionDataResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ImportCompletionDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IImportCompletionDataResponse} message ImportCompletionDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportCompletionDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchResponse.decode = function decode(reader, length) { + ImportCompletionDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.branch = reader.string(); - break; - } - case 2: { - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.note = reader.string(); + if (!(message.errorSamples && message.errorSamples.length)) + message.errorSamples = []; + message.errorSamples.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; } default: @@ -67621,144 +71688,163 @@ }; /** - * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportCompletionDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { + ImportCompletionDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDefaultBranchResponse message. + * Verifies an ImportCompletionDataResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDefaultBranchResponse.verify = function verify(message) { + ImportCompletionDataResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); - if (error) - return "setTime." + error; + if (message.errorSamples != null && message.hasOwnProperty("errorSamples")) { + if (!Array.isArray(message.errorSamples)) + return "errorSamples: array expected"; + for (var i = 0; i < message.errorSamples.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errorSamples[i]); + if (error) + return "errorSamples." + error; + } } - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; return null; }; /** - * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportCompletionDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @returns {google.cloud.retail.v2alpha.ImportCompletionDataResponse} ImportCompletionDataResponse */ - GetDefaultBranchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse) + ImportCompletionDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); - if (object.branch != null) - message.branch = String(object.branch); - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.GetDefaultBranchResponse.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + var message = new $root.google.cloud.retail.v2alpha.ImportCompletionDataResponse(); + if (object.errorSamples) { + if (!Array.isArray(object.errorSamples)) + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: array expected"); + message.errorSamples = []; + for (var i = 0; i < object.errorSamples.length; ++i) { + if (typeof object.errorSamples[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ImportCompletionDataResponse.errorSamples: object expected"); + message.errorSamples[i] = $root.google.rpc.Status.fromObject(object.errorSamples[i]); + } } - if (object.note != null) - message.note = String(object.note); return message; }; /** - * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportCompletionDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static - * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} message GetDefaultBranchResponse + * @param {google.cloud.retail.v2alpha.ImportCompletionDataResponse} message ImportCompletionDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDefaultBranchResponse.toObject = function toObject(message, options) { + ImportCompletionDataResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.branch = ""; - object.setTime = null; - object.note = ""; + if (options.arrays || options.defaults) + object.errorSamples = []; + if (message.errorSamples && message.errorSamples.length) { + object.errorSamples = []; + for (var j = 0; j < message.errorSamples.length; ++j) + object.errorSamples[j] = $root.google.rpc.Status.toObject(message.errorSamples[j], options); } - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; return object; }; /** - * Converts this GetDefaultBranchResponse to JSON. + * Converts this ImportCompletionDataResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @instance * @returns {Object.} JSON object */ - GetDefaultBranchResponse.prototype.toJSON = function toJSON() { + ImportCompletionDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetDefaultBranchResponse + * Gets the default type url for ImportCompletionDataResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @memberof google.cloud.retail.v2alpha.ImportCompletionDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetDefaultBranchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportCompletionDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetDefaultBranchResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ImportCompletionDataResponse"; }; - return GetDefaultBranchResponse; + return ImportCompletionDataResponse; })(); - v2alpha.GetCompletionConfigRequest = (function() { + v2alpha.UserEvent = (function() { /** - * Properties of a GetCompletionConfigRequest. + * Properties of a UserEvent. * @memberof google.cloud.retail.v2alpha - * @interface IGetCompletionConfigRequest - * @property {string|null} [name] GetCompletionConfigRequest name + * @interface IUserEvent + * @property {string|null} [eventType] UserEvent eventType + * @property {string|null} [visitorId] UserEvent visitorId + * @property {string|null} [sessionId] UserEvent sessionId + * @property {google.protobuf.ITimestamp|null} [eventTime] UserEvent eventTime + * @property {Array.|null} [experimentIds] UserEvent experimentIds + * @property {string|null} [attributionToken] UserEvent attributionToken + * @property {Array.|null} [productDetails] UserEvent productDetails + * @property {google.cloud.retail.v2alpha.ICompletionDetail|null} [completionDetail] UserEvent completionDetail + * @property {Object.|null} [attributes] UserEvent attributes + * @property {string|null} [cartId] UserEvent cartId + * @property {google.cloud.retail.v2alpha.IPurchaseTransaction|null} [purchaseTransaction] UserEvent purchaseTransaction + * @property {string|null} [searchQuery] UserEvent searchQuery + * @property {string|null} [filter] UserEvent filter + * @property {string|null} [orderBy] UserEvent orderBy + * @property {number|null} [offset] UserEvent offset + * @property {Array.|null} [pageCategories] UserEvent pageCategories + * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] UserEvent userInfo + * @property {string|null} [uri] UserEvent uri + * @property {string|null} [referrerUri] UserEvent referrerUri + * @property {string|null} [pageViewId] UserEvent pageViewId + * @property {string|null} [entity] UserEvent entity */ /** - * Constructs a new GetCompletionConfigRequest. + * Constructs a new UserEvent. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetCompletionConfigRequest. - * @implements IGetCompletionConfigRequest + * @classdesc Represents a UserEvent. + * @implements IUserEvent * @constructor - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set */ - function GetCompletionConfigRequest(properties) { + function UserEvent(properties) { + this.experimentIds = []; + this.productDetails = []; + this.attributes = {}; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67766,75 +71852,386 @@ } /** - * GetCompletionConfigRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * UserEvent eventType. + * @member {string} eventType + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance */ - GetCompletionConfigRequest.prototype.name = ""; + UserEvent.prototype.eventType = ""; /** - * Creates a new GetCompletionConfigRequest instance using the specified properties. + * UserEvent visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.visitorId = ""; + + /** + * UserEvent sessionId. + * @member {string} sessionId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.sessionId = ""; + + /** + * UserEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.eventTime = null; + + /** + * UserEvent experimentIds. + * @member {Array.} experimentIds + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.experimentIds = $util.emptyArray; + + /** + * UserEvent attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.attributionToken = ""; + + /** + * UserEvent productDetails. + * @member {Array.} productDetails + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.productDetails = $util.emptyArray; + + /** + * UserEvent completionDetail. + * @member {google.cloud.retail.v2alpha.ICompletionDetail|null|undefined} completionDetail + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.completionDetail = null; + + /** + * UserEvent attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.attributes = $util.emptyObject; + + /** + * UserEvent cartId. + * @member {string} cartId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.cartId = ""; + + /** + * UserEvent purchaseTransaction. + * @member {google.cloud.retail.v2alpha.IPurchaseTransaction|null|undefined} purchaseTransaction + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.purchaseTransaction = null; + + /** + * UserEvent searchQuery. + * @member {string} searchQuery + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.searchQuery = ""; + + /** + * UserEvent filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.filter = ""; + + /** + * UserEvent orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.orderBy = ""; + + /** + * UserEvent offset. + * @member {number} offset + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.offset = 0; + + /** + * UserEvent pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.pageCategories = $util.emptyArray; + + /** + * UserEvent userInfo. + * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.userInfo = null; + + /** + * UserEvent uri. + * @member {string} uri + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.uri = ""; + + /** + * UserEvent referrerUri. + * @member {string} referrerUri + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.referrerUri = ""; + + /** + * UserEvent pageViewId. + * @member {string} pageViewId + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.pageViewId = ""; + + /** + * UserEvent entity. + * @member {string} entity + * @memberof google.cloud.retail.v2alpha.UserEvent + * @instance + */ + UserEvent.prototype.entity = ""; + + /** + * Creates a new UserEvent instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest instance + * @param {google.cloud.retail.v2alpha.IUserEvent=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent instance */ - GetCompletionConfigRequest.create = function create(properties) { - return new GetCompletionConfigRequest(properties); + UserEvent.create = function create(properties) { + return new UserEvent(properties); }; /** - * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * Encodes the specified UserEvent message. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCompletionConfigRequest.encode = function encode(message, writer) { + UserEvent.encode = function encode(message, writer) { 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.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.visitorId); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.experimentIds != null && message.experimentIds.length) + for (var i = 0; i < message.experimentIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.experimentIds[i]); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.productDetails != null && message.productDetails.length) + for (var i = 0; i < message.productDetails.length; ++i) + $root.google.cloud.retail.v2alpha.ProductDetail.encode(message.productDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.cartId != null && Object.hasOwnProperty.call(message, "cartId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cartId); + if (message.purchaseTransaction != null && Object.hasOwnProperty.call(message, "purchaseTransaction")) + $root.google.cloud.retail.v2alpha.PurchaseTransaction.encode(message.purchaseTransaction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.searchQuery != null && Object.hasOwnProperty.call(message, "searchQuery")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.searchQuery); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.pageCategories[i]); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.uri); + if (message.referrerUri != null && Object.hasOwnProperty.call(message, "referrerUri")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.referrerUri); + if (message.pageViewId != null && Object.hasOwnProperty.call(message, "pageViewId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.pageViewId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.orderBy); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.offset); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.sessionId); + if (message.completionDetail != null && Object.hasOwnProperty.call(message, "completionDetail")) + $root.google.cloud.retail.v2alpha.CompletionDetail.encode(message.completionDetail, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.entity); return writer; }; /** - * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * Encodes the specified UserEvent message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UserEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUserEvent} message UserEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + UserEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. + * Decodes a UserEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCompletionConfigRequest.decode = function decode(reader, length) { + UserEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UserEvent(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.eventType = reader.string(); + break; + } + case 2: { + message.visitorId = reader.string(); + break; + } + case 21: { + message.sessionId = reader.string(); + break; + } + case 3: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.experimentIds && message.experimentIds.length)) + message.experimentIds = []; + message.experimentIds.push(reader.string()); + break; + } + case 5: { + message.attributionToken = reader.string(); + break; + } + case 6: { + if (!(message.productDetails && message.productDetails.length)) + message.productDetails = []; + message.productDetails.push($root.google.cloud.retail.v2alpha.ProductDetail.decode(reader, reader.uint32())); + break; + } + case 22: { + message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.decode(reader, reader.uint32()); + break; + } + case 7: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 8: { + message.cartId = reader.string(); + break; + } + case 9: { + message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.decode(reader, reader.uint32()); + break; + } + case 10: { + message.searchQuery = reader.string(); + break; + } + case 16: { + message.filter = reader.string(); + break; + } + case 17: { + message.orderBy = reader.string(); + break; + } + case 18: { + message.offset = reader.int32(); + break; + } + case 11: { + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + } + case 12: { + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.uri = reader.string(); + break; + } + case 14: { + message.referrerUri = reader.string(); + break; + } + case 15: { + message.pageViewId = reader.string(); + break; + } + case 23: { + message.entity = reader.string(); break; } default: @@ -67846,123 +72243,367 @@ }; /** - * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a UserEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { + UserEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetCompletionConfigRequest message. + * Verifies a UserEvent message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetCompletionConfigRequest.verify = function verify(message) { + UserEvent.verify = function verify(message) { if (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.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.experimentIds != null && message.hasOwnProperty("experimentIds")) { + if (!Array.isArray(message.experimentIds)) + return "experimentIds: array expected"; + for (var i = 0; i < message.experimentIds.length; ++i) + if (!$util.isString(message.experimentIds[i])) + return "experimentIds: string[] expected"; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.productDetails != null && message.hasOwnProperty("productDetails")) { + if (!Array.isArray(message.productDetails)) + return "productDetails: array expected"; + for (var i = 0; i < message.productDetails.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.ProductDetail.verify(message.productDetails[i]); + if (error) + return "productDetails." + error; + } + } + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) { + var error = $root.google.cloud.retail.v2alpha.CompletionDetail.verify(message.completionDetail); + if (error) + return "completionDetail." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + if (!$util.isString(message.cartId)) + return "cartId: string expected"; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) { + var error = $root.google.cloud.retail.v2alpha.PurchaseTransaction.verify(message.purchaseTransaction); + if (error) + return "purchaseTransaction." + error; + } + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + if (!$util.isString(message.searchQuery)) + return "searchQuery: 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.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + if (!$util.isString(message.referrerUri)) + return "referrerUri: string expected"; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + if (!$util.isString(message.pageViewId)) + return "pageViewId: string expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; return null; }; /** - * Creates a GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UserEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.UserEvent} UserEvent */ - GetCompletionConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest) + UserEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UserEvent) return object; - var message = new $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2alpha.UserEvent(); + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.experimentIds) { + if (!Array.isArray(object.experimentIds)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.experimentIds: array expected"); + message.experimentIds = []; + for (var i = 0; i < object.experimentIds.length; ++i) + message.experimentIds[i] = String(object.experimentIds[i]); + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.productDetails) { + if (!Array.isArray(object.productDetails)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: array expected"); + message.productDetails = []; + for (var i = 0; i < object.productDetails.length; ++i) { + if (typeof object.productDetails[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.productDetails: object expected"); + message.productDetails[i] = $root.google.cloud.retail.v2alpha.ProductDetail.fromObject(object.productDetails[i]); + } + } + if (object.completionDetail != null) { + if (typeof object.completionDetail !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.completionDetail: object expected"); + message.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.fromObject(object.completionDetail); + } + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.cartId != null) + message.cartId = String(object.cartId); + if (object.purchaseTransaction != null) { + if (typeof object.purchaseTransaction !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.purchaseTransaction: object expected"); + message.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.fromObject(object.purchaseTransaction); + } + if (object.searchQuery != null) + message.searchQuery = String(object.searchQuery); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UserEvent.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.referrerUri != null) + message.referrerUri = String(object.referrerUri); + if (object.pageViewId != null) + message.pageViewId = String(object.pageViewId); + if (object.entity != null) + message.entity = String(object.entity); return message; }; /** - * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a UserEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static - * @param {google.cloud.retail.v2alpha.GetCompletionConfigRequest} message GetCompletionConfigRequest + * @param {google.cloud.retail.v2alpha.UserEvent} message UserEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCompletionConfigRequest.toObject = function toObject(message, options) { + UserEvent.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 (options.arrays || options.defaults) { + object.experimentIds = []; + object.productDetails = []; + object.pageCategories = []; + } + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.eventType = ""; + object.visitorId = ""; + object.eventTime = null; + object.attributionToken = ""; + object.cartId = ""; + object.purchaseTransaction = null; + object.searchQuery = ""; + object.userInfo = null; + object.uri = ""; + object.referrerUri = ""; + object.pageViewId = ""; + object.filter = ""; + object.orderBy = ""; + object.offset = 0; + object.sessionId = ""; + object.completionDetail = null; + object.entity = ""; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.experimentIds && message.experimentIds.length) { + object.experimentIds = []; + for (var j = 0; j < message.experimentIds.length; ++j) + object.experimentIds[j] = message.experimentIds[j]; + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.productDetails && message.productDetails.length) { + object.productDetails = []; + for (var j = 0; j < message.productDetails.length; ++j) + object.productDetails[j] = $root.google.cloud.retail.v2alpha.ProductDetail.toObject(message.productDetails[j], options); + } + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.cartId != null && message.hasOwnProperty("cartId")) + object.cartId = message.cartId; + if (message.purchaseTransaction != null && message.hasOwnProperty("purchaseTransaction")) + object.purchaseTransaction = $root.google.cloud.retail.v2alpha.PurchaseTransaction.toObject(message.purchaseTransaction, options); + if (message.searchQuery != null && message.hasOwnProperty("searchQuery")) + object.searchQuery = message.searchQuery; + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.referrerUri != null && message.hasOwnProperty("referrerUri")) + object.referrerUri = message.referrerUri; + if (message.pageViewId != null && message.hasOwnProperty("pageViewId")) + object.pageViewId = message.pageViewId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.completionDetail != null && message.hasOwnProperty("completionDetail")) + object.completionDetail = $root.google.cloud.retail.v2alpha.CompletionDetail.toObject(message.completionDetail, options); + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; return object; }; /** - * Converts this GetCompletionConfigRequest to JSON. + * Converts this UserEvent to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @instance * @returns {Object.} JSON object */ - GetCompletionConfigRequest.prototype.toJSON = function toJSON() { + UserEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetCompletionConfigRequest + * Gets the default type url for UserEvent * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.UserEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetCompletionConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UserEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetCompletionConfigRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UserEvent"; }; - return GetCompletionConfigRequest; + return UserEvent; })(); - v2alpha.UpdateCompletionConfigRequest = (function() { + v2alpha.ProductDetail = (function() { /** - * Properties of an UpdateCompletionConfigRequest. + * Properties of a ProductDetail. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateCompletionConfigRequest - * @property {google.cloud.retail.v2alpha.ICompletionConfig|null} [completionConfig] UpdateCompletionConfigRequest completionConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCompletionConfigRequest updateMask + * @interface IProductDetail + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] ProductDetail product + * @property {google.protobuf.IInt32Value|null} [quantity] ProductDetail quantity */ /** - * Constructs a new UpdateCompletionConfigRequest. + * Constructs a new ProductDetail. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateCompletionConfigRequest. - * @implements IUpdateCompletionConfigRequest + * @classdesc Represents a ProductDetail. + * @implements IProductDetail * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set */ - function UpdateCompletionConfigRequest(properties) { + function ProductDetail(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67970,89 +72611,89 @@ } /** - * UpdateCompletionConfigRequest completionConfig. - * @member {google.cloud.retail.v2alpha.ICompletionConfig|null|undefined} completionConfig - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * ProductDetail product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance */ - UpdateCompletionConfigRequest.prototype.completionConfig = null; + ProductDetail.prototype.product = null; /** - * UpdateCompletionConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * ProductDetail quantity. + * @member {google.protobuf.IInt32Value|null|undefined} quantity + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance */ - UpdateCompletionConfigRequest.prototype.updateMask = null; + ProductDetail.prototype.quantity = null; /** - * Creates a new UpdateCompletionConfigRequest instance using the specified properties. + * Creates a new ProductDetail instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest instance + * @param {google.cloud.retail.v2alpha.IProductDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail instance */ - UpdateCompletionConfigRequest.create = function create(properties) { - return new UpdateCompletionConfigRequest(properties); + ProductDetail.create = function create(properties) { + return new ProductDetail(properties); }; /** - * Encodes the specified UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. + * Encodes the specified ProductDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCompletionConfigRequest.encode = function encode(message, writer) { + ProductDetail.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionConfig != null && Object.hasOwnProperty.call(message, "completionConfig")) - $root.google.cloud.retail.v2alpha.CompletionConfig.encode(message.completionConfig, 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.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.google.protobuf.Int32Value.encode(message.quantity, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. + * Encodes the specified ProductDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ProductDetail.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProductDetail} message ProductDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + ProductDetail.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. + * Decodes a ProductDetail message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCompletionConfigRequest.decode = function decode(reader, length) { + ProductDetail.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ProductDetail(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.decode(reader, reader.uint32()); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.quantity = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); break; } default: @@ -68064,141 +72705,143 @@ }; /** - * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a ProductDetail message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { + ProductDetail.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateCompletionConfigRequest message. + * Verifies a ProductDetail message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateCompletionConfigRequest.verify = function verify(message) { + ProductDetail.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) { - var error = $root.google.cloud.retail.v2alpha.CompletionConfig.verify(message.completionConfig); + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); if (error) - return "completionConfig." + error; + return "product." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.google.protobuf.Int32Value.verify(message.quantity); if (error) - return "updateMask." + error; + return "quantity." + error; } return null; }; /** - * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ProductDetail message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest + * @returns {google.cloud.retail.v2alpha.ProductDetail} ProductDetail */ - UpdateCompletionConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) + ProductDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ProductDetail) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(); - if (object.completionConfig != null) { - if (typeof object.completionConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.completionConfig: object expected"); - message.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.fromObject(object.completionConfig); + var message = new $root.google.cloud.retail.v2alpha.ProductDetail(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ProductDetail.quantity: object expected"); + message.quantity = $root.google.protobuf.Int32Value.fromObject(object.quantity); } return message; }; /** - * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a ProductDetail message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static - * @param {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} message UpdateCompletionConfigRequest + * @param {google.cloud.retail.v2alpha.ProductDetail} message ProductDetail * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCompletionConfigRequest.toObject = function toObject(message, options) { + ProductDetail.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.completionConfig = null; - object.updateMask = null; + object.product = null; + object.quantity = null; } - if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) - object.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.toObject(message.completionConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.google.protobuf.Int32Value.toObject(message.quantity, options); return object; }; /** - * Converts this UpdateCompletionConfigRequest to JSON. + * Converts this ProductDetail to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @instance * @returns {Object.} JSON object */ - UpdateCompletionConfigRequest.prototype.toJSON = function toJSON() { + ProductDetail.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateCompletionConfigRequest + * Gets the default type url for ProductDetail * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest + * @memberof google.cloud.retail.v2alpha.ProductDetail * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateCompletionConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ProductDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateCompletionConfigRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ProductDetail"; }; - return UpdateCompletionConfigRequest; + return ProductDetail; })(); - v2alpha.GetAttributesConfigRequest = (function() { + v2alpha.CompletionDetail = (function() { /** - * Properties of a GetAttributesConfigRequest. + * Properties of a CompletionDetail. * @memberof google.cloud.retail.v2alpha - * @interface IGetAttributesConfigRequest - * @property {string|null} [name] GetAttributesConfigRequest name + * @interface ICompletionDetail + * @property {string|null} [completionAttributionToken] CompletionDetail completionAttributionToken + * @property {string|null} [selectedSuggestion] CompletionDetail selectedSuggestion + * @property {number|null} [selectedPosition] CompletionDetail selectedPosition */ /** - * Constructs a new GetAttributesConfigRequest. + * Constructs a new CompletionDetail. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetAttributesConfigRequest. - * @implements IGetAttributesConfigRequest + * @classdesc Represents a CompletionDetail. + * @implements ICompletionDetail * @constructor - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set */ - function GetAttributesConfigRequest(properties) { + function CompletionDetail(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68206,75 +72849,103 @@ } /** - * GetAttributesConfigRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * CompletionDetail completionAttributionToken. + * @member {string} completionAttributionToken + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @instance */ - GetAttributesConfigRequest.prototype.name = ""; + CompletionDetail.prototype.completionAttributionToken = ""; /** - * Creates a new GetAttributesConfigRequest instance using the specified properties. + * CompletionDetail selectedSuggestion. + * @member {string} selectedSuggestion + * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @instance + */ + CompletionDetail.prototype.selectedSuggestion = ""; + + /** + * CompletionDetail selectedPosition. + * @member {number} selectedPosition + * @memberof google.cloud.retail.v2alpha.CompletionDetail + * @instance + */ + CompletionDetail.prototype.selectedPosition = 0; + + /** + * Creates a new CompletionDetail instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest instance + * @param {google.cloud.retail.v2alpha.ICompletionDetail=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail instance */ - GetAttributesConfigRequest.create = function create(properties) { - return new GetAttributesConfigRequest(properties); + CompletionDetail.create = function create(properties) { + return new CompletionDetail(properties); }; /** - * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. + * Encodes the specified CompletionDetail message. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAttributesConfigRequest.encode = function encode(message, writer) { + CompletionDetail.encode = function encode(message, writer) { 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.completionAttributionToken != null && Object.hasOwnProperty.call(message, "completionAttributionToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.completionAttributionToken); + if (message.selectedSuggestion != null && Object.hasOwnProperty.call(message, "selectedSuggestion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedSuggestion); + if (message.selectedPosition != null && Object.hasOwnProperty.call(message, "selectedPosition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.selectedPosition); return writer; }; /** - * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. + * Encodes the specified CompletionDetail message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompletionDetail.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICompletionDetail} message CompletionDetail message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompletionDetail.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetAttributesConfigRequest message from the specified reader or buffer. + * Decodes a CompletionDetail message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAttributesConfigRequest.decode = function decode(reader, length) { + CompletionDetail.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.completionAttributionToken = reader.string(); + break; + } + case 2: { + message.selectedSuggestion = reader.string(); + break; + } + case 3: { + message.selectedPosition = reader.int32(); break; } default: @@ -68286,123 +72957,143 @@ }; /** - * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a CompletionDetail message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { + CompletionDetail.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetAttributesConfigRequest message. + * Verifies a CompletionDetail message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetAttributesConfigRequest.verify = function verify(message) { + CompletionDetail.verify = function verify(message) { if (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.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + if (!$util.isString(message.completionAttributionToken)) + return "completionAttributionToken: string expected"; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + if (!$util.isString(message.selectedSuggestion)) + return "selectedSuggestion: string expected"; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + if (!$util.isInteger(message.selectedPosition)) + return "selectedPosition: integer expected"; return null; }; /** - * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompletionDetail message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.CompletionDetail} CompletionDetail */ - GetAttributesConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest) + CompletionDetail.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompletionDetail) return object; - var message = new $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2alpha.CompletionDetail(); + if (object.completionAttributionToken != null) + message.completionAttributionToken = String(object.completionAttributionToken); + if (object.selectedSuggestion != null) + message.selectedSuggestion = String(object.selectedSuggestion); + if (object.selectedPosition != null) + message.selectedPosition = object.selectedPosition | 0; return message; }; /** - * Creates a plain object from a GetAttributesConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompletionDetail message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static - * @param {google.cloud.retail.v2alpha.GetAttributesConfigRequest} message GetAttributesConfigRequest + * @param {google.cloud.retail.v2alpha.CompletionDetail} message CompletionDetail * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetAttributesConfigRequest.toObject = function toObject(message, options) { + CompletionDetail.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 (options.defaults) { + object.completionAttributionToken = ""; + object.selectedSuggestion = ""; + object.selectedPosition = 0; + } + if (message.completionAttributionToken != null && message.hasOwnProperty("completionAttributionToken")) + object.completionAttributionToken = message.completionAttributionToken; + if (message.selectedSuggestion != null && message.hasOwnProperty("selectedSuggestion")) + object.selectedSuggestion = message.selectedSuggestion; + if (message.selectedPosition != null && message.hasOwnProperty("selectedPosition")) + object.selectedPosition = message.selectedPosition; return object; }; /** - * Converts this GetAttributesConfigRequest to JSON. + * Converts this CompletionDetail to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @instance * @returns {Object.} JSON object */ - GetAttributesConfigRequest.prototype.toJSON = function toJSON() { + CompletionDetail.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetAttributesConfigRequest + * Gets the default type url for CompletionDetail * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.CompletionDetail * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetAttributesConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CompletionDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetAttributesConfigRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompletionDetail"; }; - return GetAttributesConfigRequest; + return CompletionDetail; })(); - v2alpha.UpdateAttributesConfigRequest = (function() { + v2alpha.PurchaseTransaction = (function() { /** - * Properties of an UpdateAttributesConfigRequest. + * Properties of a PurchaseTransaction. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateAttributesConfigRequest - * @property {google.cloud.retail.v2alpha.IAttributesConfig|null} [attributesConfig] UpdateAttributesConfigRequest attributesConfig - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributesConfigRequest updateMask + * @interface IPurchaseTransaction + * @property {string|null} [id] PurchaseTransaction id + * @property {number|null} [revenue] PurchaseTransaction revenue + * @property {number|null} [tax] PurchaseTransaction tax + * @property {number|null} [cost] PurchaseTransaction cost + * @property {string|null} [currencyCode] PurchaseTransaction currencyCode */ /** - * Constructs a new UpdateAttributesConfigRequest. + * Constructs a new PurchaseTransaction. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateAttributesConfigRequest. - * @implements IUpdateAttributesConfigRequest + * @classdesc Represents a PurchaseTransaction. + * @implements IPurchaseTransaction * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set */ - function UpdateAttributesConfigRequest(properties) { + function PurchaseTransaction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68410,89 +73101,131 @@ } /** - * UpdateAttributesConfigRequest attributesConfig. - * @member {google.cloud.retail.v2alpha.IAttributesConfig|null|undefined} attributesConfig - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * PurchaseTransaction id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance */ - UpdateAttributesConfigRequest.prototype.attributesConfig = null; + PurchaseTransaction.prototype.id = ""; /** - * UpdateAttributesConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * PurchaseTransaction revenue. + * @member {number} revenue + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance */ - UpdateAttributesConfigRequest.prototype.updateMask = null; + PurchaseTransaction.prototype.revenue = 0; /** - * Creates a new UpdateAttributesConfigRequest instance using the specified properties. + * PurchaseTransaction tax. + * @member {number} tax + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.tax = 0; + + /** + * PurchaseTransaction cost. + * @member {number} cost + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.cost = 0; + + /** + * PurchaseTransaction currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction + * @instance + */ + PurchaseTransaction.prototype.currencyCode = ""; + + /** + * Creates a new PurchaseTransaction instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest instance + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction instance */ - UpdateAttributesConfigRequest.create = function create(properties) { - return new UpdateAttributesConfigRequest(properties); + PurchaseTransaction.create = function create(properties) { + return new PurchaseTransaction(properties); }; /** - * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * Encodes the specified PurchaseTransaction message. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateAttributesConfigRequest.encode = function encode(message, writer) { + PurchaseTransaction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) - $root.google.cloud.retail.v2alpha.AttributesConfig.encode(message.attributesConfig, 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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.revenue != null && Object.hasOwnProperty.call(message, "revenue")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.revenue); + if (message.tax != null && Object.hasOwnProperty.call(message, "tax")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.tax); + if (message.cost != null && Object.hasOwnProperty.call(message, "cost")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.cost); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); return writer; }; /** - * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * Encodes the specified PurchaseTransaction message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurchaseTransaction.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurchaseTransaction} message PurchaseTransaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + PurchaseTransaction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer. + * Decodes a PurchaseTransaction message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateAttributesConfigRequest.decode = function decode(reader, length) { + PurchaseTransaction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.decode(reader, reader.uint32()); + message.id = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.revenue = reader.float(); + break; + } + case 3: { + message.tax = reader.float(); + break; + } + case 4: { + message.cost = reader.float(); + break; + } + case 5: { + message.currencyCode = reader.string(); break; } default: @@ -68504,142 +73237,588 @@ }; /** - * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a PurchaseTransaction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { + PurchaseTransaction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateAttributesConfigRequest message. + * Verifies a PurchaseTransaction message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateAttributesConfigRequest.verify = function verify(message) { + PurchaseTransaction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) { - var error = $root.google.cloud.retail.v2alpha.AttributesConfig.verify(message.attributesConfig); - if (error) - return "attributesConfig." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.revenue != null && message.hasOwnProperty("revenue")) + if (typeof message.revenue !== "number") + return "revenue: number expected"; + if (message.tax != null && message.hasOwnProperty("tax")) + if (typeof message.tax !== "number") + return "tax: number expected"; + if (message.cost != null && message.hasOwnProperty("cost")) + if (typeof message.cost !== "number") + return "cost: number expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; return null; }; /** - * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurchaseTransaction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @returns {google.cloud.retail.v2alpha.PurchaseTransaction} PurchaseTransaction */ - UpdateAttributesConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + PurchaseTransaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurchaseTransaction) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(); - if (object.attributesConfig != null) { - if (typeof object.attributesConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.attributesConfig: object expected"); - message.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.fromObject(object.attributesConfig); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.retail.v2alpha.PurchaseTransaction(); + if (object.id != null) + message.id = String(object.id); + if (object.revenue != null) + message.revenue = Number(object.revenue); + if (object.tax != null) + message.tax = Number(object.tax); + if (object.cost != null) + message.cost = Number(object.cost); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); return message; }; /** - * Creates a plain object from an UpdateAttributesConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a PurchaseTransaction message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static - * @param {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} message UpdateAttributesConfigRequest + * @param {google.cloud.retail.v2alpha.PurchaseTransaction} message PurchaseTransaction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateAttributesConfigRequest.toObject = function toObject(message, options) { + PurchaseTransaction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.attributesConfig = null; - object.updateMask = null; + object.id = ""; + object.revenue = 0; + object.tax = 0; + object.cost = 0; + object.currencyCode = ""; } - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - object.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.toObject(message.attributesConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.revenue != null && message.hasOwnProperty("revenue")) + object.revenue = options.json && !isFinite(message.revenue) ? String(message.revenue) : message.revenue; + if (message.tax != null && message.hasOwnProperty("tax")) + object.tax = options.json && !isFinite(message.tax) ? String(message.tax) : message.tax; + if (message.cost != null && message.hasOwnProperty("cost")) + object.cost = options.json && !isFinite(message.cost) ? String(message.cost) : message.cost; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; return object; }; /** - * Converts this UpdateAttributesConfigRequest to JSON. + * Converts this PurchaseTransaction to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @instance * @returns {Object.} JSON object */ - UpdateAttributesConfigRequest.prototype.toJSON = function toJSON() { + PurchaseTransaction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateAttributesConfigRequest + * Gets the default type url for PurchaseTransaction * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @memberof google.cloud.retail.v2alpha.PurchaseTransaction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateAttributesConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurchaseTransaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateAttributesConfigRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurchaseTransaction"; }; - return UpdateAttributesConfigRequest; + return PurchaseTransaction; })(); - v2alpha.AddCatalogAttributeRequest = (function() { + v2alpha.CatalogService = (function() { /** - * Properties of an AddCatalogAttributeRequest. + * Constructs a new CatalogService service. * @memberof google.cloud.retail.v2alpha - * @interface IAddCatalogAttributeRequest - * @property {string|null} [attributesConfig] AddCatalogAttributeRequest attributesConfig - * @property {google.cloud.retail.v2alpha.ICatalogAttribute|null} [catalogAttribute] AddCatalogAttributeRequest catalogAttribute + * @classdesc Represents a CatalogService + * @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 CatalogService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CatalogService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CatalogService; + + /** + * Creates new CatalogService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.CatalogService + * @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 {CatalogService} RPC service. Useful where requests and/or responses are streamed. + */ + CatalogService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|listCatalogs}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef ListCatalogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} [response] ListCatalogsResponse */ /** - * Constructs a new AddCatalogAttributeRequest. + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.ListCatalogsCallback} callback Node-style callback called with the error, if any, and ListCatalogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.listCatalogs = function listCatalogs(request, callback) { + return this.rpcCall(listCatalogs, $root.google.cloud.retail.v2alpha.ListCatalogsRequest, $root.google.cloud.retail.v2alpha.ListCatalogsResponse, request, callback); + }, "name", { value: "ListCatalogs" }); + + /** + * Calls ListCatalogs. + * @function listCatalogs + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} request ListCatalogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCatalog}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef UpdateCatalogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Catalog} [response] Catalog + */ + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCatalogCallback} callback Node-style callback called with the error, if any, and Catalog + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateCatalog = function updateCatalog(request, callback) { + return this.rpcCall(updateCatalog, $root.google.cloud.retail.v2alpha.UpdateCatalogRequest, $root.google.cloud.retail.v2alpha.Catalog, request, callback); + }, "name", { value: "UpdateCatalog" }); + + /** + * Calls UpdateCatalog. + * @function updateCatalog + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} request UpdateCatalogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|setDefaultBranch}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef SetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.SetDefaultBranchCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.setDefaultBranch = function setDefaultBranch(request, callback) { + return this.rpcCall(setDefaultBranch, $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "SetDefaultBranch" }); + + /** + * Calls SetDefaultBranch. + * @function setDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} request SetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getDefaultBranch}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef GetDefaultBranchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} [response] GetDefaultBranchResponse + */ + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.GetDefaultBranchCallback} callback Node-style callback called with the error, if any, and GetDefaultBranchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getDefaultBranch = function getDefaultBranch(request, callback) { + return this.rpcCall(getDefaultBranch, $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest, $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse, request, callback); + }, "name", { value: "GetDefaultBranch" }); + + /** + * Calls GetDefaultBranch. + * @function getDefaultBranch + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} request GetDefaultBranchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getCompletionConfig}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef GetCompletionConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.CompletionConfig} [response] CompletionConfig + */ + + /** + * Calls GetCompletionConfig. + * @function getCompletionConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.GetCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getCompletionConfig = function getCompletionConfig(request, callback) { + return this.rpcCall(getCompletionConfig, $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest, $root.google.cloud.retail.v2alpha.CompletionConfig, request, callback); + }, "name", { value: "GetCompletionConfig" }); + + /** + * Calls GetCompletionConfig. + * @function getCompletionConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} request GetCompletionConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateCompletionConfig}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef UpdateCompletionConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.CompletionConfig} [response] CompletionConfig + */ + + /** + * Calls UpdateCompletionConfig. + * @function updateCompletionConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.UpdateCompletionConfigCallback} callback Node-style callback called with the error, if any, and CompletionConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateCompletionConfig = function updateCompletionConfig(request, callback) { + return this.rpcCall(updateCompletionConfig, $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest, $root.google.cloud.retail.v2alpha.CompletionConfig, request, callback); + }, "name", { value: "UpdateCompletionConfig" }); + + /** + * Calls UpdateCompletionConfig. + * @function updateCompletionConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} request UpdateCompletionConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|getAttributesConfig}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef GetAttributesConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls GetAttributesConfig. + * @function getAttributesConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.GetAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.getAttributesConfig = function getAttributesConfig(request, callback) { + return this.rpcCall(getAttributesConfig, $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); + }, "name", { value: "GetAttributesConfig" }); + + /** + * Calls GetAttributesConfig. + * @function getAttributesConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} request GetAttributesConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|updateAttributesConfig}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef UpdateAttributesConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls UpdateAttributesConfig. + * @function updateAttributesConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.UpdateAttributesConfigCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.updateAttributesConfig = function updateAttributesConfig(request, callback) { + return this.rpcCall(updateAttributesConfig, $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); + }, "name", { value: "UpdateAttributesConfig" }); + + /** + * Calls UpdateAttributesConfig. + * @function updateAttributesConfig + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} request UpdateAttributesConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|addCatalogAttribute}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef AddCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls AddCatalogAttribute. + * @function addCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.AddCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.addCatalogAttribute = function addCatalogAttribute(request, callback) { + return this.rpcCall(addCatalogAttribute, $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); + }, "name", { value: "AddCatalogAttribute" }); + + /** + * Calls AddCatalogAttribute. + * @function addCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} request AddCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|removeCatalogAttribute}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef RemoveCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls RemoveCatalogAttribute. + * @function removeCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.RemoveCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.removeCatalogAttribute = function removeCatalogAttribute(request, callback) { + return this.rpcCall(removeCatalogAttribute, $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); + }, "name", { value: "RemoveCatalogAttribute" }); + + /** + * Calls RemoveCatalogAttribute. + * @function removeCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} request RemoveCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|batchRemoveCatalogAttributes}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef BatchRemoveCatalogAttributesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} [response] BatchRemoveCatalogAttributesResponse + */ + + /** + * Calls BatchRemoveCatalogAttributes. + * @function batchRemoveCatalogAttributes + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.BatchRemoveCatalogAttributesCallback} callback Node-style callback called with the error, if any, and BatchRemoveCatalogAttributesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.batchRemoveCatalogAttributes = function batchRemoveCatalogAttributes(request, callback) { + return this.rpcCall(batchRemoveCatalogAttributes, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest, $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse, request, callback); + }, "name", { value: "BatchRemoveCatalogAttributes" }); + + /** + * Calls BatchRemoveCatalogAttributes. + * @function batchRemoveCatalogAttributes + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} request BatchRemoveCatalogAttributesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CatalogService|replaceCatalogAttribute}. + * @memberof google.cloud.retail.v2alpha.CatalogService + * @typedef ReplaceCatalogAttributeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AttributesConfig} [response] AttributesConfig + */ + + /** + * Calls ReplaceCatalogAttribute. + * @function replaceCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object + * @param {google.cloud.retail.v2alpha.CatalogService.ReplaceCatalogAttributeCallback} callback Node-style callback called with the error, if any, and AttributesConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CatalogService.prototype.replaceCatalogAttribute = function replaceCatalogAttribute(request, callback) { + return this.rpcCall(replaceCatalogAttribute, $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest, $root.google.cloud.retail.v2alpha.AttributesConfig, request, callback); + }, "name", { value: "ReplaceCatalogAttribute" }); + + /** + * Calls ReplaceCatalogAttribute. + * @function replaceCatalogAttribute + * @memberof google.cloud.retail.v2alpha.CatalogService + * @instance + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} request ReplaceCatalogAttributeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CatalogService; + })(); + + v2alpha.ListCatalogsRequest = (function() { + + /** + * Properties of a ListCatalogsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddCatalogAttributeRequest. - * @implements IAddCatalogAttributeRequest + * @interface IListCatalogsRequest + * @property {string|null} [parent] ListCatalogsRequest parent + * @property {number|null} [pageSize] ListCatalogsRequest pageSize + * @property {string|null} [pageToken] ListCatalogsRequest pageToken + */ + + /** + * Constructs a new ListCatalogsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListCatalogsRequest. + * @implements IListCatalogsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set */ - function AddCatalogAttributeRequest(properties) { + function ListCatalogsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68647,89 +73826,103 @@ } /** - * AddCatalogAttributeRequest attributesConfig. - * @member {string} attributesConfig - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * ListCatalogsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance */ - AddCatalogAttributeRequest.prototype.attributesConfig = ""; + ListCatalogsRequest.prototype.parent = ""; /** - * AddCatalogAttributeRequest catalogAttribute. - * @member {google.cloud.retail.v2alpha.ICatalogAttribute|null|undefined} catalogAttribute - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * ListCatalogsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance */ - AddCatalogAttributeRequest.prototype.catalogAttribute = null; + ListCatalogsRequest.prototype.pageSize = 0; /** - * Creates a new AddCatalogAttributeRequest instance using the specified properties. + * ListCatalogsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest + * @instance + */ + ListCatalogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCatalogsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest instance + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest instance */ - AddCatalogAttributeRequest.create = function create(properties) { - return new AddCatalogAttributeRequest(properties); + ListCatalogsRequest.create = function create(properties) { + return new ListCatalogsRequest(properties); }; /** - * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified ListCatalogsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddCatalogAttributeRequest.encode = function encode(message, writer) { + ListCatalogsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); - if (message.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) - $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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 AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified ListCatalogsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsRequest} message ListCatalogsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListCatalogsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. + * Decodes a ListCatalogsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddCatalogAttributeRequest.decode = function decode(reader, length) { + ListCatalogsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.attributesConfig = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -68741,137 +73934,141 @@ }; /** - * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + ListCatalogsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddCatalogAttributeRequest message. + * Verifies a ListCatalogsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddCatalogAttributeRequest.verify = function verify(message) { + ListCatalogsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - if (!$util.isString(message.attributesConfig)) - return "attributesConfig: string expected"; - if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { - var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttribute); - if (error) - return "catalogAttribute." + error; - } - return null; - }; - - /** - * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + 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 ListCatalogsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsRequest} ListCatalogsRequest */ - AddCatalogAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + ListCatalogsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(); - if (object.attributesConfig != null) - message.attributesConfig = String(object.attributesConfig); - if (object.catalogAttribute != null) { - if (typeof object.catalogAttribute !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddCatalogAttributeRequest.catalogAttribute: object expected"); - message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttribute); - } + var message = new $root.google.cloud.retail.v2alpha.ListCatalogsRequest(); + 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 an AddCatalogAttributeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListCatalogsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static - * @param {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} message AddCatalogAttributeRequest + * @param {google.cloud.retail.v2alpha.ListCatalogsRequest} message ListCatalogsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddCatalogAttributeRequest.toObject = function toObject(message, options) { + ListCatalogsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.attributesConfig = ""; - object.catalogAttribute = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - object.attributesConfig = message.attributesConfig; - if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) - object.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttribute, options); + 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 AddCatalogAttributeRequest to JSON. + * Converts this ListCatalogsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @instance * @returns {Object.} JSON object */ - AddCatalogAttributeRequest.prototype.toJSON = function toJSON() { + ListCatalogsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddCatalogAttributeRequest + * Gets the default type url for ListCatalogsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListCatalogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddCatalogAttributeRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListCatalogsRequest"; }; - return AddCatalogAttributeRequest; + return ListCatalogsRequest; })(); - v2alpha.RemoveCatalogAttributeRequest = (function() { + v2alpha.ListCatalogsResponse = (function() { /** - * Properties of a RemoveCatalogAttributeRequest. + * Properties of a ListCatalogsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveCatalogAttributeRequest - * @property {string|null} [attributesConfig] RemoveCatalogAttributeRequest attributesConfig - * @property {string|null} [key] RemoveCatalogAttributeRequest key + * @interface IListCatalogsResponse + * @property {Array.|null} [catalogs] ListCatalogsResponse catalogs + * @property {string|null} [nextPageToken] ListCatalogsResponse nextPageToken */ /** - * Constructs a new RemoveCatalogAttributeRequest. + * Constructs a new ListCatalogsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveCatalogAttributeRequest. - * @implements IRemoveCatalogAttributeRequest + * @classdesc Represents a ListCatalogsResponse. + * @implements IListCatalogsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set */ - function RemoveCatalogAttributeRequest(properties) { + function ListCatalogsResponse(properties) { + this.catalogs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68879,89 +74076,92 @@ } /** - * RemoveCatalogAttributeRequest attributesConfig. - * @member {string} attributesConfig - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * ListCatalogsResponse catalogs. + * @member {Array.} catalogs + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance */ - RemoveCatalogAttributeRequest.prototype.attributesConfig = ""; + ListCatalogsResponse.prototype.catalogs = $util.emptyArray; /** - * RemoveCatalogAttributeRequest key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * ListCatalogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance */ - RemoveCatalogAttributeRequest.prototype.key = ""; + ListCatalogsResponse.prototype.nextPageToken = ""; /** - * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. + * Creates a new ListCatalogsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest instance + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse instance */ - RemoveCatalogAttributeRequest.create = function create(properties) { - return new RemoveCatalogAttributeRequest(properties); + ListCatalogsResponse.create = function create(properties) { + return new ListCatalogsResponse(properties); }; /** - * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified ListCatalogsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveCatalogAttributeRequest.encode = function encode(message, writer) { + ListCatalogsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.catalogs != null && message.catalogs.length) + for (var i = 0; i < message.catalogs.length; ++i) + $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalogs[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 RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified ListCatalogsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListCatalogsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListCatalogsResponse} message ListCatalogsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListCatalogsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. + * Decodes a ListCatalogsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveCatalogAttributeRequest.decode = function decode(reader, length) { + ListCatalogsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.attributesConfig = reader.string(); + if (!(message.catalogs && message.catalogs.length)) + message.catalogs = []; + message.catalogs.push($root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32())); break; } case 2: { - message.key = reader.string(); + message.nextPageToken = reader.string(); break; } default: @@ -68973,133 +74173,149 @@ }; /** - * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCatalogsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + ListCatalogsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveCatalogAttributeRequest message. + * Verifies a ListCatalogsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveCatalogAttributeRequest.verify = function verify(message) { + ListCatalogsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - if (!$util.isString(message.attributesConfig)) - return "attributesConfig: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; + if (message.catalogs != null && message.hasOwnProperty("catalogs")) { + if (!Array.isArray(message.catalogs)) + return "catalogs: array expected"; + for (var i = 0; i < message.catalogs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalogs[i]); + if (error) + return "catalogs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListCatalogsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.ListCatalogsResponse} ListCatalogsResponse */ - RemoveCatalogAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) + ListCatalogsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListCatalogsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(); - if (object.attributesConfig != null) - message.attributesConfig = String(object.attributesConfig); - if (object.key != null) - message.key = String(object.key); + var message = new $root.google.cloud.retail.v2alpha.ListCatalogsResponse(); + if (object.catalogs) { + if (!Array.isArray(object.catalogs)) + throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: array expected"); + message.catalogs = []; + for (var i = 0; i < object.catalogs.length; ++i) { + if (typeof object.catalogs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListCatalogsResponse.catalogs: object expected"); + message.catalogs[i] = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalogs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListCatalogsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static - * @param {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest + * @param {google.cloud.retail.v2alpha.ListCatalogsResponse} message ListCatalogsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveCatalogAttributeRequest.toObject = function toObject(message, options) { + ListCatalogsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.attributesConfig = ""; - object.key = ""; + if (options.arrays || options.defaults) + object.catalogs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.catalogs && message.catalogs.length) { + object.catalogs = []; + for (var j = 0; j < message.catalogs.length; ++j) + object.catalogs[j] = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalogs[j], options); } - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - object.attributesConfig = message.attributesConfig; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this RemoveCatalogAttributeRequest to JSON. + * Converts this ListCatalogsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @instance * @returns {Object.} JSON object */ - RemoveCatalogAttributeRequest.prototype.toJSON = function toJSON() { + ListCatalogsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveCatalogAttributeRequest + * Gets the default type url for ListCatalogsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.ListCatalogsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListCatalogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListCatalogsResponse"; }; - return RemoveCatalogAttributeRequest; + return ListCatalogsResponse; })(); - v2alpha.BatchRemoveCatalogAttributesRequest = (function() { + v2alpha.UpdateCatalogRequest = (function() { /** - * Properties of a BatchRemoveCatalogAttributesRequest. + * Properties of an UpdateCatalogRequest. * @memberof google.cloud.retail.v2alpha - * @interface IBatchRemoveCatalogAttributesRequest - * @property {string|null} [attributesConfig] BatchRemoveCatalogAttributesRequest attributesConfig - * @property {Array.|null} [attributeKeys] BatchRemoveCatalogAttributesRequest attributeKeys + * @interface IUpdateCatalogRequest + * @property {google.cloud.retail.v2alpha.ICatalog|null} [catalog] UpdateCatalogRequest catalog + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCatalogRequest updateMask */ /** - * Constructs a new BatchRemoveCatalogAttributesRequest. + * Constructs a new UpdateCatalogRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a BatchRemoveCatalogAttributesRequest. - * @implements IBatchRemoveCatalogAttributesRequest + * @classdesc Represents an UpdateCatalogRequest. + * @implements IUpdateCatalogRequest * @constructor - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set */ - function BatchRemoveCatalogAttributesRequest(properties) { - this.attributeKeys = []; + function UpdateCatalogRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69107,92 +74323,89 @@ } /** - * BatchRemoveCatalogAttributesRequest attributesConfig. - * @member {string} attributesConfig - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * UpdateCatalogRequest catalog. + * @member {google.cloud.retail.v2alpha.ICatalog|null|undefined} catalog + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance */ - BatchRemoveCatalogAttributesRequest.prototype.attributesConfig = ""; + UpdateCatalogRequest.prototype.catalog = null; /** - * BatchRemoveCatalogAttributesRequest attributeKeys. - * @member {Array.} attributeKeys - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * UpdateCatalogRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance */ - BatchRemoveCatalogAttributesRequest.prototype.attributeKeys = $util.emptyArray; + UpdateCatalogRequest.prototype.updateMask = null; /** - * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * Creates a new UpdateCatalogRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest instance + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest instance */ - BatchRemoveCatalogAttributesRequest.create = function create(properties) { - return new BatchRemoveCatalogAttributesRequest(properties); + UpdateCatalogRequest.create = function create(properties) { + return new UpdateCatalogRequest(properties); }; /** - * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * Encodes the specified UpdateCatalogRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchRemoveCatalogAttributesRequest.encode = function encode(message, writer) { + UpdateCatalogRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); - if (message.attributeKeys != null && message.attributeKeys.length) - for (var i = 0; i < message.attributeKeys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeKeys[i]); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + $root.google.cloud.retail.v2alpha.Catalog.encode(message.catalog, 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 BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * Encodes the specified UpdateCatalogRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCatalogRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCatalogRequest} message UpdateCatalogRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchRemoveCatalogAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateCatalogRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchRemoveCatalogAttributesRequest.decode = function decode(reader, length) { + UpdateCatalogRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.attributesConfig = reader.string(); + message.catalog = $root.google.cloud.retail.v2alpha.Catalog.decode(reader, reader.uint32()); break; } case 2: { - if (!(message.attributeKeys && message.attributeKeys.length)) - message.attributeKeys = []; - message.attributeKeys.push(reader.string()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -69204,146 +74417,144 @@ }; /** - * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateCatalogRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchRemoveCatalogAttributesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateCatalogRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchRemoveCatalogAttributesRequest message. + * Verifies an UpdateCatalogRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchRemoveCatalogAttributesRequest.verify = function verify(message) { + UpdateCatalogRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - if (!$util.isString(message.attributesConfig)) - return "attributesConfig: string expected"; - if (message.attributeKeys != null && message.hasOwnProperty("attributeKeys")) { - if (!Array.isArray(message.attributeKeys)) - return "attributeKeys: array expected"; - for (var i = 0; i < message.attributeKeys.length; ++i) - if (!$util.isString(message.attributeKeys[i])) - return "attributeKeys: string[] expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) { + var error = $root.google.cloud.retail.v2alpha.Catalog.verify(message.catalog); + if (error) + return "catalog." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCatalogRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @returns {google.cloud.retail.v2alpha.UpdateCatalogRequest} UpdateCatalogRequest */ - BatchRemoveCatalogAttributesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest) + UpdateCatalogRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCatalogRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); - if (object.attributesConfig != null) - message.attributesConfig = String(object.attributesConfig); - if (object.attributeKeys) { - if (!Array.isArray(object.attributeKeys)) - throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.attributeKeys: array expected"); - message.attributeKeys = []; - for (var i = 0; i < object.attributeKeys.length; ++i) - message.attributeKeys[i] = String(object.attributeKeys[i]); + var message = new $root.google.cloud.retail.v2alpha.UpdateCatalogRequest(); + if (object.catalog != null) { + if (typeof object.catalog !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.catalog: object expected"); + message.catalog = $root.google.cloud.retail.v2alpha.Catalog.fromObject(object.catalog); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCatalogRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateCatalogRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static - * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest + * @param {google.cloud.retail.v2alpha.UpdateCatalogRequest} message UpdateCatalogRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchRemoveCatalogAttributesRequest.toObject = function toObject(message, options) { + UpdateCatalogRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.attributeKeys = []; - if (options.defaults) - object.attributesConfig = ""; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - object.attributesConfig = message.attributesConfig; - if (message.attributeKeys && message.attributeKeys.length) { - object.attributeKeys = []; - for (var j = 0; j < message.attributeKeys.length; ++j) - object.attributeKeys[j] = message.attributeKeys[j]; + if (options.defaults) { + object.catalog = null; + object.updateMask = null; } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = $root.google.cloud.retail.v2alpha.Catalog.toObject(message.catalog, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this BatchRemoveCatalogAttributesRequest to JSON. + * Converts this UpdateCatalogRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @instance * @returns {Object.} JSON object */ - BatchRemoveCatalogAttributesRequest.prototype.toJSON = function toJSON() { + UpdateCatalogRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchRemoveCatalogAttributesRequest + * Gets the default type url for UpdateCatalogRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @memberof google.cloud.retail.v2alpha.UpdateCatalogRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchRemoveCatalogAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateCatalogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateCatalogRequest"; }; - return BatchRemoveCatalogAttributesRequest; + return UpdateCatalogRequest; })(); - v2alpha.BatchRemoveCatalogAttributesResponse = (function() { + v2alpha.SetDefaultBranchRequest = (function() { /** - * Properties of a BatchRemoveCatalogAttributesResponse. + * Properties of a SetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @interface IBatchRemoveCatalogAttributesResponse - * @property {Array.|null} [deletedCatalogAttributes] BatchRemoveCatalogAttributesResponse deletedCatalogAttributes - * @property {Array.|null} [resetCatalogAttributes] BatchRemoveCatalogAttributesResponse resetCatalogAttributes + * @interface ISetDefaultBranchRequest + * @property {string|null} [catalog] SetDefaultBranchRequest catalog + * @property {string|null} [branchId] SetDefaultBranchRequest branchId + * @property {string|null} [note] SetDefaultBranchRequest note + * @property {boolean|null} [force] SetDefaultBranchRequest force */ /** - * Constructs a new BatchRemoveCatalogAttributesResponse. + * Constructs a new SetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a BatchRemoveCatalogAttributesResponse. - * @implements IBatchRemoveCatalogAttributesResponse + * @classdesc Represents a SetDefaultBranchRequest. + * @implements ISetDefaultBranchRequest * @constructor - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set */ - function BatchRemoveCatalogAttributesResponse(properties) { - this.deletedCatalogAttributes = []; - this.resetCatalogAttributes = []; + function SetDefaultBranchRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69351,95 +74562,117 @@ } /** - * BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. - * @member {Array.} deletedCatalogAttributes - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * SetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance */ - BatchRemoveCatalogAttributesResponse.prototype.deletedCatalogAttributes = $util.emptyArray; + SetDefaultBranchRequest.prototype.catalog = ""; /** - * BatchRemoveCatalogAttributesResponse resetCatalogAttributes. - * @member {Array.} resetCatalogAttributes - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * SetDefaultBranchRequest branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance */ - BatchRemoveCatalogAttributesResponse.prototype.resetCatalogAttributes = $util.emptyArray; + SetDefaultBranchRequest.prototype.branchId = ""; /** - * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. + * SetDefaultBranchRequest note. + * @member {string} note + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.note = ""; + + /** + * SetDefaultBranchRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest + * @instance + */ + SetDefaultBranchRequest.prototype.force = false; + + /** + * Creates a new SetDefaultBranchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse instance + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest instance */ - BatchRemoveCatalogAttributesResponse.create = function create(properties) { - return new BatchRemoveCatalogAttributesResponse(properties); + SetDefaultBranchRequest.create = function create(properties) { + return new SetDefaultBranchRequest(properties); }; /** - * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * Encodes the specified SetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchRemoveCatalogAttributesResponse.encode = function encode(message, writer) { + SetDefaultBranchRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deletedCatalogAttributes != null && message.deletedCatalogAttributes.length) - for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedCatalogAttributes[i]); - if (message.resetCatalogAttributes != null && message.resetCatalogAttributes.length) - for (var i = 0; i < message.resetCatalogAttributes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resetCatalogAttributes[i]); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branchId); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); return writer; }; /** - * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * Encodes the specified SetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetDefaultBranchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetDefaultBranchRequest} message SetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchRemoveCatalogAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchRemoveCatalogAttributesResponse.decode = function decode(reader, length) { + SetDefaultBranchRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.deletedCatalogAttributes && message.deletedCatalogAttributes.length)) - message.deletedCatalogAttributes = []; - message.deletedCatalogAttributes.push(reader.string()); + message.catalog = reader.string(); break; } case 2: { - if (!(message.resetCatalogAttributes && message.resetCatalogAttributes.length)) - message.resetCatalogAttributes = []; - message.resetCatalogAttributes.push(reader.string()); + message.branchId = reader.string(); + break; + } + case 3: { + message.note = reader.string(); + break; + } + case 4: { + message.force = reader.bool(); break; } default: @@ -69451,157 +74684,147 @@ }; /** - * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. + * Decodes a SetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchRemoveCatalogAttributesResponse.decodeDelimited = function decodeDelimited(reader) { + SetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchRemoveCatalogAttributesResponse message. + * Verifies a SetDefaultBranchRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchRemoveCatalogAttributesResponse.verify = function verify(message) { + SetDefaultBranchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.deletedCatalogAttributes != null && message.hasOwnProperty("deletedCatalogAttributes")) { - if (!Array.isArray(message.deletedCatalogAttributes)) - return "deletedCatalogAttributes: array expected"; - for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) - if (!$util.isString(message.deletedCatalogAttributes[i])) - return "deletedCatalogAttributes: string[] expected"; - } - if (message.resetCatalogAttributes != null && message.hasOwnProperty("resetCatalogAttributes")) { - if (!Array.isArray(message.resetCatalogAttributes)) - return "resetCatalogAttributes: array expected"; - for (var i = 0; i < message.resetCatalogAttributes.length; ++i) - if (!$util.isString(message.resetCatalogAttributes[i])) - return "resetCatalogAttributes: string[] expected"; - } + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @returns {google.cloud.retail.v2alpha.SetDefaultBranchRequest} SetDefaultBranchRequest */ - BatchRemoveCatalogAttributesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) + SetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); - if (object.deletedCatalogAttributes) { - if (!Array.isArray(object.deletedCatalogAttributes)) - throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.deletedCatalogAttributes: array expected"); - message.deletedCatalogAttributes = []; - for (var i = 0; i < object.deletedCatalogAttributes.length; ++i) - message.deletedCatalogAttributes[i] = String(object.deletedCatalogAttributes[i]); - } - if (object.resetCatalogAttributes) { - if (!Array.isArray(object.resetCatalogAttributes)) - throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.resetCatalogAttributes: array expected"); - message.resetCatalogAttributes = []; - for (var i = 0; i < object.resetCatalogAttributes.length; ++i) - message.resetCatalogAttributes[i] = String(object.resetCatalogAttributes[i]); - } + var message = new $root.google.cloud.retail.v2alpha.SetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.note != null) + message.note = String(object.note); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetDefaultBranchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse + * @param {google.cloud.retail.v2alpha.SetDefaultBranchRequest} message SetDefaultBranchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchRemoveCatalogAttributesResponse.toObject = function toObject(message, options) { + SetDefaultBranchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.deletedCatalogAttributes = []; - object.resetCatalogAttributes = []; - } - if (message.deletedCatalogAttributes && message.deletedCatalogAttributes.length) { - object.deletedCatalogAttributes = []; - for (var j = 0; j < message.deletedCatalogAttributes.length; ++j) - object.deletedCatalogAttributes[j] = message.deletedCatalogAttributes[j]; - } - if (message.resetCatalogAttributes && message.resetCatalogAttributes.length) { - object.resetCatalogAttributes = []; - for (var j = 0; j < message.resetCatalogAttributes.length; ++j) - object.resetCatalogAttributes[j] = message.resetCatalogAttributes[j]; + if (options.defaults) { + object.catalog = ""; + object.branchId = ""; + object.note = ""; + object.force = false; } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this BatchRemoveCatalogAttributesResponse to JSON. + * Converts this SetDefaultBranchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @instance * @returns {Object.} JSON object */ - BatchRemoveCatalogAttributesResponse.prototype.toJSON = function toJSON() { + SetDefaultBranchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchRemoveCatalogAttributesResponse + * Gets the default type url for SetDefaultBranchRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @memberof google.cloud.retail.v2alpha.SetDefaultBranchRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchRemoveCatalogAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SetDefaultBranchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetDefaultBranchRequest"; }; - return BatchRemoveCatalogAttributesResponse; + return SetDefaultBranchRequest; })(); - v2alpha.ReplaceCatalogAttributeRequest = (function() { + v2alpha.GetDefaultBranchRequest = (function() { /** - * Properties of a ReplaceCatalogAttributeRequest. + * Properties of a GetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @interface IReplaceCatalogAttributeRequest - * @property {string|null} [attributesConfig] ReplaceCatalogAttributeRequest attributesConfig - * @property {google.cloud.retail.v2alpha.ICatalogAttribute|null} [catalogAttribute] ReplaceCatalogAttributeRequest catalogAttribute - * @property {google.protobuf.IFieldMask|null} [updateMask] ReplaceCatalogAttributeRequest updateMask + * @interface IGetDefaultBranchRequest + * @property {string|null} [catalog] GetDefaultBranchRequest catalog */ /** - * Constructs a new ReplaceCatalogAttributeRequest. + * Constructs a new GetDefaultBranchRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ReplaceCatalogAttributeRequest. - * @implements IReplaceCatalogAttributeRequest + * @classdesc Represents a GetDefaultBranchRequest. + * @implements IGetDefaultBranchRequest * @constructor - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set */ - function ReplaceCatalogAttributeRequest(properties) { + function GetDefaultBranchRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69609,103 +74832,75 @@ } /** - * ReplaceCatalogAttributeRequest attributesConfig. - * @member {string} attributesConfig - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest - * @instance - */ - ReplaceCatalogAttributeRequest.prototype.attributesConfig = ""; - - /** - * ReplaceCatalogAttributeRequest catalogAttribute. - * @member {google.cloud.retail.v2alpha.ICatalogAttribute|null|undefined} catalogAttribute - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest - * @instance - */ - ReplaceCatalogAttributeRequest.prototype.catalogAttribute = null; - - /** - * ReplaceCatalogAttributeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * GetDefaultBranchRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @instance */ - ReplaceCatalogAttributeRequest.prototype.updateMask = null; + GetDefaultBranchRequest.prototype.catalog = ""; /** - * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. + * Creates a new GetDefaultBranchRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest instance + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest instance */ - ReplaceCatalogAttributeRequest.create = function create(properties) { - return new ReplaceCatalogAttributeRequest(properties); + GetDefaultBranchRequest.create = function create(properties) { + return new GetDefaultBranchRequest(properties); }; /** - * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified GetDefaultBranchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplaceCatalogAttributeRequest.encode = function encode(message, writer) { + GetDefaultBranchRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); - if (message.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) - $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); return writer; }; /** - * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * Encodes the specified GetDefaultBranchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchRequest} message GetDefaultBranchRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplaceCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetDefaultBranchRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReplaceCatalogAttributeRequest.decode = function decode(reader, length) { + GetDefaultBranchRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.attributesConfig = reader.string(); - break; - } - case 2: { - message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.catalog = reader.string(); break; } default: @@ -69717,259 +74912,377 @@ }; /** - * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetDefaultBranchRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReplaceCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + GetDefaultBranchRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReplaceCatalogAttributeRequest message. + * Verifies a GetDefaultBranchRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReplaceCatalogAttributeRequest.verify = function verify(message) { + GetDefaultBranchRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - if (!$util.isString(message.attributesConfig)) - return "attributesConfig: string expected"; - if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { - var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttribute); - if (error) - return "catalogAttribute." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; return null; }; /** - * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetDefaultBranchRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchRequest} GetDefaultBranchRequest */ - ReplaceCatalogAttributeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + GetDefaultBranchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(); - if (object.attributesConfig != null) - message.attributesConfig = String(object.attributesConfig); - if (object.catalogAttribute != null) { - if (typeof object.catalogAttribute !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.catalogAttribute: object expected"); - message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttribute); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); return message; }; /** - * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetDefaultBranchRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static - * @param {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest + * @param {google.cloud.retail.v2alpha.GetDefaultBranchRequest} message GetDefaultBranchRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplaceCatalogAttributeRequest.toObject = function toObject(message, options) { + GetDefaultBranchRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.attributesConfig = ""; - object.catalogAttribute = null; - object.updateMask = null; - } - if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) - object.attributesConfig = message.attributesConfig; - if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) - object.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttribute, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.catalog = ""; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; return object; }; /** - * Converts this ReplaceCatalogAttributeRequest to JSON. + * Converts this GetDefaultBranchRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @instance * @returns {Object.} JSON object */ - ReplaceCatalogAttributeRequest.prototype.toJSON = function toJSON() { + GetDefaultBranchRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReplaceCatalogAttributeRequest + * Gets the default type url for GetDefaultBranchRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReplaceCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetDefaultBranchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetDefaultBranchRequest"; }; - return ReplaceCatalogAttributeRequest; + return GetDefaultBranchRequest; })(); - v2alpha.CompletionService = (function() { + v2alpha.GetDefaultBranchResponse = (function() { /** - * Constructs a new CompletionService service. + * Properties of a GetDefaultBranchResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompletionService - * @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 + * @interface IGetDefaultBranchResponse + * @property {string|null} [branch] GetDefaultBranchResponse branch + * @property {google.protobuf.ITimestamp|null} [setTime] GetDefaultBranchResponse setTime + * @property {string|null} [note] GetDefaultBranchResponse note */ - function CompletionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; /** - * Creates new CompletionService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.CompletionService - * @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 {CompletionService} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new GetDefaultBranchResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a GetDefaultBranchResponse. + * @implements IGetDefaultBranchResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set */ - CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function GetDefaultBranchResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|completeQuery}. - * @memberof google.cloud.retail.v2alpha.CompletionService - * @typedef CompleteQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} [response] CompleteQueryResponse + * GetDefaultBranchResponse branch. + * @member {string} branch + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @instance */ + GetDefaultBranchResponse.prototype.branch = ""; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2alpha.CompletionService + * GetDefaultBranchResponse setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @param {google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { - return this.rpcCall(completeQuery, $root.google.cloud.retail.v2alpha.CompleteQueryRequest, $root.google.cloud.retail.v2alpha.CompleteQueryResponse, request, callback); - }, "name", { value: "CompleteQuery" }); + GetDefaultBranchResponse.prototype.setTime = null; /** - * Calls CompleteQuery. - * @function completeQuery - * @memberof google.cloud.retail.v2alpha.CompletionService + * GetDefaultBranchResponse note. + * @member {string} note + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetDefaultBranchResponse.prototype.note = ""; /** - * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|importCompletionData}. - * @memberof google.cloud.retail.v2alpha.CompletionService - * @typedef ImportCompletionDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new GetDefaultBranchResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse instance */ + GetDefaultBranchResponse.create = function create(properties) { + return new GetDefaultBranchResponse(properties); + }; /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2alpha.CompletionService - * @instance - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @param {google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified GetDefaultBranchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { - return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportCompletionData" }); + GetDefaultBranchResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.branch); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.note); + return writer; + }; /** - * Calls ImportCompletionData. - * @function importCompletionData - * @memberof google.cloud.retail.v2alpha.CompletionService + * Encodes the specified GetDefaultBranchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetDefaultBranchResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2alpha.IGetDefaultBranchResponse} message GetDefaultBranchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDefaultBranchResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.branch = reader.string(); + break; + } + case 2: { + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.note = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDefaultBranchResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDefaultBranchResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDefaultBranchResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDefaultBranchResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (error) + return "setTime." + error; + } + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + return null; + }; + + /** + * Creates a GetDefaultBranchResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.GetDefaultBranchResponse} GetDefaultBranchResponse + */ + GetDefaultBranchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.GetDefaultBranchResponse(); + if (object.branch != null) + message.branch = String(object.branch); + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.GetDefaultBranchResponse.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + } + if (object.note != null) + message.note = String(object.note); + return message; + }; + + /** + * Creates a plain object from a GetDefaultBranchResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {google.cloud.retail.v2alpha.GetDefaultBranchResponse} message GetDefaultBranchResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDefaultBranchResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.branch = ""; + object.setTime = null; + object.note = ""; + } + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + return object; + }; + + /** + * Converts this GetDefaultBranchResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse * @instance - * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetDefaultBranchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CompletionService; + /** + * Gets the default type url for GetDefaultBranchResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.GetDefaultBranchResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDefaultBranchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetDefaultBranchResponse"; + }; + + return GetDefaultBranchResponse; })(); - v2alpha.CompleteQueryRequest = (function() { + v2alpha.GetCompletionConfigRequest = (function() { /** - * Properties of a CompleteQueryRequest. + * Properties of a GetCompletionConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface ICompleteQueryRequest - * @property {string|null} [catalog] CompleteQueryRequest catalog - * @property {string|null} [query] CompleteQueryRequest query - * @property {string|null} [visitorId] CompleteQueryRequest visitorId - * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes - * @property {string|null} [deviceType] CompleteQueryRequest deviceType - * @property {string|null} [dataset] CompleteQueryRequest dataset - * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions - * @property {boolean|null} [enableAttributeSuggestions] CompleteQueryRequest enableAttributeSuggestions - * @property {string|null} [entity] CompleteQueryRequest entity + * @interface IGetCompletionConfigRequest + * @property {string|null} [name] GetCompletionConfigRequest name */ /** - * Constructs a new CompleteQueryRequest. + * Constructs a new GetCompletionConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompleteQueryRequest. - * @implements ICompleteQueryRequest + * @classdesc Represents a GetCompletionConfigRequest. + * @implements IGetCompletionConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest=} [properties] Properties to set */ - function CompleteQueryRequest(properties) { - this.languageCodes = []; + function GetCompletionConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69977,190 +75290,293 @@ } /** - * CompleteQueryRequest catalog. - * @member {string} catalog - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * GetCompletionConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest * @instance */ - CompleteQueryRequest.prototype.catalog = ""; + GetCompletionConfigRequest.prototype.name = ""; /** - * CompleteQueryRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @instance + * Creates a new GetCompletionConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest instance */ - CompleteQueryRequest.prototype.query = ""; + GetCompletionConfigRequest.create = function create(properties) { + return new GetCompletionConfigRequest(properties); + }; /** - * CompleteQueryRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @instance + * Encodes the specified GetCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.prototype.visitorId = ""; + GetCompletionConfigRequest.encode = function encode(message, writer) { + 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; + }; /** - * CompleteQueryRequest languageCodes. - * @member {Array.} languageCodes - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @instance + * Encodes the specified GetCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetCompletionConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetCompletionConfigRequest} message GetCompletionConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + GetCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * CompleteQueryRequest deviceType. - * @member {string} deviceType - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @instance + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.prototype.deviceType = ""; + GetCompletionConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest(); + 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; + }; /** - * CompleteQueryRequest dataset. - * @member {string} dataset - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest - * @instance + * Decodes a GetCompletionConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.prototype.dataset = ""; + GetCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * CompleteQueryRequest maxSuggestions. - * @member {number} maxSuggestions - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * Verifies a GetCompletionConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCompletionConfigRequest.verify = function verify(message) { + if (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 GetCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.GetCompletionConfigRequest} GetCompletionConfigRequest + */ + GetCompletionConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.GetCompletionConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCompletionConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.GetCompletionConfigRequest} message GetCompletionConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCompletionConfigRequest.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 GetCompletionConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest * @instance + * @returns {Object.} JSON object */ - CompleteQueryRequest.prototype.maxSuggestions = 0; + GetCompletionConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * CompleteQueryRequest enableAttributeSuggestions. - * @member {boolean} enableAttributeSuggestions - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * Gets the default type url for GetCompletionConfigRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.GetCompletionConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCompletionConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetCompletionConfigRequest"; + }; + + return GetCompletionConfigRequest; + })(); + + v2alpha.UpdateCompletionConfigRequest = (function() { + + /** + * Properties of an UpdateCompletionConfigRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IUpdateCompletionConfigRequest + * @property {google.cloud.retail.v2alpha.ICompletionConfig|null} [completionConfig] UpdateCompletionConfigRequest completionConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCompletionConfigRequest updateMask + */ + + /** + * Constructs a new UpdateCompletionConfigRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an UpdateCompletionConfigRequest. + * @implements IUpdateCompletionConfigRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest=} [properties] Properties to set + */ + function UpdateCompletionConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCompletionConfigRequest completionConfig. + * @member {google.cloud.retail.v2alpha.ICompletionConfig|null|undefined} completionConfig + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @instance */ - CompleteQueryRequest.prototype.enableAttributeSuggestions = false; + UpdateCompletionConfigRequest.prototype.completionConfig = null; /** - * CompleteQueryRequest entity. - * @member {string} entity - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * UpdateCompletionConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @instance */ - CompleteQueryRequest.prototype.entity = ""; + UpdateCompletionConfigRequest.prototype.updateMask = null; /** - * Creates a new CompleteQueryRequest instance using the specified properties. + * Creates a new UpdateCompletionConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest instance + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest instance */ - CompleteQueryRequest.create = function create(properties) { - return new CompleteQueryRequest(properties); + UpdateCompletionConfigRequest.create = function create(properties) { + return new UpdateCompletionConfigRequest(properties); }; /** - * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified UpdateCompletionConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encode = function encode(message, writer) { + UpdateCompletionConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); - if (message.languageCodes != null && message.languageCodes.length) - for (var i = 0; i < message.languageCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); - if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); - if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); - if (message.enableAttributeSuggestions != null && Object.hasOwnProperty.call(message, "enableAttributeSuggestions")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableAttributeSuggestions); - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.entity); + if (message.completionConfig != null && Object.hasOwnProperty.call(message, "completionConfig")) + $root.google.cloud.retail.v2alpha.CompletionConfig.encode(message.completionConfig, 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 CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * Encodes the specified UpdateCompletionConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateCompletionConfigRequest} message UpdateCompletionConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateCompletionConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decode = function decode(reader, length) { + UpdateCompletionConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.catalog = reader.string(); + message.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.decode(reader, reader.uint32()); break; } case 2: { - message.query = reader.string(); - break; - } - case 7: { - message.visitorId = reader.string(); - break; - } - case 3: { - if (!(message.languageCodes && message.languageCodes.length)) - message.languageCodes = []; - message.languageCodes.push(reader.string()); - break; - } - case 4: { - message.deviceType = reader.string(); - break; - } - case 6: { - message.dataset = reader.string(); - break; - } - case 5: { - message.maxSuggestions = reader.int32(); - break; - } - case 9: { - message.enableAttributeSuggestions = reader.bool(); - break; - } - case 10: { - message.entity = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -70172,206 +75588,141 @@ }; /** - * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateCompletionConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateCompletionConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryRequest message. + * Verifies an UpdateCompletionConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryRequest.verify = function verify(message) { + UpdateCompletionConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) - if (!$util.isString(message.catalog)) - return "catalog: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { - if (!Array.isArray(message.languageCodes)) - return "languageCodes: array expected"; - for (var i = 0; i < message.languageCodes.length; ++i) - if (!$util.isString(message.languageCodes[i])) - return "languageCodes: string[] expected"; + if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) { + var error = $root.google.cloud.retail.v2alpha.CompletionConfig.verify(message.completionConfig); + if (error) + return "completionConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - if (!$util.isString(message.deviceType)) - return "deviceType: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - if (!$util.isInteger(message.maxSuggestions)) - return "maxSuggestions: integer expected"; - if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) - if (typeof message.enableAttributeSuggestions !== "boolean") - return "enableAttributeSuggestions: boolean expected"; - if (message.entity != null && message.hasOwnProperty("entity")) - if (!$util.isString(message.entity)) - return "entity: string expected"; return null; }; /** - * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateCompletionConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @returns {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} UpdateCompletionConfigRequest */ - CompleteQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryRequest) + UpdateCompletionConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); - if (object.catalog != null) - message.catalog = String(object.catalog); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.languageCodes) { - if (!Array.isArray(object.languageCodes)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryRequest.languageCodes: array expected"); - message.languageCodes = []; - for (var i = 0; i < object.languageCodes.length; ++i) - message.languageCodes[i] = String(object.languageCodes[i]); + var message = new $root.google.cloud.retail.v2alpha.UpdateCompletionConfigRequest(); + if (object.completionConfig != null) { + if (typeof object.completionConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.completionConfig: object expected"); + message.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.fromObject(object.completionConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateCompletionConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.deviceType != null) - message.deviceType = String(object.deviceType); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.maxSuggestions != null) - message.maxSuggestions = object.maxSuggestions | 0; - if (object.enableAttributeSuggestions != null) - message.enableAttributeSuggestions = Boolean(object.enableAttributeSuggestions); - if (object.entity != null) - message.entity = String(object.entity); return message; }; /** - * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateCompletionConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryRequest} message CompleteQueryRequest + * @param {google.cloud.retail.v2alpha.UpdateCompletionConfigRequest} message UpdateCompletionConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteQueryRequest.toObject = function toObject(message, options) { + UpdateCompletionConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.languageCodes = []; if (options.defaults) { - object.catalog = ""; - object.query = ""; - object.deviceType = ""; - object.maxSuggestions = 0; - object.dataset = ""; - object.visitorId = ""; - object.enableAttributeSuggestions = false; - object.entity = ""; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = message.catalog; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.languageCodes && message.languageCodes.length) { - object.languageCodes = []; - for (var j = 0; j < message.languageCodes.length; ++j) - object.languageCodes[j] = message.languageCodes[j]; + object.completionConfig = null; + object.updateMask = null; } - if (message.deviceType != null && message.hasOwnProperty("deviceType")) - object.deviceType = message.deviceType; - if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) - object.maxSuggestions = message.maxSuggestions; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) - object.enableAttributeSuggestions = message.enableAttributeSuggestions; - if (message.entity != null && message.hasOwnProperty("entity")) - object.entity = message.entity; + if (message.completionConfig != null && message.hasOwnProperty("completionConfig")) + object.completionConfig = $root.google.cloud.retail.v2alpha.CompletionConfig.toObject(message.completionConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this CompleteQueryRequest to JSON. + * Converts this UpdateCompletionConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @instance * @returns {Object.} JSON object */ - CompleteQueryRequest.prototype.toJSON = function toJSON() { + UpdateCompletionConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CompleteQueryRequest + * Gets the default type url for UpdateCompletionConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @memberof google.cloud.retail.v2alpha.UpdateCompletionConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CompleteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateCompletionConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateCompletionConfigRequest"; }; - return CompleteQueryRequest; + return UpdateCompletionConfigRequest; })(); - v2alpha.CompleteQueryResponse = (function() { + v2alpha.GetAttributesConfigRequest = (function() { /** - * Properties of a CompleteQueryResponse. + * Properties of a GetAttributesConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface ICompleteQueryResponse - * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults - * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken - * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults - * @property {Object.|null} [attributeResults] CompleteQueryResponse attributeResults + * @interface IGetAttributesConfigRequest + * @property {string|null} [name] GetAttributesConfigRequest name */ /** - * Constructs a new CompleteQueryResponse. + * Constructs a new GetAttributesConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CompleteQueryResponse. - * @implements ICompleteQueryResponse + * @classdesc Represents a GetAttributesConfigRequest. + * @implements IGetAttributesConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest=} [properties] Properties to set */ - function CompleteQueryResponse(properties) { - this.completionResults = []; - this.recentSearchResults = []; - this.attributeResults = {}; + function GetAttributesConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70379,145 +75730,75 @@ } /** - * CompleteQueryResponse completionResults. - * @member {Array.} completionResults - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @instance - */ - CompleteQueryResponse.prototype.completionResults = $util.emptyArray; - - /** - * CompleteQueryResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @instance - */ - CompleteQueryResponse.prototype.attributionToken = ""; - - /** - * CompleteQueryResponse recentSearchResults. - * @member {Array.} recentSearchResults - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @instance - */ - CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; - - /** - * CompleteQueryResponse attributeResults. - * @member {Object.} attributeResults - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * GetAttributesConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @instance */ - CompleteQueryResponse.prototype.attributeResults = $util.emptyObject; + GetAttributesConfigRequest.prototype.name = ""; /** - * Creates a new CompleteQueryResponse instance using the specified properties. + * Creates a new GetAttributesConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse instance + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest instance */ - CompleteQueryResponse.create = function create(properties) { - return new CompleteQueryResponse(properties); + GetAttributesConfigRequest.create = function create(properties) { + return new GetAttributesConfigRequest(properties); }; /** - * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified GetAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encode = function encode(message, writer) { + GetAttributesConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.completionResults != null && message.completionResults.length) - for (var i = 0; i < message.completionResults.length; ++i) - $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - if (message.recentSearchResults != null && message.recentSearchResults.length) - for (var i = 0; i < message.recentSearchResults.length; ++i) - $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.encode(message.recentSearchResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attributeResults != null && Object.hasOwnProperty.call(message, "attributeResults")) - for (var keys = Object.keys(message.attributeResults), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.encode(message.attributeResults[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().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 CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * Encodes the specified GetAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAttributesConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static - * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetAttributesConfigRequest} message GetAttributesConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decode = function decode(reader, length) { + GetAttributesConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.completionResults && message.completionResults.length)) - message.completionResults = []; - message.completionResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.attributionToken = reader.string(); - break; - } - case 3: { - if (!(message.recentSearchResults && message.recentSearchResults.length)) - message.recentSearchResults = []; - message.recentSearchResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); - break; - } - case 4: { - if (message.attributeResults === $util.emptyObject) - message.attributeResults = {}; - 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.retail.v2alpha.CompleteQueryResponse.AttributeResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributeResults[key] = value; + message.name = reader.string(); break; } default: @@ -70529,1056 +75810,360 @@ }; /** - * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * Decodes a GetAttributesConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + GetAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteQueryResponse message. + * Verifies a GetAttributesConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteQueryResponse.verify = function verify(message) { + GetAttributesConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.completionResults != null && message.hasOwnProperty("completionResults")) { - if (!Array.isArray(message.completionResults)) - return "completionResults: array expected"; - for (var i = 0; i < message.completionResults.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); - if (error) - return "completionResults." + error; - } - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { - if (!Array.isArray(message.recentSearchResults)) - return "recentSearchResults: array expected"; - for (var i = 0; i < message.recentSearchResults.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); - if (error) - return "recentSearchResults." + error; - } - } - if (message.attributeResults != null && message.hasOwnProperty("attributeResults")) { - if (!$util.isObject(message.attributeResults)) - return "attributeResults: object expected"; - var key = Object.keys(message.attributeResults); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify(message.attributeResults[key[i]]); - if (error) - return "attributeResults." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @returns {google.cloud.retail.v2alpha.GetAttributesConfigRequest} GetAttributesConfigRequest */ - CompleteQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse) + GetAttributesConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); - if (object.completionResults) { - if (!Array.isArray(object.completionResults)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: array expected"); - message.completionResults = []; - for (var i = 0; i < object.completionResults.length; ++i) { - if (typeof object.completionResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: object expected"); - message.completionResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); - } - } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.recentSearchResults) { - if (!Array.isArray(object.recentSearchResults)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: array expected"); - message.recentSearchResults = []; - for (var i = 0; i < object.recentSearchResults.length; ++i) { - if (typeof object.recentSearchResults[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: object expected"); - message.recentSearchResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); - } - } - if (object.attributeResults) { - if (typeof object.attributeResults !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); - message.attributeResults = {}; - for (var keys = Object.keys(object.attributeResults), i = 0; i < keys.length; ++i) { - if (typeof object.attributeResults[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); - message.attributeResults[keys[i]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.fromObject(object.attributeResults[keys[i]]); - } - } + var message = new $root.google.cloud.retail.v2alpha.GetAttributesConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetAttributesConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} message CompleteQueryResponse + * @param {google.cloud.retail.v2alpha.GetAttributesConfigRequest} message GetAttributesConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteQueryResponse.toObject = function toObject(message, options) { + GetAttributesConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.completionResults = []; - object.recentSearchResults = []; - } - if (options.objects || options.defaults) - object.attributeResults = {}; if (options.defaults) - object.attributionToken = ""; - if (message.completionResults && message.completionResults.length) { - object.completionResults = []; - for (var j = 0; j < message.completionResults.length; ++j) - object.completionResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); - } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.recentSearchResults && message.recentSearchResults.length) { - object.recentSearchResults = []; - for (var j = 0; j < message.recentSearchResults.length; ++j) - object.recentSearchResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); - } - var keys2; - if (message.attributeResults && (keys2 = Object.keys(message.attributeResults)).length) { - object.attributeResults = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributeResults[keys2[j]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.toObject(message.attributeResults[keys2[j]], options); - } + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CompleteQueryResponse to JSON. + * Converts this GetAttributesConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @instance * @returns {Object.} JSON object */ - CompleteQueryResponse.prototype.toJSON = function toJSON() { + GetAttributesConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CompleteQueryResponse + * Gets the default type url for GetAttributesConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @memberof google.cloud.retail.v2alpha.GetAttributesConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CompleteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetAttributesConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetAttributesConfigRequest"; }; - CompleteQueryResponse.CompletionResult = (function() { - - /** - * Properties of a CompletionResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @interface ICompletionResult - * @property {string|null} [suggestion] CompletionResult suggestion - * @property {Object.|null} [attributes] CompletionResult attributes - * @property {Array.|null} [facets] CompletionResult facets - * @property {number|null} [totalProductCount] CompletionResult totalProductCount - */ - - /** - * Constructs a new CompletionResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @classdesc Represents a CompletionResult. - * @implements ICompletionResult - * @constructor - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - */ - function CompletionResult(properties) { - this.attributes = {}; - this.facets = []; - if (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 GetAttributesConfigRequest; + })(); - /** - * CompletionResult suggestion. - * @member {string} suggestion - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.suggestion = ""; + v2alpha.UpdateAttributesConfigRequest = (function() { - /** - * CompletionResult attributes. - * @member {Object.} attributes - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.attributes = $util.emptyObject; + /** + * Properties of an UpdateAttributesConfigRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IUpdateAttributesConfigRequest + * @property {google.cloud.retail.v2alpha.IAttributesConfig|null} [attributesConfig] UpdateAttributesConfigRequest attributesConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAttributesConfigRequest updateMask + */ - /** - * CompletionResult facets. - * @member {Array.} facets - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.facets = $util.emptyArray; - - /** - * CompletionResult totalProductCount. - * @member {number} totalProductCount - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - */ - CompletionResult.prototype.totalProductCount = 0; - - /** - * Creates a new CompletionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult instance - */ - CompletionResult.create = function create(properties) { - return new CompletionResult(properties); - }; - - /** - * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); - if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) - for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.facets != null && message.facets.length) - for (var i = 0; i < message.facets.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalProductCount != null && Object.hasOwnProperty.call(message, "totalProductCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalProductCount); - return writer; - }; - - /** - * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.suggestion = reader.string(); - break; - } - case 2: { - if (message.attributes === $util.emptyObject) - message.attributes = {}; - 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.attributes[key] = value; - break; - } - case 3: { - if (!(message.facets && message.facets.length)) - message.facets = []; - message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); - break; - } - case 4: { - message.totalProductCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CompletionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CompletionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompletionResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CompletionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - if (!$util.isString(message.suggestion)) - return "suggestion: string expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!$util.isObject(message.attributes)) - return "attributes: object expected"; - var key = Object.keys(message.attributes); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); - if (error) - return "attributes." + error; - } - } - if (message.facets != null && message.hasOwnProperty("facets")) { - if (!Array.isArray(message.facets)) - return "facets: array expected"; - for (var i = 0; i < message.facets.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); - if (error) - return "facets." + error; - } - } - if (message.totalProductCount != null && message.hasOwnProperty("totalProductCount")) - if (!$util.isInteger(message.totalProductCount)) - return "totalProductCount: integer expected"; - return null; - }; - - /** - * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult - */ - CompletionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(); - if (object.suggestion != null) - message.suggestion = String(object.suggestion); - if (object.attributes) { - if (typeof object.attributes !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes = {}; - for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { - if (typeof object.attributes[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); - message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); - } - } - if (object.facets) { - if (!Array.isArray(object.facets)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.facets: array expected"); - message.facets = []; - for (var i = 0; i < object.facets.length; ++i) { - if (typeof object.facets[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.facets: object expected"); - message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); - } - } - if (object.totalProductCount != null) - message.totalProductCount = object.totalProductCount | 0; - return message; - }; - - /** - * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} message CompletionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompletionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.facets = []; - if (options.objects || options.defaults) - object.attributes = {}; - if (options.defaults) { - object.suggestion = ""; - object.totalProductCount = 0; - } - if (message.suggestion != null && message.hasOwnProperty("suggestion")) - object.suggestion = message.suggestion; - var keys2; - if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { - object.attributes = {}; - for (var j = 0; j < keys2.length; ++j) - object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); - } - if (message.facets && message.facets.length) { - object.facets = []; - for (var j = 0; j < message.facets.length; ++j) - object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); - } - if (message.totalProductCount != null && message.hasOwnProperty("totalProductCount")) - object.totalProductCount = message.totalProductCount; - return object; - }; - - /** - * Converts this CompletionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @instance - * @returns {Object.} JSON object - */ - CompletionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CompletionResult - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult"; - }; - - return CompletionResult; - })(); - - CompleteQueryResponse.RecentSearchResult = (function() { - - /** - * Properties of a RecentSearchResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @interface IRecentSearchResult - * @property {string|null} [recentSearch] RecentSearchResult recentSearch - */ + /** + * Constructs a new UpdateAttributesConfigRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an UpdateAttributesConfigRequest. + * @implements IUpdateAttributesConfigRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest=} [properties] Properties to set + */ + function UpdateAttributesConfigRequest(properties) { + if (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 RecentSearchResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @classdesc Represents a RecentSearchResult. - * @implements IRecentSearchResult - * @constructor - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - */ - function RecentSearchResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * UpdateAttributesConfigRequest attributesConfig. + * @member {google.cloud.retail.v2alpha.IAttributesConfig|null|undefined} attributesConfig + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @instance + */ + UpdateAttributesConfigRequest.prototype.attributesConfig = null; - /** - * RecentSearchResult recentSearch. - * @member {string} recentSearch - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @instance - */ - RecentSearchResult.prototype.recentSearch = ""; + /** + * UpdateAttributesConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @instance + */ + UpdateAttributesConfigRequest.prototype.updateMask = null; - /** - * Creates a new RecentSearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance - */ - RecentSearchResult.create = function create(properties) { - return new RecentSearchResult(properties); - }; + /** + * Creates a new UpdateAttributesConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest instance + */ + UpdateAttributesConfigRequest.create = function create(properties) { + return new UpdateAttributesConfigRequest(properties); + }; - /** - * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); - return writer; - }; + /** + * Encodes the specified UpdateAttributesConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributesConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + $root.google.cloud.retail.v2alpha.AttributesConfig.encode(message.attributesConfig, 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 RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified UpdateAttributesConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateAttributesConfigRequest} message UpdateAttributesConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAttributesConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a RecentSearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.recentSearch = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAttributesConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.decode(reader, reader.uint32()); break; } - } - return message; - }; - - /** - * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RecentSearchResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RecentSearchResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - if (!$util.isString(message.recentSearch)) - return "recentSearch: string expected"; - return null; - }; - - /** - * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult - */ - RecentSearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); - if (object.recentSearch != null) - message.recentSearch = String(object.recentSearch); - return message; - }; - - /** - * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RecentSearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.recentSearch = ""; - if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) - object.recentSearch = message.recentSearch; - return object; - }; - - /** - * Converts this RecentSearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @instance - * @returns {Object.} JSON object - */ - RecentSearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RecentSearchResult - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RecentSearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult"; - }; - - return RecentSearchResult; - })(); - - CompleteQueryResponse.AttributeResult = (function() { - - /** - * Properties of an AttributeResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @interface IAttributeResult - * @property {Array.|null} [suggestions] AttributeResult suggestions - */ - - /** - * Constructs a new AttributeResult. - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse - * @classdesc Represents an AttributeResult. - * @implements IAttributeResult - * @constructor - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set - */ - function AttributeResult(properties) { - this.suggestions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttributeResult suggestions. - * @member {Array.} suggestions - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @instance - */ - AttributeResult.prototype.suggestions = $util.emptyArray; - - /** - * Creates a new AttributeResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult instance - */ - AttributeResult.create = function create(properties) { - return new AttributeResult(properties); - }; - - /** - * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestions != null && message.suggestions.length) - for (var i = 0; i < message.suggestions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestions[i]); - return writer; - }; - - /** - * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttributeResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttributeResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.suggestions && message.suggestions.length)) - message.suggestions = []; - message.suggestions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes an AttributeResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttributeResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttributeResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttributeResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (!Array.isArray(message.suggestions)) - return "suggestions: array expected"; - for (var i = 0; i < message.suggestions.length; ++i) - if (!$util.isString(message.suggestions[i])) - return "suggestions: string[] expected"; - } - return null; - }; - - /** - * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult - */ - AttributeResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); - if (object.suggestions) { - if (!Array.isArray(object.suggestions)) - throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.suggestions: array expected"); - message.suggestions = []; - for (var i = 0; i < object.suggestions.length; ++i) - message.suggestions[i] = String(object.suggestions[i]); - } - return message; - }; - - /** - * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} message AttributeResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttributeResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.suggestions = []; - if (message.suggestions && message.suggestions.length) { - object.suggestions = []; - for (var j = 0; j < message.suggestions.length; ++j) - object.suggestions[j] = message.suggestions[j]; - } - return object; - }; - - /** - * Converts this AttributeResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @instance - * @returns {Object.} JSON object - */ - AttributeResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttributeResult - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttributeResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult"; - }; - - return AttributeResult; - })(); - - return CompleteQueryResponse; - })(); - - v2alpha.SearchService = (function() { + } + return message; + }; /** - * Constructs a new SearchService service. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchService - * @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 + * Decodes an UpdateAttributesConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function SearchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + UpdateAttributesConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; + /** + * Verifies an UpdateAttributesConfigRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAttributesConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) { + var error = $root.google.cloud.retail.v2alpha.AttributesConfig.verify(message.attributesConfig); + if (error) + return "attributesConfig." + 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 new SearchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchService + * Creates an UpdateAttributesConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest * @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 {SearchService} RPC service. Useful where requests and/or responses are streamed. + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} UpdateAttributesConfigRequest */ - SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + UpdateAttributesConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.UpdateAttributesConfigRequest(); + if (object.attributesConfig != null) { + if (typeof object.attributesConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.attributesConfig: object expected"); + message.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.fromObject(object.attributesConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateAttributesConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.SearchService|search}. - * @memberof google.cloud.retail.v2alpha.SearchService - * @typedef SearchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.SearchResponse} [response] SearchResponse + * Creates a plain object from an UpdateAttributesConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {google.cloud.retail.v2alpha.UpdateAttributesConfigRequest} message UpdateAttributesConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + UpdateAttributesConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = null; + object.updateMask = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = $root.google.cloud.retail.v2alpha.AttributesConfig.toObject(message.attributesConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2alpha.SearchService + * Converts this UpdateAttributesConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest * @instance - * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object - * @param {google.cloud.retail.v2alpha.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(SearchService.prototype.search = function search(request, callback) { - return this.rpcCall(search, $root.google.cloud.retail.v2alpha.SearchRequest, $root.google.cloud.retail.v2alpha.SearchResponse, request, callback); - }, "name", { value: "Search" }); + UpdateAttributesConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls Search. - * @function search - * @memberof google.cloud.retail.v2alpha.SearchService - * @instance - * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for UpdateAttributesConfigRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.UpdateAttributesConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + UpdateAttributesConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateAttributesConfigRequest"; + }; - return SearchService; + return UpdateAttributesConfigRequest; })(); - v2alpha.SearchRequest = (function() { + v2alpha.AddCatalogAttributeRequest = (function() { /** - * Properties of a SearchRequest. + * Properties of an AddCatalogAttributeRequest. * @memberof google.cloud.retail.v2alpha - * @interface ISearchRequest - * @property {string|null} [placement] SearchRequest placement - * @property {string|null} [branch] SearchRequest branch - * @property {string|null} [query] SearchRequest query - * @property {string|null} [visitorId] SearchRequest visitorId - * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] SearchRequest userInfo - * @property {number|null} [pageSize] SearchRequest pageSize - * @property {string|null} [pageToken] SearchRequest pageToken - * @property {number|null} [offset] SearchRequest offset - * @property {string|null} [filter] SearchRequest filter - * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter - * @property {string|null} [orderBy] SearchRequest orderBy - * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs - * @property {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null} [relevanceThreshold] SearchRequest relevanceThreshold - * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys - * @property {Array.|null} [pageCategories] SearchRequest pageCategories - * @property {google.cloud.retail.v2alpha.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode - * @property {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] SearchRequest personalizationSpec - * @property {Object.|null} [labels] SearchRequest labels - * @property {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null} [spellCorrectionSpec] SearchRequest spellCorrectionSpec - * @property {string|null} [entity] SearchRequest entity + * @interface IAddCatalogAttributeRequest + * @property {string|null} [attributesConfig] AddCatalogAttributeRequest attributesConfig + * @property {google.cloud.retail.v2alpha.ICatalogAttribute|null} [catalogAttribute] AddCatalogAttributeRequest catalogAttribute */ /** - * Constructs a new SearchRequest. + * Constructs a new AddCatalogAttributeRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchRequest. - * @implements ISearchRequest + * @classdesc Represents an AddCatalogAttributeRequest. + * @implements IAddCatalogAttributeRequest * @constructor - * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest=} [properties] Properties to set */ - function SearchRequest(properties) { - this.facetSpecs = []; - this.variantRollupKeys = []; - this.pageCategories = []; - this.labels = {}; + function AddCatalogAttributeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71586,426 +76171,321 @@ } /** - * SearchRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest * @instance */ - SearchRequest.prototype.placement = ""; + AddCatalogAttributeRequest.prototype.attributesConfig = ""; /** - * SearchRequest branch. - * @member {string} branch - * @memberof google.cloud.retail.v2alpha.SearchRequest + * AddCatalogAttributeRequest catalogAttribute. + * @member {google.cloud.retail.v2alpha.ICatalogAttribute|null|undefined} catalogAttribute + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest * @instance */ - SearchRequest.prototype.branch = ""; + AddCatalogAttributeRequest.prototype.catalogAttribute = null; /** - * SearchRequest query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Creates a new AddCatalogAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest instance */ - SearchRequest.prototype.query = ""; + AddCatalogAttributeRequest.create = function create(properties) { + return new AddCatalogAttributeRequest(properties); + }; /** - * SearchRequest visitorId. - * @member {string} visitorId - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.visitorId = ""; - - /** - * SearchRequest userInfo. - * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.userInfo = null; - - /** - * SearchRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.pageSize = 0; - - /** - * SearchRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.pageToken = ""; - - /** - * SearchRequest offset. - * @member {number} offset - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.offset = 0; - - /** - * SearchRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.filter = ""; - - /** - * SearchRequest canonicalFilter. - * @member {string} canonicalFilter - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Encodes the specified AddCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchRequest.prototype.canonicalFilter = ""; + AddCatalogAttributeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); + if (message.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) + $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * SearchRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Encodes the specified AddCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddCatalogAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddCatalogAttributeRequest} message AddCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchRequest.prototype.orderBy = ""; + AddCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * SearchRequest facetSpecs. - * @member {Array.} facetSpecs - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.prototype.facetSpecs = $util.emptyArray; + AddCatalogAttributeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributesConfig = reader.string(); + break; + } + case 2: { + message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * SearchRequest dynamicFacetSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Decodes an AddCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.prototype.dynamicFacetSpec = null; + AddCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * SearchRequest boostSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null|undefined} boostSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Verifies an AddCatalogAttributeRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.prototype.boostSpec = null; + AddCatalogAttributeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + if (!$util.isString(message.attributesConfig)) + return "attributesConfig: string expected"; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttribute); + if (error) + return "catalogAttribute." + error; + } + return null; + }; /** - * SearchRequest queryExpansionSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Creates an AddCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} AddCatalogAttributeRequest */ - SearchRequest.prototype.queryExpansionSpec = null; + AddCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.AddCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.catalogAttribute != null) { + if (typeof object.catalogAttribute !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddCatalogAttributeRequest.catalogAttribute: object expected"); + message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttribute); + } + return message; + }; /** - * SearchRequest relevanceThreshold. - * @member {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} relevanceThreshold - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Creates a plain object from an AddCatalogAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.AddCatalogAttributeRequest} message AddCatalogAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SearchRequest.prototype.relevanceThreshold = 0; + AddCatalogAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = ""; + object.catalogAttribute = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) + object.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttribute, options); + return object; + }; /** - * SearchRequest variantRollupKeys. - * @member {Array.} variantRollupKeys - * @memberof google.cloud.retail.v2alpha.SearchRequest + * Converts this AddCatalogAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest * @instance + * @returns {Object.} JSON object */ - SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + AddCatalogAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SearchRequest pageCategories. - * @member {Array.} pageCategories - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Gets the default type url for AddCatalogAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AddCatalogAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - SearchRequest.prototype.pageCategories = $util.emptyArray; + AddCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddCatalogAttributeRequest"; + }; - /** - * SearchRequest searchMode. - * @member {google.cloud.retail.v2alpha.SearchRequest.SearchMode} searchMode - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.searchMode = 0; + return AddCatalogAttributeRequest; + })(); - /** - * SearchRequest personalizationSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance - */ - SearchRequest.prototype.personalizationSpec = null; + v2alpha.RemoveCatalogAttributeRequest = (function() { /** - * SearchRequest labels. - * @member {Object.} labels - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Properties of a RemoveCatalogAttributeRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IRemoveCatalogAttributeRequest + * @property {string|null} [attributesConfig] RemoveCatalogAttributeRequest attributesConfig + * @property {string|null} [key] RemoveCatalogAttributeRequest key */ - SearchRequest.prototype.labels = $util.emptyObject; /** - * SearchRequest spellCorrectionSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null|undefined} spellCorrectionSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @instance + * Constructs a new RemoveCatalogAttributeRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a RemoveCatalogAttributeRequest. + * @implements IRemoveCatalogAttributeRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest=} [properties] Properties to set */ - SearchRequest.prototype.spellCorrectionSpec = null; + function RemoveCatalogAttributeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * SearchRequest entity. - * @member {string} entity - * @memberof google.cloud.retail.v2alpha.SearchRequest + * RemoveCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @instance */ - SearchRequest.prototype.entity = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + RemoveCatalogAttributeRequest.prototype.attributesConfig = ""; /** - * SearchRequest _spellCorrectionSpec. - * @member {"spellCorrectionSpec"|undefined} _spellCorrectionSpec - * @memberof google.cloud.retail.v2alpha.SearchRequest + * RemoveCatalogAttributeRequest key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @instance */ - Object.defineProperty(SearchRequest.prototype, "_spellCorrectionSpec", { - get: $util.oneOfGetter($oneOfFields = ["spellCorrectionSpec"]), - set: $util.oneOfSetter($oneOfFields) - }); + RemoveCatalogAttributeRequest.prototype.key = ""; /** - * Creates a new SearchRequest instance using the specified properties. + * Creates a new RemoveCatalogAttributeRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest instance */ - SearchRequest.create = function create(properties) { - return new SearchRequest(properties); + RemoveCatalogAttributeRequest.create = function create(properties) { + return new RemoveCatalogAttributeRequest(properties); }; /** - * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encode = function encode(message, writer) { + RemoveCatalogAttributeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); - if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); - if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) - $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); - if (message.facetSpecs != null && message.facetSpecs.length) - for (var i = 0; i < message.facetSpecs.length; ++i) - $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.relevanceThreshold != null && Object.hasOwnProperty.call(message, "relevanceThreshold")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.relevanceThreshold); - if (message.variantRollupKeys != null && message.variantRollupKeys.length) - for (var i = 0; i < message.variantRollupKeys.length; ++i) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); - if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.pageCategories != null && message.pageCategories.length) - for (var i = 0; i < message.pageCategories.length; ++i) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); - if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); - if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); - if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 32, wireType 2 =*/258).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(); - if (message.spellCorrectionSpec != null && Object.hasOwnProperty.call(message, "spellCorrectionSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.encode(message.spellCorrectionSpec, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) - writer.uint32(/* id 38, wireType 2 =*/306).string(message.entity); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); return writer; }; /** - * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * Encodes the specified RemoveCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchRequest message from the specified reader or buffer. + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decode = function decode(reader, length) { + RemoveCatalogAttributeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.placement = reader.string(); + message.attributesConfig = reader.string(); break; } case 2: { - message.branch = reader.string(); - break; - } - case 3: { - message.query = reader.string(); - break; - } - case 4: { - message.visitorId = reader.string(); - break; - } - case 5: { - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); - break; - } - case 7: { - message.pageSize = reader.int32(); - break; - } - case 8: { - message.pageToken = reader.string(); - break; - } - case 9: { - message.offset = reader.int32(); - break; - } - case 10: { - message.filter = reader.string(); - break; - } - case 28: { - message.canonicalFilter = reader.string(); - break; - } - case 11: { - message.orderBy = reader.string(); - break; - } - case 12: { - if (!(message.facetSpecs && message.facetSpecs.length)) - message.facetSpecs = []; - message.facetSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32())); - break; - } - case 21: { - message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); - break; - } - case 13: { - message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.decode(reader, reader.uint32()); - break; - } - case 14: { - message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); - break; - } - case 15: { - message.relevanceThreshold = reader.int32(); - break; - } - case 17: { - if (!(message.variantRollupKeys && message.variantRollupKeys.length)) - message.variantRollupKeys = []; - message.variantRollupKeys.push(reader.string()); - break; - } - case 23: { - if (!(message.pageCategories && message.pageCategories.length)) - message.pageCategories = []; - message.pageCategories.push(reader.string()); - break; - } - case 31: { - message.searchMode = reader.int32(); - break; - } - case 32: { - message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); - 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; - } - case 35: { - message.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.decode(reader, reader.uint32()); - break; - } - case 38: { - message.entity = reader.string(); + message.key = reader.string(); break; } default: @@ -72017,573 +76497,5073 @@ }; /** - * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveCatalogAttributeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchRequest message. + * Verifies a RemoveCatalogAttributeRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchRequest.verify = function verify(message) { + RemoveCatalogAttributeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.branch != null && message.hasOwnProperty("branch")) - if (!$util.isString(message.branch)) - return "branch: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - if (!$util.isString(message.visitorId)) - return "visitorId: string expected"; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) { - var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); - if (error) - return "userInfo." + error; - } - 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.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - if (!$util.isString(message.canonicalFilter)) - return "canonicalFilter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { - if (!Array.isArray(message.facetSpecs)) - return "facetSpecs: array expected"; - for (var i = 0; i < message.facetSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); - if (error) - return "facetSpecs." + error; - } - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); - if (error) - return "dynamicFacetSpec." + error; - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify(message.boostSpec); - if (error) - return "boostSpec." + error; - } - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); - if (error) - return "queryExpansionSpec." + error; - } - if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) - switch (message.relevanceThreshold) { - default: - return "relevanceThreshold: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { - if (!Array.isArray(message.variantRollupKeys)) - return "variantRollupKeys: array expected"; - for (var i = 0; i < message.variantRollupKeys.length; ++i) - if (!$util.isString(message.variantRollupKeys[i])) - return "variantRollupKeys: string[] expected"; - } - if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { - if (!Array.isArray(message.pageCategories)) - return "pageCategories: array expected"; - for (var i = 0; i < message.pageCategories.length; ++i) - if (!$util.isString(message.pageCategories[i])) - return "pageCategories: string[] expected"; - } - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - switch (message.searchMode) { - default: - return "searchMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); - if (error) - return "personalizationSpec." + 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.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) { - properties._spellCorrectionSpec = 1; - { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify(message.spellCorrectionSpec); - if (error) - return "spellCorrectionSpec." + error; - } - } - if (message.entity != null && message.hasOwnProperty("entity")) - if (!$util.isString(message.entity)) - return "entity: string expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + if (!$util.isString(message.attributesConfig)) + return "attributesConfig: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; return null; }; /** - * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @returns {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} RemoveCatalogAttributeRequest */ - SearchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest) + RemoveCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.branch != null) - message.branch = String(object.branch); - if (object.query != null) - message.query = String(object.query); - if (object.visitorId != null) - message.visitorId = String(object.visitorId); - if (object.userInfo != null) { - if (typeof object.userInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.userInfo: object expected"); - message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.offset != null) - message.offset = object.offset | 0; - if (object.filter != null) - message.filter = String(object.filter); - if (object.canonicalFilter != null) - message.canonicalFilter = String(object.canonicalFilter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.facetSpecs) { - if (!Array.isArray(object.facetSpecs)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: array expected"); - message.facetSpecs = []; - for (var i = 0; i < object.facetSpecs.length; ++i) { - if (typeof object.facetSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: object expected"); - message.facetSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); - } - } - if (object.dynamicFacetSpec != null) { - if (typeof object.dynamicFacetSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.dynamicFacetSpec: object expected"); - message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); - } - if (object.boostSpec != null) { - if (typeof object.boostSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.boostSpec: object expected"); - message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.fromObject(object.boostSpec); - } - if (object.queryExpansionSpec != null) { - if (typeof object.queryExpansionSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.queryExpansionSpec: object expected"); - message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); - } - switch (object.relevanceThreshold) { - default: - if (typeof object.relevanceThreshold === "number") { - message.relevanceThreshold = object.relevanceThreshold; - break; - } - break; - case "RELEVANCE_THRESHOLD_UNSPECIFIED": - case 0: - message.relevanceThreshold = 0; - break; - case "HIGH": - case 1: - message.relevanceThreshold = 1; - break; - case "MEDIUM": - case 2: - message.relevanceThreshold = 2; - break; - case "LOW": - case 3: - message.relevanceThreshold = 3; - break; - case "LOWEST": - case 4: - message.relevanceThreshold = 4; - break; - } - if (object.variantRollupKeys) { - if (!Array.isArray(object.variantRollupKeys)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.variantRollupKeys: array expected"); - message.variantRollupKeys = []; - for (var i = 0; i < object.variantRollupKeys.length; ++i) - message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); - } - if (object.pageCategories) { - if (!Array.isArray(object.pageCategories)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.pageCategories: array expected"); - message.pageCategories = []; - for (var i = 0; i < object.pageCategories.length; ++i) - message.pageCategories[i] = String(object.pageCategories[i]); - } - switch (object.searchMode) { - default: - if (typeof object.searchMode === "number") { - message.searchMode = object.searchMode; - break; - } - break; - case "SEARCH_MODE_UNSPECIFIED": - case 0: - message.searchMode = 0; - break; - case "PRODUCT_SEARCH_ONLY": - case 1: - message.searchMode = 1; - break; - case "FACETED_SEARCH_ONLY": - case 2: - message.searchMode = 2; - break; - } - if (object.personalizationSpec != null) { - if (typeof object.personalizationSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.personalizationSpec: object expected"); - message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.fromObject(object.personalizationSpec); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.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.spellCorrectionSpec != null) { - if (typeof object.spellCorrectionSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.spellCorrectionSpec: object expected"); - message.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.fromObject(object.spellCorrectionSpec); - } - if (object.entity != null) - message.entity = String(object.entity); + var message = new $root.google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.key != null) + message.key = String(object.key); return message; }; /** - * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveCatalogAttributeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static - * @param {google.cloud.retail.v2alpha.SearchRequest} message SearchRequest + * @param {google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest} message RemoveCatalogAttributeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchRequest.toObject = function toObject(message, options) { + RemoveCatalogAttributeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.facetSpecs = []; - object.variantRollupKeys = []; - object.pageCategories = []; - } - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.placement = ""; - object.branch = ""; - object.query = ""; - object.visitorId = ""; - object.userInfo = null; - object.pageSize = 0; - object.pageToken = ""; - object.offset = 0; - object.filter = ""; - object.orderBy = ""; - object.boostSpec = null; - object.queryExpansionSpec = null; - object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0; - object.dynamicFacetSpec = null; - object.canonicalFilter = ""; - object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; - object.personalizationSpec = null; - object.entity = ""; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.branch != null && message.hasOwnProperty("branch")) - object.branch = message.branch; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.visitorId != null && message.hasOwnProperty("visitorId")) - object.visitorId = message.visitorId; - if (message.userInfo != null && message.hasOwnProperty("userInfo")) - object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.facetSpecs && message.facetSpecs.length) { - object.facetSpecs = []; - for (var j = 0; j < message.facetSpecs.length; ++j) - object.facetSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); - } - if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) - object.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.toObject(message.boostSpec, options); - if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) - object.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); - if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) - object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] === undefined ? message.relevanceThreshold : $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; - if (message.variantRollupKeys && message.variantRollupKeys.length) { - object.variantRollupKeys = []; - for (var j = 0; j < message.variantRollupKeys.length; ++j) - object.variantRollupKeys[j] = message.variantRollupKeys[j]; - } - if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) - object.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); - if (message.pageCategories && message.pageCategories.length) { - object.pageCategories = []; - for (var j = 0; j < message.pageCategories.length; ++j) - object.pageCategories[j] = message.pageCategories[j]; - } - if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) - object.canonicalFilter = message.canonicalFilter; - if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; - if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) - object.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, 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.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) { - object.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.toObject(message.spellCorrectionSpec, options); - if (options.oneofs) - object._spellCorrectionSpec = "spellCorrectionSpec"; + object.attributesConfig = ""; + object.key = ""; } - if (message.entity != null && message.hasOwnProperty("entity")) - object.entity = message.entity; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; return object; }; /** - * Converts this SearchRequest to JSON. + * Converts this RemoveCatalogAttributeRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @instance * @returns {Object.} JSON object */ - SearchRequest.prototype.toJSON = function toJSON() { + RemoveCatalogAttributeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SearchRequest + * Gets the default type url for RemoveCatalogAttributeRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest + * @memberof google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SearchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveCatalogAttributeRequest"; }; - SearchRequest.FacetSpec = (function() { - - /** - * Properties of a FacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey - * @property {number|null} [limit] FacetSpec limit - * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys - * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition - */ + return RemoveCatalogAttributeRequest; + })(); - /** - * Constructs a new FacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a FacetSpec. - * @implements IFacetSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set - */ - function FacetSpec(properties) { - this.excludedFilterKeys = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2alpha.BatchRemoveCatalogAttributesRequest = (function() { - /** - * FacetSpec facetKey. - * @member {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.facetKey = null; + /** + * Properties of a BatchRemoveCatalogAttributesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IBatchRemoveCatalogAttributesRequest + * @property {string|null} [attributesConfig] BatchRemoveCatalogAttributesRequest attributesConfig + * @property {Array.|null} [attributeKeys] BatchRemoveCatalogAttributesRequest attributeKeys + */ - /** - * FacetSpec limit. - * @member {number} limit - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.limit = 0; + /** + * Constructs a new BatchRemoveCatalogAttributesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a BatchRemoveCatalogAttributesRequest. + * @implements IBatchRemoveCatalogAttributesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set + */ + function BatchRemoveCatalogAttributesRequest(properties) { + this.attributeKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FacetSpec excludedFilterKeys. - * @member {Array.} excludedFilterKeys - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + /** + * BatchRemoveCatalogAttributesRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + */ + BatchRemoveCatalogAttributesRequest.prototype.attributesConfig = ""; - /** - * FacetSpec enableDynamicPosition. - * @member {boolean} enableDynamicPosition - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @instance - */ - FacetSpec.prototype.enableDynamicPosition = false; + /** + * BatchRemoveCatalogAttributesRequest attributeKeys. + * @member {Array.} attributeKeys + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + */ + BatchRemoveCatalogAttributesRequest.prototype.attributeKeys = $util.emptyArray; - /** - * Creates a new FacetSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec instance - */ - FacetSpec.create = function create(properties) { - return new FacetSpec(properties); - }; + /** + * Creates a new BatchRemoveCatalogAttributesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest instance + */ + BatchRemoveCatalogAttributesRequest.create = function create(properties) { + return new BatchRemoveCatalogAttributesRequest(properties); + }; - /** + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); + if (message.attributeKeys != null && message.attributeKeys.length) + for (var i = 0; i < message.attributeKeys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributeKeys[i]); + return writer; + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributesConfig = reader.string(); + break; + } + case 2: { + if (!(message.attributeKeys && message.attributeKeys.length)) + message.attributeKeys = []; + message.attributeKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRemoveCatalogAttributesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRemoveCatalogAttributesRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRemoveCatalogAttributesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + if (!$util.isString(message.attributesConfig)) + return "attributesConfig: string expected"; + if (message.attributeKeys != null && message.hasOwnProperty("attributeKeys")) { + if (!Array.isArray(message.attributeKeys)) + return "attributeKeys: array expected"; + for (var i = 0; i < message.attributeKeys.length; ++i) + if (!$util.isString(message.attributeKeys[i])) + return "attributeKeys: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRemoveCatalogAttributesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} BatchRemoveCatalogAttributesRequest + */ + BatchRemoveCatalogAttributesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.attributeKeys) { + if (!Array.isArray(object.attributeKeys)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest.attributeKeys: array expected"); + message.attributeKeys = []; + for (var i = 0; i < object.attributeKeys.length; ++i) + message.attributeKeys[i] = String(object.attributeKeys[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRemoveCatalogAttributesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest} message BatchRemoveCatalogAttributesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRemoveCatalogAttributesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributeKeys = []; + if (options.defaults) + object.attributesConfig = ""; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.attributeKeys && message.attributeKeys.length) { + object.attributeKeys = []; + for (var j = 0; j < message.attributeKeys.length; ++j) + object.attributeKeys[j] = message.attributeKeys[j]; + } + return object; + }; + + /** + * Converts this BatchRemoveCatalogAttributesRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchRemoveCatalogAttributesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRemoveCatalogAttributesRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRemoveCatalogAttributesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesRequest"; + }; + + return BatchRemoveCatalogAttributesRequest; + })(); + + v2alpha.BatchRemoveCatalogAttributesResponse = (function() { + + /** + * Properties of a BatchRemoveCatalogAttributesResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IBatchRemoveCatalogAttributesResponse + * @property {Array.|null} [deletedCatalogAttributes] BatchRemoveCatalogAttributesResponse deletedCatalogAttributes + * @property {Array.|null} [resetCatalogAttributes] BatchRemoveCatalogAttributesResponse resetCatalogAttributes + */ + + /** + * Constructs a new BatchRemoveCatalogAttributesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a BatchRemoveCatalogAttributesResponse. + * @implements IBatchRemoveCatalogAttributesResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set + */ + function BatchRemoveCatalogAttributesResponse(properties) { + this.deletedCatalogAttributes = []; + this.resetCatalogAttributes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchRemoveCatalogAttributesResponse deletedCatalogAttributes. + * @member {Array.} deletedCatalogAttributes + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + */ + BatchRemoveCatalogAttributesResponse.prototype.deletedCatalogAttributes = $util.emptyArray; + + /** + * BatchRemoveCatalogAttributesResponse resetCatalogAttributes. + * @member {Array.} resetCatalogAttributes + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + */ + BatchRemoveCatalogAttributesResponse.prototype.resetCatalogAttributes = $util.emptyArray; + + /** + * Creates a new BatchRemoveCatalogAttributesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse instance + */ + BatchRemoveCatalogAttributesResponse.create = function create(properties) { + return new BatchRemoveCatalogAttributesResponse(properties); + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deletedCatalogAttributes != null && message.deletedCatalogAttributes.length) + for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.deletedCatalogAttributes[i]); + if (message.resetCatalogAttributes != null && message.resetCatalogAttributes.length) + for (var i = 0; i < message.resetCatalogAttributes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resetCatalogAttributes[i]); + return writer; + }; + + /** + * Encodes the specified BatchRemoveCatalogAttributesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.IBatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchRemoveCatalogAttributesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.deletedCatalogAttributes && message.deletedCatalogAttributes.length)) + message.deletedCatalogAttributes = []; + message.deletedCatalogAttributes.push(reader.string()); + break; + } + case 2: { + if (!(message.resetCatalogAttributes && message.resetCatalogAttributes.length)) + message.resetCatalogAttributes = []; + message.resetCatalogAttributes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchRemoveCatalogAttributesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchRemoveCatalogAttributesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchRemoveCatalogAttributesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchRemoveCatalogAttributesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deletedCatalogAttributes != null && message.hasOwnProperty("deletedCatalogAttributes")) { + if (!Array.isArray(message.deletedCatalogAttributes)) + return "deletedCatalogAttributes: array expected"; + for (var i = 0; i < message.deletedCatalogAttributes.length; ++i) + if (!$util.isString(message.deletedCatalogAttributes[i])) + return "deletedCatalogAttributes: string[] expected"; + } + if (message.resetCatalogAttributes != null && message.hasOwnProperty("resetCatalogAttributes")) { + if (!Array.isArray(message.resetCatalogAttributes)) + return "resetCatalogAttributes: array expected"; + for (var i = 0; i < message.resetCatalogAttributes.length; ++i) + if (!$util.isString(message.resetCatalogAttributes[i])) + return "resetCatalogAttributes: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchRemoveCatalogAttributesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} BatchRemoveCatalogAttributesResponse + */ + BatchRemoveCatalogAttributesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse(); + if (object.deletedCatalogAttributes) { + if (!Array.isArray(object.deletedCatalogAttributes)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.deletedCatalogAttributes: array expected"); + message.deletedCatalogAttributes = []; + for (var i = 0; i < object.deletedCatalogAttributes.length; ++i) + message.deletedCatalogAttributes[i] = String(object.deletedCatalogAttributes[i]); + } + if (object.resetCatalogAttributes) { + if (!Array.isArray(object.resetCatalogAttributes)) + throw TypeError(".google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse.resetCatalogAttributes: array expected"); + message.resetCatalogAttributes = []; + for (var i = 0; i < object.resetCatalogAttributes.length; ++i) + message.resetCatalogAttributes[i] = String(object.resetCatalogAttributes[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchRemoveCatalogAttributesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse} message BatchRemoveCatalogAttributesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchRemoveCatalogAttributesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deletedCatalogAttributes = []; + object.resetCatalogAttributes = []; + } + if (message.deletedCatalogAttributes && message.deletedCatalogAttributes.length) { + object.deletedCatalogAttributes = []; + for (var j = 0; j < message.deletedCatalogAttributes.length; ++j) + object.deletedCatalogAttributes[j] = message.deletedCatalogAttributes[j]; + } + if (message.resetCatalogAttributes && message.resetCatalogAttributes.length) { + object.resetCatalogAttributes = []; + for (var j = 0; j < message.resetCatalogAttributes.length; ++j) + object.resetCatalogAttributes[j] = message.resetCatalogAttributes[j]; + } + return object; + }; + + /** + * Converts this BatchRemoveCatalogAttributesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchRemoveCatalogAttributesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchRemoveCatalogAttributesResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchRemoveCatalogAttributesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.BatchRemoveCatalogAttributesResponse"; + }; + + return BatchRemoveCatalogAttributesResponse; + })(); + + v2alpha.ReplaceCatalogAttributeRequest = (function() { + + /** + * Properties of a ReplaceCatalogAttributeRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IReplaceCatalogAttributeRequest + * @property {string|null} [attributesConfig] ReplaceCatalogAttributeRequest attributesConfig + * @property {google.cloud.retail.v2alpha.ICatalogAttribute|null} [catalogAttribute] ReplaceCatalogAttributeRequest catalogAttribute + * @property {google.protobuf.IFieldMask|null} [updateMask] ReplaceCatalogAttributeRequest updateMask + */ + + /** + * Constructs a new ReplaceCatalogAttributeRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ReplaceCatalogAttributeRequest. + * @implements IReplaceCatalogAttributeRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest=} [properties] Properties to set + */ + function ReplaceCatalogAttributeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplaceCatalogAttributeRequest attributesConfig. + * @member {string} attributesConfig + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.attributesConfig = ""; + + /** + * ReplaceCatalogAttributeRequest catalogAttribute. + * @member {google.cloud.retail.v2alpha.ICatalogAttribute|null|undefined} catalogAttribute + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.catalogAttribute = null; + + /** + * ReplaceCatalogAttributeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @instance + */ + ReplaceCatalogAttributeRequest.prototype.updateMask = null; + + /** + * Creates a new ReplaceCatalogAttributeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest instance + */ + ReplaceCatalogAttributeRequest.create = function create(properties) { + return new ReplaceCatalogAttributeRequest(properties); + }; + + /** + * Encodes the specified ReplaceCatalogAttributeRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceCatalogAttributeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributesConfig != null && Object.hasOwnProperty.call(message, "attributesConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributesConfig); + if (message.catalogAttribute != null && Object.hasOwnProperty.call(message, "catalogAttribute")) + $root.google.cloud.retail.v2alpha.CatalogAttribute.encode(message.catalogAttribute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceCatalogAttributeRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.IReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceCatalogAttributeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceCatalogAttributeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributesConfig = reader.string(); + break; + } + case 2: { + message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceCatalogAttributeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceCatalogAttributeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceCatalogAttributeRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceCatalogAttributeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + if (!$util.isString(message.attributesConfig)) + return "attributesConfig: string expected"; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) { + var error = $root.google.cloud.retail.v2alpha.CatalogAttribute.verify(message.catalogAttribute); + if (error) + return "catalogAttribute." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a ReplaceCatalogAttributeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} ReplaceCatalogAttributeRequest + */ + ReplaceCatalogAttributeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest(); + if (object.attributesConfig != null) + message.attributesConfig = String(object.attributesConfig); + if (object.catalogAttribute != null) { + if (typeof object.catalogAttribute !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.catalogAttribute: object expected"); + message.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.fromObject(object.catalogAttribute); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceCatalogAttributeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest} message ReplaceCatalogAttributeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceCatalogAttributeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributesConfig = ""; + object.catalogAttribute = null; + object.updateMask = null; + } + if (message.attributesConfig != null && message.hasOwnProperty("attributesConfig")) + object.attributesConfig = message.attributesConfig; + if (message.catalogAttribute != null && message.hasOwnProperty("catalogAttribute")) + object.catalogAttribute = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttribute, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this ReplaceCatalogAttributeRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @instance + * @returns {Object.} JSON object + */ + ReplaceCatalogAttributeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplaceCatalogAttributeRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplaceCatalogAttributeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ReplaceCatalogAttributeRequest"; + }; + + return ReplaceCatalogAttributeRequest; + })(); + + v2alpha.CompletionService = (function() { + + /** + * Constructs a new CompletionService service. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CompletionService + * @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 CompletionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CompletionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CompletionService; + + /** + * Creates new CompletionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.CompletionService + * @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 {CompletionService} RPC service. Useful where requests and/or responses are streamed. + */ + CompletionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|completeQuery}. + * @memberof google.cloud.retail.v2alpha.CompletionService + * @typedef CompleteQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} [response] CompleteQueryResponse + */ + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @param {google.cloud.retail.v2alpha.CompletionService.CompleteQueryCallback} callback Node-style callback called with the error, if any, and CompleteQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.completeQuery = function completeQuery(request, callback) { + return this.rpcCall(completeQuery, $root.google.cloud.retail.v2alpha.CompleteQueryRequest, $root.google.cloud.retail.v2alpha.CompleteQueryResponse, request, callback); + }, "name", { value: "CompleteQuery" }); + + /** + * Calls CompleteQuery. + * @function completeQuery + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} request CompleteQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.CompletionService|importCompletionData}. + * @memberof google.cloud.retail.v2alpha.CompletionService + * @typedef ImportCompletionDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @param {google.cloud.retail.v2alpha.CompletionService.ImportCompletionDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CompletionService.prototype.importCompletionData = function importCompletionData(request, callback) { + return this.rpcCall(importCompletionData, $root.google.cloud.retail.v2alpha.ImportCompletionDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportCompletionData" }); + + /** + * Calls ImportCompletionData. + * @function importCompletionData + * @memberof google.cloud.retail.v2alpha.CompletionService + * @instance + * @param {google.cloud.retail.v2alpha.IImportCompletionDataRequest} request ImportCompletionDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CompletionService; + })(); + + v2alpha.CompleteQueryRequest = (function() { + + /** + * Properties of a CompleteQueryRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ICompleteQueryRequest + * @property {string|null} [catalog] CompleteQueryRequest catalog + * @property {string|null} [query] CompleteQueryRequest query + * @property {string|null} [visitorId] CompleteQueryRequest visitorId + * @property {Array.|null} [languageCodes] CompleteQueryRequest languageCodes + * @property {string|null} [deviceType] CompleteQueryRequest deviceType + * @property {string|null} [dataset] CompleteQueryRequest dataset + * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @property {boolean|null} [enableAttributeSuggestions] CompleteQueryRequest enableAttributeSuggestions + * @property {string|null} [entity] CompleteQueryRequest entity + */ + + /** + * Constructs a new CompleteQueryRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CompleteQueryRequest. + * @implements ICompleteQueryRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + */ + function CompleteQueryRequest(properties) { + this.languageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryRequest catalog. + * @member {string} catalog + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.catalog = ""; + + /** + * CompleteQueryRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.query = ""; + + /** + * CompleteQueryRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.visitorId = ""; + + /** + * CompleteQueryRequest languageCodes. + * @member {Array.} languageCodes + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.languageCodes = $util.emptyArray; + + /** + * CompleteQueryRequest deviceType. + * @member {string} deviceType + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.deviceType = ""; + + /** + * CompleteQueryRequest dataset. + * @member {string} dataset + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.dataset = ""; + + /** + * CompleteQueryRequest maxSuggestions. + * @member {number} maxSuggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.maxSuggestions = 0; + + /** + * CompleteQueryRequest enableAttributeSuggestions. + * @member {boolean} enableAttributeSuggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.enableAttributeSuggestions = false; + + /** + * CompleteQueryRequest entity. + * @member {string} entity + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.entity = ""; + + /** + * Creates a new CompleteQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest instance + */ + CompleteQueryRequest.create = function create(properties) { + return new CompleteQueryRequest(properties); + }; + + /** + * Encodes the specified CompleteQueryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalog); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.languageCodes != null && message.languageCodes.length) + for (var i = 0; i < message.languageCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCodes[i]); + if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceType); + if (message.maxSuggestions != null && Object.hasOwnProperty.call(message, "maxSuggestions")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSuggestions); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); + if (message.enableAttributeSuggestions != null && Object.hasOwnProperty.call(message, "enableAttributeSuggestions")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableAttributeSuggestions); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.entity); + return writer; + }; + + /** + * Encodes the specified CompleteQueryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryRequest} message CompleteQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.catalog = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 7: { + message.visitorId = reader.string(); + break; + } + case 3: { + if (!(message.languageCodes && message.languageCodes.length)) + message.languageCodes = []; + message.languageCodes.push(reader.string()); + break; + } + case 4: { + message.deviceType = reader.string(); + break; + } + case 6: { + message.dataset = reader.string(); + break; + } + case 5: { + message.maxSuggestions = reader.int32(); + break; + } + case 9: { + message.enableAttributeSuggestions = reader.bool(); + break; + } + case 10: { + message.entity = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) + if (!$util.isString(message.catalog)) + return "catalog: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.languageCodes != null && message.hasOwnProperty("languageCodes")) { + if (!Array.isArray(message.languageCodes)) + return "languageCodes: array expected"; + for (var i = 0; i < message.languageCodes.length; ++i) + if (!$util.isString(message.languageCodes[i])) + return "languageCodes: string[] expected"; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + if (!$util.isString(message.deviceType)) + return "deviceType: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + if (!$util.isInteger(message.maxSuggestions)) + return "maxSuggestions: integer expected"; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + if (typeof message.enableAttributeSuggestions !== "boolean") + return "enableAttributeSuggestions: boolean expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + return null; + }; + + /** + * Creates a CompleteQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryRequest} CompleteQueryRequest + */ + CompleteQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryRequest(); + if (object.catalog != null) + message.catalog = String(object.catalog); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.languageCodes) { + if (!Array.isArray(object.languageCodes)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryRequest.languageCodes: array expected"); + message.languageCodes = []; + for (var i = 0; i < object.languageCodes.length; ++i) + message.languageCodes[i] = String(object.languageCodes[i]); + } + if (object.deviceType != null) + message.deviceType = String(object.deviceType); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.maxSuggestions != null) + message.maxSuggestions = object.maxSuggestions | 0; + if (object.enableAttributeSuggestions != null) + message.enableAttributeSuggestions = Boolean(object.enableAttributeSuggestions); + if (object.entity != null) + message.entity = String(object.entity); + return message; + }; + + /** + * Creates a plain object from a CompleteQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryRequest} message CompleteQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageCodes = []; + if (options.defaults) { + object.catalog = ""; + object.query = ""; + object.deviceType = ""; + object.maxSuggestions = 0; + object.dataset = ""; + object.visitorId = ""; + object.enableAttributeSuggestions = false; + object.entity = ""; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = message.catalog; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.languageCodes && message.languageCodes.length) { + object.languageCodes = []; + for (var j = 0; j < message.languageCodes.length; ++j) + object.languageCodes[j] = message.languageCodes[j]; + } + if (message.deviceType != null && message.hasOwnProperty("deviceType")) + object.deviceType = message.deviceType; + if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) + object.maxSuggestions = message.maxSuggestions; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + object.enableAttributeSuggestions = message.enableAttributeSuggestions; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + return object; + }; + + /** + * Converts this CompleteQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryRequest"; + }; + + return CompleteQueryRequest; + })(); + + v2alpha.CompleteQueryResponse = (function() { + + /** + * Properties of a CompleteQueryResponse. + * @memberof google.cloud.retail.v2alpha + * @interface ICompleteQueryResponse + * @property {Array.|null} [completionResults] CompleteQueryResponse completionResults + * @property {string|null} [attributionToken] CompleteQueryResponse attributionToken + * @property {Array.|null} [recentSearchResults] CompleteQueryResponse recentSearchResults + * @property {Object.|null} [attributeResults] CompleteQueryResponse attributeResults + */ + + /** + * Constructs a new CompleteQueryResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CompleteQueryResponse. + * @implements ICompleteQueryResponse + * @constructor + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set + */ + function CompleteQueryResponse(properties) { + this.completionResults = []; + this.recentSearchResults = []; + this.attributeResults = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompleteQueryResponse completionResults. + * @member {Array.} completionResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.completionResults = $util.emptyArray; + + /** + * CompleteQueryResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.attributionToken = ""; + + /** + * CompleteQueryResponse recentSearchResults. + * @member {Array.} recentSearchResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.recentSearchResults = $util.emptyArray; + + /** + * CompleteQueryResponse attributeResults. + * @member {Object.} attributeResults + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + */ + CompleteQueryResponse.prototype.attributeResults = $util.emptyObject; + + /** + * Creates a new CompleteQueryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse instance + */ + CompleteQueryResponse.create = function create(properties) { + return new CompleteQueryResponse(properties); + }; + + /** + * Encodes the specified CompleteQueryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.completionResults != null && message.completionResults.length) + for (var i = 0; i < message.completionResults.length; ++i) + $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.encode(message.completionResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + if (message.recentSearchResults != null && message.recentSearchResults.length) + for (var i = 0; i < message.recentSearchResults.length; ++i) + $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.encode(message.recentSearchResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attributeResults != null && Object.hasOwnProperty.call(message, "attributeResults")) + for (var keys = Object.keys(message.attributeResults), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.encode(message.attributeResults[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CompleteQueryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2alpha.ICompleteQueryResponse} message CompleteQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.completionResults && message.completionResults.length)) + message.completionResults = []; + message.completionResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.attributionToken = reader.string(); + break; + } + case 3: { + if (!(message.recentSearchResults && message.recentSearchResults.length)) + message.recentSearchResults = []; + message.recentSearchResults.push($root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.decode(reader, reader.uint32())); + break; + } + case 4: { + if (message.attributeResults === $util.emptyObject) + message.attributeResults = {}; + 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.retail.v2alpha.CompleteQueryResponse.AttributeResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributeResults[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompleteQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompleteQueryResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.completionResults != null && message.hasOwnProperty("completionResults")) { + if (!Array.isArray(message.completionResults)) + return "completionResults: array expected"; + for (var i = 0; i < message.completionResults.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify(message.completionResults[i]); + if (error) + return "completionResults." + error; + } + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.recentSearchResults != null && message.hasOwnProperty("recentSearchResults")) { + if (!Array.isArray(message.recentSearchResults)) + return "recentSearchResults: array expected"; + for (var i = 0; i < message.recentSearchResults.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify(message.recentSearchResults[i]); + if (error) + return "recentSearchResults." + error; + } + } + if (message.attributeResults != null && message.hasOwnProperty("attributeResults")) { + if (!$util.isObject(message.attributeResults)) + return "attributeResults: object expected"; + var key = Object.keys(message.attributeResults); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify(message.attributeResults[key[i]]); + if (error) + return "attributeResults." + error; + } + } + return null; + }; + + /** + * Creates a CompleteQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse} CompleteQueryResponse + */ + CompleteQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse(); + if (object.completionResults) { + if (!Array.isArray(object.completionResults)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: array expected"); + message.completionResults = []; + for (var i = 0; i < object.completionResults.length; ++i) { + if (typeof object.completionResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.completionResults: object expected"); + message.completionResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.fromObject(object.completionResults[i]); + } + } + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.recentSearchResults) { + if (!Array.isArray(object.recentSearchResults)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: array expected"); + message.recentSearchResults = []; + for (var i = 0; i < object.recentSearchResults.length; ++i) { + if (typeof object.recentSearchResults[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.recentSearchResults: object expected"); + message.recentSearchResults[i] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.fromObject(object.recentSearchResults[i]); + } + } + if (object.attributeResults) { + if (typeof object.attributeResults !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); + message.attributeResults = {}; + for (var keys = Object.keys(object.attributeResults), i = 0; i < keys.length; ++i) { + if (typeof object.attributeResults[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.attributeResults: object expected"); + message.attributeResults[keys[i]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.fromObject(object.attributeResults[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompleteQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse} message CompleteQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.completionResults = []; + object.recentSearchResults = []; + } + if (options.objects || options.defaults) + object.attributeResults = {}; + if (options.defaults) + object.attributionToken = ""; + if (message.completionResults && message.completionResults.length) { + object.completionResults = []; + for (var j = 0; j < message.completionResults.length; ++j) + object.completionResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.toObject(message.completionResults[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.recentSearchResults && message.recentSearchResults.length) { + object.recentSearchResults = []; + for (var j = 0; j < message.recentSearchResults.length; ++j) + object.recentSearchResults[j] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.toObject(message.recentSearchResults[j], options); + } + var keys2; + if (message.attributeResults && (keys2 = Object.keys(message.attributeResults)).length) { + object.attributeResults = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributeResults[keys2[j]] = $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.toObject(message.attributeResults[keys2[j]], options); + } + return object; + }; + + /** + * Converts this CompleteQueryResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @instance + * @returns {Object.} JSON object + */ + CompleteQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompleteQueryResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompleteQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse"; + }; + + CompleteQueryResponse.CompletionResult = (function() { + + /** + * Properties of a CompletionResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface ICompletionResult + * @property {string|null} [suggestion] CompletionResult suggestion + * @property {Object.|null} [attributes] CompletionResult attributes + * @property {Array.|null} [facets] CompletionResult facets + * @property {number|null} [totalProductCount] CompletionResult totalProductCount + */ + + /** + * Constructs a new CompletionResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents a CompletionResult. + * @implements ICompletionResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + */ + function CompletionResult(properties) { + this.attributes = {}; + this.facets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompletionResult suggestion. + * @member {string} suggestion + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.suggestion = ""; + + /** + * CompletionResult attributes. + * @member {Object.} attributes + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.attributes = $util.emptyObject; + + /** + * CompletionResult facets. + * @member {Array.} facets + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.facets = $util.emptyArray; + + /** + * CompletionResult totalProductCount. + * @member {number} totalProductCount + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + */ + CompletionResult.prototype.totalProductCount = 0; + + /** + * Creates a new CompletionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult instance + */ + CompletionResult.create = function create(properties) { + return new CompletionResult(properties); + }; + + /** + * Encodes the specified CompletionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestion); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.retail.v2alpha.CustomAttribute.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.facets != null && message.facets.length) + for (var i = 0; i < message.facets.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalProductCount != null && Object.hasOwnProperty.call(message, "totalProductCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.totalProductCount); + return writer; + }; + + /** + * Encodes the specified CompletionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.ICompletionResult} message CompletionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompletionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestion = reader.string(); + break; + } + case 2: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.retail.v2alpha.CustomAttribute.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 3: { + if (!(message.facets && message.facets.length)) + message.facets = []; + message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); + break; + } + case 4: { + message.totalProductCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompletionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompletionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompletionResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompletionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + if (!$util.isString(message.suggestion)) + return "suggestion: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.CustomAttribute.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.facets != null && message.hasOwnProperty("facets")) { + if (!Array.isArray(message.facets)) + return "facets: array expected"; + for (var i = 0; i < message.facets.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); + if (error) + return "facets." + error; + } + } + if (message.totalProductCount != null && message.hasOwnProperty("totalProductCount")) + if (!$util.isInteger(message.totalProductCount)) + return "totalProductCount: integer expected"; + return null; + }; + + /** + * Creates a CompletionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} CompletionResult + */ + CompletionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult(); + if (object.suggestion != null) + message.suggestion = String(object.suggestion); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.retail.v2alpha.CustomAttribute.fromObject(object.attributes[keys[i]]); + } + } + if (object.facets) { + if (!Array.isArray(object.facets)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.facets: array expected"); + message.facets = []; + for (var i = 0; i < object.facets.length; ++i) { + if (typeof object.facets[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult.facets: object expected"); + message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); + } + } + if (object.totalProductCount != null) + message.totalProductCount = object.totalProductCount | 0; + return message; + }; + + /** + * Creates a plain object from a CompletionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult} message CompletionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompletionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facets = []; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.suggestion = ""; + object.totalProductCount = 0; + } + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = message.suggestion; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CustomAttribute.toObject(message.attributes[keys2[j]], options); + } + if (message.facets && message.facets.length) { + object.facets = []; + for (var j = 0; j < message.facets.length; ++j) + object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); + } + if (message.totalProductCount != null && message.hasOwnProperty("totalProductCount")) + object.totalProductCount = message.totalProductCount; + return object; + }; + + /** + * Converts this CompletionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @instance + * @returns {Object.} JSON object + */ + CompletionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompletionResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompletionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.CompletionResult"; + }; + + return CompletionResult; + })(); + + CompleteQueryResponse.RecentSearchResult = (function() { + + /** + * Properties of a RecentSearchResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface IRecentSearchResult + * @property {string|null} [recentSearch] RecentSearchResult recentSearch + */ + + /** + * Constructs a new RecentSearchResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents a RecentSearchResult. + * @implements IRecentSearchResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + */ + function RecentSearchResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecentSearchResult recentSearch. + * @member {string} recentSearch + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @instance + */ + RecentSearchResult.prototype.recentSearch = ""; + + /** + * Creates a new RecentSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult instance + */ + RecentSearchResult.create = function create(properties) { + return new RecentSearchResult(properties); + }; + + /** + * Encodes the specified RecentSearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recentSearch != null && Object.hasOwnProperty.call(message, "recentSearch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.recentSearch); + return writer; + }; + + /** + * Encodes the specified RecentSearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IRecentSearchResult} message RecentSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecentSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recentSearch = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecentSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecentSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecentSearchResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecentSearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + if (!$util.isString(message.recentSearch)) + return "recentSearch: string expected"; + return null; + }; + + /** + * Creates a RecentSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} RecentSearchResult + */ + RecentSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult(); + if (object.recentSearch != null) + message.recentSearch = String(object.recentSearch); + return message; + }; + + /** + * Creates a plain object from a RecentSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult} message RecentSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecentSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recentSearch = ""; + if (message.recentSearch != null && message.hasOwnProperty("recentSearch")) + object.recentSearch = message.recentSearch; + return object; + }; + + /** + * Converts this RecentSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @instance + * @returns {Object.} JSON object + */ + RecentSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecentSearchResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecentSearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.RecentSearchResult"; + }; + + return RecentSearchResult; + })(); + + CompleteQueryResponse.AttributeResult = (function() { + + /** + * Properties of an AttributeResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @interface IAttributeResult + * @property {Array.|null} [suggestions] AttributeResult suggestions + */ + + /** + * Constructs a new AttributeResult. + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse + * @classdesc Represents an AttributeResult. + * @implements IAttributeResult + * @constructor + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set + */ + function AttributeResult(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttributeResult suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @instance + */ + AttributeResult.prototype.suggestions = $util.emptyArray; + + /** + * Creates a new AttributeResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult instance + */ + AttributeResult.create = function create(properties) { + return new AttributeResult(properties); + }; + + /** + * Encodes the specified AttributeResult message. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.suggestions[i]); + return writer; + }; + + /** + * Encodes the specified AttributeResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.IAttributeResult} message AttributeResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributeResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributeResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributeResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributeResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributeResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributeResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) + if (!$util.isString(message.suggestions[i])) + return "suggestions: string[] expected"; + } + return null; + }; + + /** + * Creates an AttributeResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} AttributeResult + */ + AttributeResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) + message.suggestions[i] = String(object.suggestions[i]); + } + return message; + }; + + /** + * Creates a plain object from an AttributeResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult} message AttributeResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributeResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = message.suggestions[j]; + } + return object; + }; + + /** + * Converts this AttributeResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @instance + * @returns {Object.} JSON object + */ + AttributeResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributeResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributeResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CompleteQueryResponse.AttributeResult"; + }; + + return AttributeResult; + })(); + + return CompleteQueryResponse; + })(); + + v2alpha.SearchService = (function() { + + /** + * Constructs a new SearchService service. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SearchService + * @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 SearchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SearchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SearchService; + + /** + * Creates new SearchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchService + * @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 {SearchService} RPC service. Useful where requests and/or responses are streamed. + */ + SearchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.SearchService|search}. + * @memberof google.cloud.retail.v2alpha.SearchService + * @typedef SearchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.SearchResponse} [response] SearchResponse + */ + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2alpha.SearchService + * @instance + * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object + * @param {google.cloud.retail.v2alpha.SearchService.SearchCallback} callback Node-style callback called with the error, if any, and SearchResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SearchService.prototype.search = function search(request, callback) { + return this.rpcCall(search, $root.google.cloud.retail.v2alpha.SearchRequest, $root.google.cloud.retail.v2alpha.SearchResponse, request, callback); + }, "name", { value: "Search" }); + + /** + * Calls Search. + * @function search + * @memberof google.cloud.retail.v2alpha.SearchService + * @instance + * @param {google.cloud.retail.v2alpha.ISearchRequest} request SearchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SearchService; + })(); + + v2alpha.SearchRequest = (function() { + + /** + * Properties of a SearchRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ISearchRequest + * @property {string|null} [placement] SearchRequest placement + * @property {string|null} [branch] SearchRequest branch + * @property {string|null} [query] SearchRequest query + * @property {string|null} [visitorId] SearchRequest visitorId + * @property {google.cloud.retail.v2alpha.IUserInfo|null} [userInfo] SearchRequest userInfo + * @property {number|null} [pageSize] SearchRequest pageSize + * @property {string|null} [pageToken] SearchRequest pageToken + * @property {number|null} [offset] SearchRequest offset + * @property {string|null} [filter] SearchRequest filter + * @property {string|null} [canonicalFilter] SearchRequest canonicalFilter + * @property {string|null} [orderBy] SearchRequest orderBy + * @property {Array.|null} [facetSpecs] SearchRequest facetSpecs + * @property {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null} [dynamicFacetSpec] SearchRequest dynamicFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null} [boostSpec] SearchRequest boostSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null} [queryExpansionSpec] SearchRequest queryExpansionSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold|null} [relevanceThreshold] SearchRequest relevanceThreshold + * @property {Array.|null} [variantRollupKeys] SearchRequest variantRollupKeys + * @property {Array.|null} [pageCategories] SearchRequest pageCategories + * @property {google.cloud.retail.v2alpha.SearchRequest.SearchMode|null} [searchMode] SearchRequest searchMode + * @property {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] SearchRequest personalizationSpec + * @property {Object.|null} [labels] SearchRequest labels + * @property {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null} [spellCorrectionSpec] SearchRequest spellCorrectionSpec + * @property {string|null} [entity] SearchRequest entity + */ + + /** + * Constructs a new SearchRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SearchRequest. + * @implements ISearchRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set + */ + function SearchRequest(properties) { + this.facetSpecs = []; + this.variantRollupKeys = []; + this.pageCategories = []; + 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]]; + } + + /** + * SearchRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.placement = ""; + + /** + * SearchRequest branch. + * @member {string} branch + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.branch = ""; + + /** + * SearchRequest query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.query = ""; + + /** + * SearchRequest visitorId. + * @member {string} visitorId + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.visitorId = ""; + + /** + * SearchRequest userInfo. + * @member {google.cloud.retail.v2alpha.IUserInfo|null|undefined} userInfo + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.userInfo = null; + + /** + * SearchRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.pageSize = 0; + + /** + * SearchRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.pageToken = ""; + + /** + * SearchRequest offset. + * @member {number} offset + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.offset = 0; + + /** + * SearchRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.filter = ""; + + /** + * SearchRequest canonicalFilter. + * @member {string} canonicalFilter + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.canonicalFilter = ""; + + /** + * SearchRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.orderBy = ""; + + /** + * SearchRequest facetSpecs. + * @member {Array.} facetSpecs + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.facetSpecs = $util.emptyArray; + + /** + * SearchRequest dynamicFacetSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec|null|undefined} dynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.dynamicFacetSpec = null; + + /** + * SearchRequest boostSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec|null|undefined} boostSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.boostSpec = null; + + /** + * SearchRequest queryExpansionSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec|null|undefined} queryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.queryExpansionSpec = null; + + /** + * SearchRequest relevanceThreshold. + * @member {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} relevanceThreshold + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.relevanceThreshold = 0; + + /** + * SearchRequest variantRollupKeys. + * @member {Array.} variantRollupKeys + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.variantRollupKeys = $util.emptyArray; + + /** + * SearchRequest pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.pageCategories = $util.emptyArray; + + /** + * SearchRequest searchMode. + * @member {google.cloud.retail.v2alpha.SearchRequest.SearchMode} searchMode + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.searchMode = 0; + + /** + * SearchRequest personalizationSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.personalizationSpec = null; + + /** + * SearchRequest labels. + * @member {Object.} labels + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.labels = $util.emptyObject; + + /** + * SearchRequest spellCorrectionSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec|null|undefined} spellCorrectionSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.spellCorrectionSpec = null; + + /** + * SearchRequest entity. + * @member {string} entity + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + SearchRequest.prototype.entity = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SearchRequest _spellCorrectionSpec. + * @member {"spellCorrectionSpec"|undefined} _spellCorrectionSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + */ + Object.defineProperty(SearchRequest.prototype, "_spellCorrectionSpec", { + get: $util.oneOfGetter($oneOfFields = ["spellCorrectionSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SearchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {google.cloud.retail.v2alpha.ISearchRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest instance + */ + SearchRequest.create = function create(properties) { + return new SearchRequest(properties); + }; + + /** + * Encodes the specified SearchRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.query); + if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.visitorId); + if (message.userInfo != null && Object.hasOwnProperty.call(message, "userInfo")) + $root.google.cloud.retail.v2alpha.UserInfo.encode(message.userInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pageToken); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.offset); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.orderBy); + if (message.facetSpecs != null && message.facetSpecs.length) + for (var i = 0; i < message.facetSpecs.length; ++i) + $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpecs[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.boostSpec != null && Object.hasOwnProperty.call(message, "boostSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.encode(message.boostSpec, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.queryExpansionSpec != null && Object.hasOwnProperty.call(message, "queryExpansionSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.encode(message.queryExpansionSpec, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.relevanceThreshold != null && Object.hasOwnProperty.call(message, "relevanceThreshold")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.relevanceThreshold); + if (message.variantRollupKeys != null && message.variantRollupKeys.length) + for (var i = 0; i < message.variantRollupKeys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.variantRollupKeys[i]); + if (message.dynamicFacetSpec != null && Object.hasOwnProperty.call(message, "dynamicFacetSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.encode(message.dynamicFacetSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.pageCategories[i]); + if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.canonicalFilter); + if (message.searchMode != null && Object.hasOwnProperty.call(message, "searchMode")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.searchMode); + if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 32, wireType 2 =*/258).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(); + if (message.spellCorrectionSpec != null && Object.hasOwnProperty.call(message, "spellCorrectionSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.encode(message.spellCorrectionSpec, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 38, wireType 2 =*/306).string(message.entity); + return writer; + }; + + /** + * Encodes the specified SearchRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {google.cloud.retail.v2alpha.ISearchRequest} message SearchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.placement = reader.string(); + break; + } + case 2: { + message.branch = reader.string(); + break; + } + case 3: { + message.query = reader.string(); + break; + } + case 4: { + message.visitorId = reader.string(); + break; + } + case 5: { + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pageSize = reader.int32(); + break; + } + case 8: { + message.pageToken = reader.string(); + break; + } + case 9: { + message.offset = reader.int32(); + break; + } + case 10: { + message.filter = reader.string(); + break; + } + case 28: { + message.canonicalFilter = reader.string(); + break; + } + case 11: { + message.orderBy = reader.string(); + break; + } + case 12: { + if (!(message.facetSpecs && message.facetSpecs.length)) + message.facetSpecs = []; + message.facetSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32())); + break; + } + case 21: { + message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.decode(reader, reader.uint32()); + break; + } + case 13: { + message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.decode(reader, reader.uint32()); + break; + } + case 14: { + message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.decode(reader, reader.uint32()); + break; + } + case 15: { + message.relevanceThreshold = reader.int32(); + break; + } + case 17: { + if (!(message.variantRollupKeys && message.variantRollupKeys.length)) + message.variantRollupKeys = []; + message.variantRollupKeys.push(reader.string()); + break; + } + case 23: { + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + } + case 31: { + message.searchMode = reader.int32(); + break; + } + case 32: { + message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); + 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; + } + case 35: { + message.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.decode(reader, reader.uint32()); + break; + } + case 38: { + message.entity = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.branch != null && message.hasOwnProperty("branch")) + if (!$util.isString(message.branch)) + return "branch: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + if (!$util.isString(message.visitorId)) + return "visitorId: string expected"; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) { + var error = $root.google.cloud.retail.v2alpha.UserInfo.verify(message.userInfo); + if (error) + return "userInfo." + error; + } + 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.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + if (!$util.isString(message.canonicalFilter)) + return "canonicalFilter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.facetSpecs != null && message.hasOwnProperty("facetSpecs")) { + if (!Array.isArray(message.facetSpecs)) + return "facetSpecs: array expected"; + for (var i = 0; i < message.facetSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpecs[i]); + if (error) + return "facetSpecs." + error; + } + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify(message.dynamicFacetSpec); + if (error) + return "dynamicFacetSpec." + error; + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify(message.boostSpec); + if (error) + return "boostSpec." + error; + } + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify(message.queryExpansionSpec); + if (error) + return "queryExpansionSpec." + error; + } + if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) + switch (message.relevanceThreshold) { + default: + return "relevanceThreshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.variantRollupKeys != null && message.hasOwnProperty("variantRollupKeys")) { + if (!Array.isArray(message.variantRollupKeys)) + return "variantRollupKeys: array expected"; + for (var i = 0; i < message.variantRollupKeys.length; ++i) + if (!$util.isString(message.variantRollupKeys[i])) + return "variantRollupKeys: string[] expected"; + } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + switch (message.searchMode) { + default: + return "searchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); + if (error) + return "personalizationSpec." + 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.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) { + properties._spellCorrectionSpec = 1; + { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify(message.spellCorrectionSpec); + if (error) + return "spellCorrectionSpec." + error; + } + } + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + return null; + }; + + /** + * Creates a SearchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest} SearchRequest + */ + SearchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.branch != null) + message.branch = String(object.branch); + if (object.query != null) + message.query = String(object.query); + if (object.visitorId != null) + message.visitorId = String(object.visitorId); + if (object.userInfo != null) { + if (typeof object.userInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.userInfo: object expected"); + message.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.fromObject(object.userInfo); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.offset != null) + message.offset = object.offset | 0; + if (object.filter != null) + message.filter = String(object.filter); + if (object.canonicalFilter != null) + message.canonicalFilter = String(object.canonicalFilter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.facetSpecs) { + if (!Array.isArray(object.facetSpecs)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: array expected"); + message.facetSpecs = []; + for (var i = 0; i < object.facetSpecs.length; ++i) { + if (typeof object.facetSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.facetSpecs: object expected"); + message.facetSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpecs[i]); + } + } + if (object.dynamicFacetSpec != null) { + if (typeof object.dynamicFacetSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.dynamicFacetSpec: object expected"); + message.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.fromObject(object.dynamicFacetSpec); + } + if (object.boostSpec != null) { + if (typeof object.boostSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.boostSpec: object expected"); + message.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.fromObject(object.boostSpec); + } + if (object.queryExpansionSpec != null) { + if (typeof object.queryExpansionSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.queryExpansionSpec: object expected"); + message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); + } + switch (object.relevanceThreshold) { + default: + if (typeof object.relevanceThreshold === "number") { + message.relevanceThreshold = object.relevanceThreshold; + break; + } + break; + case "RELEVANCE_THRESHOLD_UNSPECIFIED": + case 0: + message.relevanceThreshold = 0; + break; + case "HIGH": + case 1: + message.relevanceThreshold = 1; + break; + case "MEDIUM": + case 2: + message.relevanceThreshold = 2; + break; + case "LOW": + case 3: + message.relevanceThreshold = 3; + break; + case "LOWEST": + case 4: + message.relevanceThreshold = 4; + break; + } + if (object.variantRollupKeys) { + if (!Array.isArray(object.variantRollupKeys)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.variantRollupKeys: array expected"); + message.variantRollupKeys = []; + for (var i = 0; i < object.variantRollupKeys.length; ++i) + message.variantRollupKeys[i] = String(object.variantRollupKeys[i]); + } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } + switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; + case "SEARCH_MODE_UNSPECIFIED": + case 0: + message.searchMode = 0; + break; + case "PRODUCT_SEARCH_ONLY": + case 1: + message.searchMode = 1; + break; + case "FACETED_SEARCH_ONLY": + case 2: + message.searchMode = 2; + break; + } + if (object.personalizationSpec != null) { + if (typeof object.personalizationSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.personalizationSpec: object expected"); + message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.fromObject(object.personalizationSpec); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.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.spellCorrectionSpec != null) { + if (typeof object.spellCorrectionSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.spellCorrectionSpec: object expected"); + message.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.fromObject(object.spellCorrectionSpec); + } + if (object.entity != null) + message.entity = String(object.entity); + return message; + }; + + /** + * Creates a plain object from a SearchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest} message SearchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetSpecs = []; + object.variantRollupKeys = []; + object.pageCategories = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.placement = ""; + object.branch = ""; + object.query = ""; + object.visitorId = ""; + object.userInfo = null; + object.pageSize = 0; + object.pageToken = ""; + object.offset = 0; + object.filter = ""; + object.orderBy = ""; + object.boostSpec = null; + object.queryExpansionSpec = null; + object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0; + object.dynamicFacetSpec = null; + object.canonicalFilter = ""; + object.searchMode = options.enums === String ? "SEARCH_MODE_UNSPECIFIED" : 0; + object.personalizationSpec = null; + object.entity = ""; + } + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.branch != null && message.hasOwnProperty("branch")) + object.branch = message.branch; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.visitorId != null && message.hasOwnProperty("visitorId")) + object.visitorId = message.visitorId; + if (message.userInfo != null && message.hasOwnProperty("userInfo")) + object.userInfo = $root.google.cloud.retail.v2alpha.UserInfo.toObject(message.userInfo, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.facetSpecs && message.facetSpecs.length) { + object.facetSpecs = []; + for (var j = 0; j < message.facetSpecs.length; ++j) + object.facetSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpecs[j], options); + } + if (message.boostSpec != null && message.hasOwnProperty("boostSpec")) + object.boostSpec = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.toObject(message.boostSpec, options); + if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) + object.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); + if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) + object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] === undefined ? message.relevanceThreshold : $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; + if (message.variantRollupKeys && message.variantRollupKeys.length) { + object.variantRollupKeys = []; + for (var j = 0; j < message.variantRollupKeys.length; ++j) + object.variantRollupKeys[j] = message.variantRollupKeys[j]; + } + if (message.dynamicFacetSpec != null && message.hasOwnProperty("dynamicFacetSpec")) + object.dynamicFacetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.toObject(message.dynamicFacetSpec, options); + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } + if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) + object.canonicalFilter = message.canonicalFilter; + if (message.searchMode != null && message.hasOwnProperty("searchMode")) + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) + object.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, 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.spellCorrectionSpec != null && message.hasOwnProperty("spellCorrectionSpec")) { + object.spellCorrectionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.toObject(message.spellCorrectionSpec, options); + if (options.oneofs) + object._spellCorrectionSpec = "spellCorrectionSpec"; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + return object; + }; + + /** + * Converts this SearchRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @instance + * @returns {Object.} JSON object + */ + SearchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest"; + }; + + SearchRequest.FacetSpec = (function() { + + /** + * Properties of a FacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null} [facetKey] FacetSpec facetKey + * @property {number|null} [limit] FacetSpec limit + * @property {Array.|null} [excludedFilterKeys] FacetSpec excludedFilterKeys + * @property {boolean|null} [enableDynamicPosition] FacetSpec enableDynamicPosition + */ + + /** + * Constructs a new FacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a FacetSpec. + * @implements IFacetSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set + */ + function FacetSpec(properties) { + this.excludedFilterKeys = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetSpec facetKey. + * @member {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey|null|undefined} facetKey + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.facetKey = null; + + /** + * FacetSpec limit. + * @member {number} limit + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.limit = 0; + + /** + * FacetSpec excludedFilterKeys. + * @member {Array.} excludedFilterKeys + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.excludedFilterKeys = $util.emptyArray; + + /** + * FacetSpec enableDynamicPosition. + * @member {boolean} enableDynamicPosition + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + */ + FacetSpec.prototype.enableDynamicPosition = false; + + /** + * Creates a new FacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec instance + */ + FacetSpec.create = function create(properties) { + return new FacetSpec(properties); + }; + + /** * Encodes the specified FacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) + $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); + if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); + if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); + return writer; + }; + + /** + * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = reader.int32(); + break; + } + case 3: { + if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) + message.excludedFilterKeys = []; + message.excludedFilterKeys.push(reader.string()); + break; + } + case 4: { + message.enableDynamicPosition = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetKey != null && message.hasOwnProperty("facetKey")) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); + if (error) + return "facetKey." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { + if (!Array.isArray(message.excludedFilterKeys)) + return "excludedFilterKeys: array expected"; + for (var i = 0; i < message.excludedFilterKeys.length; ++i) + if (!$util.isString(message.excludedFilterKeys[i])) + return "excludedFilterKeys: string[] expected"; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + if (typeof message.enableDynamicPosition !== "boolean") + return "enableDynamicPosition: boolean expected"; + return null; + }; + + /** + * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + */ + FacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); + if (object.facetKey != null) { + if (typeof object.facetKey !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.facetKey: object expected"); + message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); + } + if (object.limit != null) + message.limit = object.limit | 0; + if (object.excludedFilterKeys) { + if (!Array.isArray(object.excludedFilterKeys)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); + message.excludedFilterKeys = []; + for (var i = 0; i < object.excludedFilterKeys.length; ++i) + message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); + } + if (object.enableDynamicPosition != null) + message.enableDynamicPosition = Boolean(object.enableDynamicPosition); + return message; + }; + + /** + * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} message FacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.excludedFilterKeys = []; + if (options.defaults) { + object.facetKey = null; + object.limit = 0; + object.enableDynamicPosition = false; + } + if (message.facetKey != null && message.hasOwnProperty("facetKey")) + object.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.excludedFilterKeys && message.excludedFilterKeys.length) { + object.excludedFilterKeys = []; + for (var j = 0; j < message.excludedFilterKeys.length; ++j) + object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; + } + if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) + object.enableDynamicPosition = message.enableDynamicPosition; + return object; + }; + + /** + * Converts this FacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @instance + * @returns {Object.} JSON object + */ + FacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.FacetSpec"; + }; + + FacetSpec.FacetKey = (function() { + + /** + * Properties of a FacetKey. + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @interface IFacetKey + * @property {string|null} [key] FacetKey key + * @property {Array.|null} [intervals] FacetKey intervals + * @property {Array.|null} [restrictedValues] FacetKey restrictedValues + * @property {Array.|null} [prefixes] FacetKey prefixes + * @property {Array.|null} [contains] FacetKey contains + * @property {boolean|null} [caseInsensitive] FacetKey caseInsensitive + * @property {string|null} [orderBy] FacetKey orderBy + * @property {string|null} [query] FacetKey query + * @property {boolean|null} [returnMinMax] FacetKey returnMinMax + */ + + /** + * Constructs a new FacetKey. + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @classdesc Represents a FacetKey. + * @implements IFacetKey + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + */ + function FacetKey(properties) { + this.intervals = []; + this.restrictedValues = []; + this.prefixes = []; + this.contains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetKey key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.key = ""; + + /** + * FacetKey intervals. + * @member {Array.} intervals + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.intervals = $util.emptyArray; + + /** + * FacetKey restrictedValues. + * @member {Array.} restrictedValues + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.restrictedValues = $util.emptyArray; + + /** + * FacetKey prefixes. + * @member {Array.} prefixes + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.prefixes = $util.emptyArray; + + /** + * FacetKey contains. + * @member {Array.} contains + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.contains = $util.emptyArray; + + /** + * FacetKey caseInsensitive. + * @member {boolean} caseInsensitive + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.caseInsensitive = false; + + /** + * FacetKey orderBy. + * @member {string} orderBy + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.orderBy = ""; + + /** + * FacetKey query. + * @member {string} query + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.query = ""; + + /** + * FacetKey returnMinMax. + * @member {boolean} returnMinMax + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + */ + FacetKey.prototype.returnMinMax = false; + + /** + * Creates a new FacetKey instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey instance + */ + FacetKey.create = function create(properties) { + return new FacetKey(properties); + }; + + /** + * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.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.intervals != null && message.intervals.length) + for (var i = 0; i < message.intervals.length; ++i) + $root.google.cloud.retail.v2alpha.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restrictedValues != null && message.restrictedValues.length) + for (var i = 0; i < message.restrictedValues.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); + if (message.prefixes != null && message.prefixes.length) + for (var i = 0; i < message.prefixes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); + if (message.contains != null && message.contains.length) + for (var i = 0; i < message.contains.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); + if (message.caseInsensitive != null && Object.hasOwnProperty.call(message, "caseInsensitive")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.caseInsensitive); + if (message.returnMinMax != null && Object.hasOwnProperty.call(message, "returnMinMax")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.returnMinMax); + return writer; + }; + + /** + * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + if (!(message.intervals && message.intervals.length)) + message.intervals = []; + message.intervals.push($root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.restrictedValues && message.restrictedValues.length)) + message.restrictedValues = []; + message.restrictedValues.push(reader.string()); + break; + } + case 8: { + if (!(message.prefixes && message.prefixes.length)) + message.prefixes = []; + message.prefixes.push(reader.string()); + break; + } + case 9: { + if (!(message.contains && message.contains.length)) + message.contains = []; + message.contains.push(reader.string()); + break; + } + case 10: { + message.caseInsensitive = reader.bool(); + break; + } + case 4: { + message.orderBy = reader.string(); + break; + } + case 5: { + message.query = reader.string(); + break; + } + case 11: { + message.returnMinMax = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetKey message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetKey.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.intervals != null && message.hasOwnProperty("intervals")) { + if (!Array.isArray(message.intervals)) + return "intervals: array expected"; + for (var i = 0; i < message.intervals.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.intervals[i]); + if (error) + return "intervals." + error; + } + } + if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { + if (!Array.isArray(message.restrictedValues)) + return "restrictedValues: array expected"; + for (var i = 0; i < message.restrictedValues.length; ++i) + if (!$util.isString(message.restrictedValues[i])) + return "restrictedValues: string[] expected"; + } + if (message.prefixes != null && message.hasOwnProperty("prefixes")) { + if (!Array.isArray(message.prefixes)) + return "prefixes: array expected"; + for (var i = 0; i < message.prefixes.length; ++i) + if (!$util.isString(message.prefixes[i])) + return "prefixes: string[] expected"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + if (!Array.isArray(message.contains)) + return "contains: array expected"; + for (var i = 0; i < message.contains.length; ++i) + if (!$util.isString(message.contains[i])) + return "contains: string[] expected"; + } + if (message.caseInsensitive != null && message.hasOwnProperty("caseInsensitive")) + if (typeof message.caseInsensitive !== "boolean") + return "caseInsensitive: boolean expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.returnMinMax != null && message.hasOwnProperty("returnMinMax")) + if (typeof message.returnMinMax !== "boolean") + return "returnMinMax: boolean expected"; + return null; + }; + + /** + * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey + */ + FacetKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); + if (object.key != null) + message.key = String(object.key); + if (object.intervals) { + if (!Array.isArray(object.intervals)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); + message.intervals = []; + for (var i = 0; i < object.intervals.length; ++i) { + if (typeof object.intervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); + message.intervals[i] = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.intervals[i]); + } + } + if (object.restrictedValues) { + if (!Array.isArray(object.restrictedValues)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); + message.restrictedValues = []; + for (var i = 0; i < object.restrictedValues.length; ++i) + message.restrictedValues[i] = String(object.restrictedValues[i]); + } + if (object.prefixes) { + if (!Array.isArray(object.prefixes)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); + message.prefixes = []; + for (var i = 0; i < object.prefixes.length; ++i) + message.prefixes[i] = String(object.prefixes[i]); + } + if (object.contains) { + if (!Array.isArray(object.contains)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.contains: array expected"); + message.contains = []; + for (var i = 0; i < object.contains.length; ++i) + message.contains[i] = String(object.contains[i]); + } + if (object.caseInsensitive != null) + message.caseInsensitive = Boolean(object.caseInsensitive); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.query != null) + message.query = String(object.query); + if (object.returnMinMax != null) + message.returnMinMax = Boolean(object.returnMinMax); + return message; + }; + + /** + * Creates a plain object from a FacetKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} message FacetKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.intervals = []; + object.restrictedValues = []; + object.prefixes = []; + object.contains = []; + } + if (options.defaults) { + object.key = ""; + object.orderBy = ""; + object.query = ""; + object.caseInsensitive = false; + object.returnMinMax = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intervals && message.intervals.length) { + object.intervals = []; + for (var j = 0; j < message.intervals.length; ++j) + object.intervals[j] = $root.google.cloud.retail.v2alpha.Interval.toObject(message.intervals[j], options); + } + if (message.restrictedValues && message.restrictedValues.length) { + object.restrictedValues = []; + for (var j = 0; j < message.restrictedValues.length; ++j) + object.restrictedValues[j] = message.restrictedValues[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.prefixes && message.prefixes.length) { + object.prefixes = []; + for (var j = 0; j < message.prefixes.length; ++j) + object.prefixes[j] = message.prefixes[j]; + } + if (message.contains && message.contains.length) { + object.contains = []; + for (var j = 0; j < message.contains.length; ++j) + object.contains[j] = message.contains[j]; + } + if (message.caseInsensitive != null && message.hasOwnProperty("caseInsensitive")) + object.caseInsensitive = message.caseInsensitive; + if (message.returnMinMax != null && message.hasOwnProperty("returnMinMax")) + object.returnMinMax = message.returnMinMax; + return object; + }; + + /** + * Converts this FacetKey to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @instance + * @returns {Object.} JSON object + */ + FacetKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetKey + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey"; + }; + + return FacetKey; + })(); + + return FacetSpec; + })(); + + SearchRequest.DynamicFacetSpec = (function() { + + /** + * Properties of a DynamicFacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IDynamicFacetSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode + */ + + /** + * Constructs a new DynamicFacetSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a DynamicFacetSpec. + * @implements IDynamicFacetSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + */ + function DynamicFacetSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DynamicFacetSpec mode. + * @member {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode} mode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @instance + */ + DynamicFacetSpec.prototype.mode = 0; + + /** + * Creates a new DynamicFacetSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance + */ + DynamicFacetSpec.create = function create(properties) { + return new DynamicFacetSpec(properties); + }; + + /** + * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicFacetSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicFacetSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + */ + DynamicFacetSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "DISABLED": + case 1: + message.mode = 1; + break; + case "ENABLED": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicFacetSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + return object; + }; + + /** + * Converts this DynamicFacetSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @instance + * @returns {Object.} JSON object + */ + DynamicFacetSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DynamicFacetSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DynamicFacetSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec"; + }; + + /** + * Mode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} ENABLED=2 ENABLED value + */ + DynamicFacetSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[2] = "ENABLED"] = 2; + return values; + })(); + + return DynamicFacetSpec; + })(); + + SearchRequest.BoostSpec = (function() { + + /** + * Properties of a BoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IBoostSpec + * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs + * @property {boolean|null} [skipBoostSpecValidation] BoostSpec skipBoostSpecValidation + */ + + /** + * Constructs a new BoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a BoostSpec. + * @implements IBoostSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set + */ + function BoostSpec(properties) { + this.conditionBoostSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoostSpec conditionBoostSpecs. + * @member {Array.} conditionBoostSpecs + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + + /** + * BoostSpec skipBoostSpecValidation. + * @member {boolean|null|undefined} skipBoostSpecValidation + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @instance + */ + BoostSpec.prototype.skipBoostSpecValidation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BoostSpec _skipBoostSpecValidation. + * @member {"skipBoostSpecValidation"|undefined} _skipBoostSpecValidation + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @instance + */ + Object.defineProperty(BoostSpec.prototype, "_skipBoostSpecValidation", { + get: $util.oneOfGetter($oneOfFields = ["skipBoostSpecValidation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec instance + */ + BoostSpec.create = function create(properties) { + return new BoostSpec(properties); + }; + + /** + * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skipBoostSpecValidation != null && Object.hasOwnProperty.call(message, "skipBoostSpecValidation")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipBoostSpecValidation); + return writer; + }; + + /** + * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) + message.conditionBoostSpecs = []; + message.conditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.skipBoostSpecValidation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { + if (!Array.isArray(message.conditionBoostSpecs)) + return "conditionBoostSpecs: array expected"; + for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (error) + return "conditionBoostSpecs." + error; + } + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + properties._skipBoostSpecValidation = 1; + if (typeof message.skipBoostSpecValidation !== "boolean") + return "skipBoostSpecValidation: boolean expected"; + } + return null; + }; + + /** + * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + */ + BoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); + if (object.conditionBoostSpecs) { + if (!Array.isArray(object.conditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); + message.conditionBoostSpecs = []; + for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { + if (typeof object.conditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); + message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + } + } + if (object.skipBoostSpecValidation != null) + message.skipBoostSpecValidation = Boolean(object.skipBoostSpecValidation); + return message; + }; + + /** + * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} message BoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditionBoostSpecs = []; + if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { + object.conditionBoostSpecs = []; + for (var j = 0; j < message.conditionBoostSpecs.length; ++j) + object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + } + if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { + object.skipBoostSpecValidation = message.skipBoostSpecValidation; + if (options.oneofs) + object._skipBoostSpecValidation = "skipBoostSpecValidation"; + } + return object; + }; + + /** + * Converts this BoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @instance + * @returns {Object.} JSON object + */ + BoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoostSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.BoostSpec"; + }; + + BoostSpec.ConditionBoostSpec = (function() { + + /** + * Properties of a ConditionBoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @interface IConditionBoostSpec + * @property {string|null} [condition] ConditionBoostSpec condition + * @property {number|null} [boost] ConditionBoostSpec boost + */ + + /** + * Constructs a new ConditionBoostSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @classdesc Represents a ConditionBoostSpec. + * @implements IConditionBoostSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + */ + function ConditionBoostSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionBoostSpec condition. + * @member {string} condition + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.condition = ""; + + /** + * ConditionBoostSpec boost. + * @member {number} boost + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + */ + ConditionBoostSpec.prototype.boost = 0; + + /** + * Creates a new ConditionBoostSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + */ + ConditionBoostSpec.create = function create(properties) { + return new ConditionBoostSpec(properties); + }; + + /** + * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.condition = reader.string(); + break; + } + case 2: { + message.boost = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionBoostSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionBoostSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + */ + ConditionBoostSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); + if (object.condition != null) + message.condition = String(object.condition); + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionBoostSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = ""; + object.boost = 0; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this ConditionBoostSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @instance + * @returns {Object.} JSON object + */ + ConditionBoostSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionBoostSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec"; + }; + + return ConditionBoostSpec; + })(); + + return BoostSpec; + })(); + + SearchRequest.QueryExpansionSpec = (function() { + + /** + * Properties of a QueryExpansionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IQueryExpansionSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition + * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults + */ + + /** + * Constructs a new QueryExpansionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a QueryExpansionSpec. + * @implements IQueryExpansionSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + */ + function QueryExpansionSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryExpansionSpec condition. + * @member {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition} condition + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.condition = 0; + + /** + * QueryExpansionSpec pinUnexpandedResults. + * @member {boolean} pinUnexpandedResults + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @instance + */ + QueryExpansionSpec.prototype.pinUnexpandedResults = false; + + /** + * Creates a new QueryExpansionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance + */ + QueryExpansionSpec.create = function create(properties) { + return new QueryExpansionSpec(properties); + }; + + /** + * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FacetSpec.encode = function encode(message, writer) { + QueryExpansionSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.facetKey != null && Object.hasOwnProperty.call(message, "facetKey")) - $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.encode(message.facetKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.limit); - if (message.excludedFilterKeys != null && message.excludedFilterKeys.length) - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.excludedFilterKeys[i]); - if (message.enableDynamicPosition != null && Object.hasOwnProperty.call(message, "enableDynamicPosition")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableDynamicPosition); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); + if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); return writer; }; /** - * Encodes the specified FacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify|verify} messages. + * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec} message FacetSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FacetSpec message from the specified reader or buffer. + * Decodes a QueryExpansionSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FacetSpec.decode = function decode(reader, length) { + QueryExpansionSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.decode(reader, reader.uint32()); + message.condition = reader.int32(); break; } case 2: { - message.limit = reader.int32(); - break; - } - case 3: { - if (!(message.excludedFilterKeys && message.excludedFilterKeys.length)) - message.excludedFilterKeys = []; - message.excludedFilterKeys.push(reader.string()); - break; - } - case 4: { - message.enableDynamicPosition = reader.bool(); + message.pinUnexpandedResults = reader.bool(); break; } default: @@ -72595,624 +81575,1242 @@ }; /** - * Decodes a FacetSpec message from the specified reader or buffer, length delimited. + * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FacetSpec.decodeDelimited = function decodeDelimited(reader) { + QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FacetSpec message. + * Verifies a QueryExpansionSpec message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FacetSpec.verify = function verify(message) { + QueryExpansionSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.facetKey != null && message.hasOwnProperty("facetKey")) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify(message.facetKey); - if (error) - return "facetKey." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.excludedFilterKeys != null && message.hasOwnProperty("excludedFilterKeys")) { - if (!Array.isArray(message.excludedFilterKeys)) - return "excludedFilterKeys: array expected"; - for (var i = 0; i < message.excludedFilterKeys.length; ++i) - if (!$util.isString(message.excludedFilterKeys[i])) - return "excludedFilterKeys: string[] expected"; - } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - if (typeof message.enableDynamicPosition !== "boolean") - return "enableDynamicPosition: boolean expected"; + if (message.condition != null && message.hasOwnProperty("condition")) + switch (message.condition) { + default: + return "condition: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + if (typeof message.pinUnexpandedResults !== "boolean") + return "pinUnexpandedResults: boolean expected"; return null; }; /** - * Creates a FacetSpec message from a plain object. Also converts values to their respective internal types. + * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} FacetSpec + * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec */ - FacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec) + QueryExpansionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec(); - if (object.facetKey != null) { - if (typeof object.facetKey !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.facetKey: object expected"); - message.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.fromObject(object.facetKey); - } - if (object.limit != null) - message.limit = object.limit | 0; - if (object.excludedFilterKeys) { - if (!Array.isArray(object.excludedFilterKeys)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.excludedFilterKeys: array expected"); - message.excludedFilterKeys = []; - for (var i = 0; i < object.excludedFilterKeys.length; ++i) - message.excludedFilterKeys[i] = String(object.excludedFilterKeys[i]); + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); + switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; + case "CONDITION_UNSPECIFIED": + case 0: + message.condition = 0; + break; + case "DISABLED": + case 1: + message.condition = 1; + break; + case "AUTO": + case 3: + message.condition = 3; + break; } - if (object.enableDynamicPosition != null) - message.enableDynamicPosition = Boolean(object.enableDynamicPosition); + if (object.pinUnexpandedResults != null) + message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); return message; }; /** - * Creates a plain object from a FacetSpec message. Also converts values to other types if specified. + * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec} message FacetSpec + * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FacetSpec.toObject = function toObject(message, options) { + QueryExpansionSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.excludedFilterKeys = []; if (options.defaults) { - object.facetKey = null; - object.limit = 0; - object.enableDynamicPosition = false; + object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; + object.pinUnexpandedResults = false; } - if (message.facetKey != null && message.hasOwnProperty("facetKey")) - object.facetKey = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.toObject(message.facetKey, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.excludedFilterKeys && message.excludedFilterKeys.length) { - object.excludedFilterKeys = []; - for (var j = 0; j < message.excludedFilterKeys.length; ++j) - object.excludedFilterKeys[j] = message.excludedFilterKeys[j]; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) + object.pinUnexpandedResults = message.pinUnexpandedResults; + return object; + }; + + /** + * Converts this QueryExpansionSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryExpansionSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryExpansionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.enableDynamicPosition != null && message.hasOwnProperty("enableDynamicPosition")) - object.enableDynamicPosition = message.enableDynamicPosition; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec"; + }; + + /** + * Condition enum. + * @name google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition + * @enum {number} + * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value + * @property {number} DISABLED=1 DISABLED value + * @property {number} AUTO=3 AUTO value + */ + QueryExpansionSpec.Condition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DISABLED"] = 1; + values[valuesById[3] = "AUTO"] = 3; + return values; + })(); + + return QueryExpansionSpec; + })(); + + SearchRequest.PersonalizationSpec = (function() { + + /** + * Properties of a PersonalizationSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface IPersonalizationSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|null} [mode] PersonalizationSpec mode + */ + + /** + * Constructs a new PersonalizationSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a PersonalizationSpec. + * @implements IPersonalizationSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + */ + function PersonalizationSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersonalizationSpec mode. + * @member {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode} mode + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @instance + */ + PersonalizationSpec.prototype.mode = 0; + + /** + * Creates a new PersonalizationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec instance + */ + PersonalizationSpec.create = function create(properties) { + return new PersonalizationSpec(properties); + }; + + /** + * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersonalizationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersonalizationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersonalizationSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersonalizationSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + */ + PersonalizationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "AUTO": + case 1: + message.mode = 1; + break; + case "DISABLED": + case 2: + message.mode = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} message PersonalizationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersonalizationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; return object; }; /** - * Converts this FacetSpec to JSON. + * Converts this PersonalizationSpec to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec * @instance * @returns {Object.} JSON object */ - FacetSpec.prototype.toJSON = function toJSON() { + PersonalizationSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FacetSpec + * Gets the default type url for PersonalizationSpec * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec + * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FacetSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PersonalizationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.FacetSpec"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec"; }; - FacetSpec.FacetKey = (function() { + /** + * Mode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} AUTO=1 AUTO value + * @property {number} DISABLED=2 DISABLED value + */ + PersonalizationSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); - /** - * Properties of a FacetKey. - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @interface IFacetKey - * @property {string|null} [key] FacetKey key - * @property {Array.|null} [intervals] FacetKey intervals - * @property {Array.|null} [restrictedValues] FacetKey restrictedValues - * @property {Array.|null} [prefixes] FacetKey prefixes - * @property {Array.|null} [contains] FacetKey contains - * @property {boolean|null} [caseInsensitive] FacetKey caseInsensitive - * @property {string|null} [orderBy] FacetKey orderBy - * @property {string|null} [query] FacetKey query - * @property {boolean|null} [returnMinMax] FacetKey returnMinMax - */ + return PersonalizationSpec; + })(); - /** - * Constructs a new FacetKey. - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec - * @classdesc Represents a FacetKey. - * @implements IFacetKey - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - */ - function FacetKey(properties) { - this.intervals = []; - this.restrictedValues = []; - this.prefixes = []; - this.contains = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + SearchRequest.SpellCorrectionSpec = (function() { + + /** + * Properties of a SpellCorrectionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @interface ISpellCorrectionSpec + * @property {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|null} [mode] SpellCorrectionSpec mode + */ + + /** + * Constructs a new SpellCorrectionSpec. + * @memberof google.cloud.retail.v2alpha.SearchRequest + * @classdesc Represents a SpellCorrectionSpec. + * @implements ISpellCorrectionSpec + * @constructor + * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set + */ + function SpellCorrectionSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpellCorrectionSpec mode. + * @member {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode} mode + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @instance + */ + SpellCorrectionSpec.prototype.mode = 0; + + /** + * Creates a new SpellCorrectionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec instance + */ + SpellCorrectionSpec.create = function create(properties) { + return new SpellCorrectionSpec(properties); + }; + + /** + * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellCorrectionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpellCorrectionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellCorrectionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * FacetKey key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.key = ""; + /** + * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpellCorrectionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FacetKey intervals. - * @member {Array.} intervals - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.intervals = $util.emptyArray; + /** + * Verifies a SpellCorrectionSpec message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpellCorrectionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * FacetKey restrictedValues. - * @member {Array.} restrictedValues - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.restrictedValues = $util.emptyArray; + /** + * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec + */ + SpellCorrectionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec(); + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "SUGGESTION_ONLY": + case 1: + message.mode = 1; + break; + case "AUTO": + case 2: + message.mode = 2; + break; + } + return message; + }; - /** - * FacetKey prefixes. - * @member {Array.} prefixes - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.prefixes = $util.emptyArray; + /** + * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} message SpellCorrectionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpellCorrectionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; + return object; + }; - /** - * FacetKey contains. - * @member {Array.} contains - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.contains = $util.emptyArray; + /** + * Converts this SpellCorrectionSpec to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @instance + * @returns {Object.} JSON object + */ + SpellCorrectionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FacetKey caseInsensitive. - * @member {boolean} caseInsensitive - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.caseInsensitive = false; + /** + * Gets the default type url for SpellCorrectionSpec + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpellCorrectionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec"; + }; - /** - * FacetKey orderBy. - * @member {string} orderBy - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.orderBy = ""; + /** + * Mode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} SUGGESTION_ONLY=1 SUGGESTION_ONLY value + * @property {number} AUTO=2 AUTO value + */ + SpellCorrectionSpec.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUGGESTION_ONLY"] = 1; + values[valuesById[2] = "AUTO"] = 2; + return values; + })(); - /** - * FacetKey query. - * @member {string} query - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.query = ""; + return SpellCorrectionSpec; + })(); - /** - * FacetKey returnMinMax. - * @member {boolean} returnMinMax - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - */ - FacetKey.prototype.returnMinMax = false; + /** + * RelevanceThreshold enum. + * @name google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold + * @enum {number} + * @property {number} RELEVANCE_THRESHOLD_UNSPECIFIED=0 RELEVANCE_THRESHOLD_UNSPECIFIED value + * @property {number} HIGH=1 HIGH value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} LOW=3 LOW value + * @property {number} LOWEST=4 LOWEST value + */ + SearchRequest.RelevanceThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELEVANCE_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "HIGH"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "LOW"] = 3; + values[valuesById[4] = "LOWEST"] = 4; + return values; + })(); - /** - * Creates a new FacetKey instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey instance - */ - FacetKey.create = function create(properties) { - return new FacetKey(properties); - }; + /** + * SearchMode enum. + * @name google.cloud.retail.v2alpha.SearchRequest.SearchMode + * @enum {number} + * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value + * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value + * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + */ + SearchRequest.SearchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; + values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; + return values; + })(); - /** - * Encodes the specified FacetKey message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.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.intervals != null && message.intervals.length) - for (var i = 0; i < message.intervals.length; ++i) - $root.google.cloud.retail.v2alpha.Interval.encode(message.intervals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.restrictedValues != null && message.restrictedValues.length) - for (var i = 0; i < message.restrictedValues.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.restrictedValues[i]); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.query); - if (message.prefixes != null && message.prefixes.length) - for (var i = 0; i < message.prefixes.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.prefixes[i]); - if (message.contains != null && message.contains.length) - for (var i = 0; i < message.contains.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.contains[i]); - if (message.caseInsensitive != null && Object.hasOwnProperty.call(message, "caseInsensitive")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.caseInsensitive); - if (message.returnMinMax != null && Object.hasOwnProperty.call(message, "returnMinMax")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.returnMinMax); - return writer; - }; + return SearchRequest; + })(); + + v2alpha.SearchResponse = (function() { + + /** + * Properties of a SearchResponse. + * @memberof google.cloud.retail.v2alpha + * @interface ISearchResponse + * @property {Array.|null} [results] SearchResponse results + * @property {Array.|null} [facets] SearchResponse facets + * @property {number|null} [totalSize] SearchResponse totalSize + * @property {string|null} [correctedQuery] SearchResponse correctedQuery + * @property {string|null} [attributionToken] SearchResponse attributionToken + * @property {string|null} [nextPageToken] SearchResponse nextPageToken + * @property {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo + * @property {string|null} [redirectUri] SearchResponse redirectUri + * @property {Array.|null} [appliedControls] SearchResponse appliedControls + * @property {Array.|null} [invalidConditionBoostSpecs] SearchResponse invalidConditionBoostSpecs + * @property {Array.|null} [experimentInfo] SearchResponse experimentInfo + */ + + /** + * Constructs a new SearchResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SearchResponse. + * @implements ISearchResponse + * @constructor + * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set + */ + function SearchResponse(properties) { + this.results = []; + this.facets = []; + this.appliedControls = []; + this.invalidConditionBoostSpecs = []; + this.experimentInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.results = $util.emptyArray; + + /** + * SearchResponse facets. + * @member {Array.} facets + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.facets = $util.emptyArray; + + /** + * SearchResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.totalSize = 0; + + /** + * SearchResponse correctedQuery. + * @member {string} correctedQuery + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.correctedQuery = ""; + + /** + * SearchResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.attributionToken = ""; + + /** + * SearchResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.nextPageToken = ""; + + /** + * SearchResponse queryExpansionInfo. + * @member {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.queryExpansionInfo = null; - /** - * Encodes the specified FacetKey message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.IFacetKey} message FacetKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * SearchResponse redirectUri. + * @member {string} redirectUri + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.redirectUri = ""; - /** - * Decodes a FacetKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.key = reader.string(); - break; - } - case 2: { - if (!(message.intervals && message.intervals.length)) - message.intervals = []; - message.intervals.push($root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.restrictedValues && message.restrictedValues.length)) - message.restrictedValues = []; - message.restrictedValues.push(reader.string()); - break; - } - case 8: { - if (!(message.prefixes && message.prefixes.length)) - message.prefixes = []; - message.prefixes.push(reader.string()); - break; - } - case 9: { - if (!(message.contains && message.contains.length)) - message.contains = []; - message.contains.push(reader.string()); - break; - } - case 10: { - message.caseInsensitive = reader.bool(); - break; - } - case 4: { - message.orderBy = reader.string(); - break; - } - case 5: { - message.query = reader.string(); - break; - } - case 11: { - message.returnMinMax = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * SearchResponse appliedControls. + * @member {Array.} appliedControls + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.appliedControls = $util.emptyArray; - /** - * Decodes a FacetKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * SearchResponse invalidConditionBoostSpecs. + * @member {Array.} invalidConditionBoostSpecs + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.invalidConditionBoostSpecs = $util.emptyArray; - /** - * Verifies a FacetKey message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetKey.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.intervals != null && message.hasOwnProperty("intervals")) { - if (!Array.isArray(message.intervals)) - return "intervals: array expected"; - for (var i = 0; i < message.intervals.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.intervals[i]); - if (error) - return "intervals." + error; - } - } - if (message.restrictedValues != null && message.hasOwnProperty("restrictedValues")) { - if (!Array.isArray(message.restrictedValues)) - return "restrictedValues: array expected"; - for (var i = 0; i < message.restrictedValues.length; ++i) - if (!$util.isString(message.restrictedValues[i])) - return "restrictedValues: string[] expected"; - } - if (message.prefixes != null && message.hasOwnProperty("prefixes")) { - if (!Array.isArray(message.prefixes)) - return "prefixes: array expected"; - for (var i = 0; i < message.prefixes.length; ++i) - if (!$util.isString(message.prefixes[i])) - return "prefixes: string[] expected"; - } - if (message.contains != null && message.hasOwnProperty("contains")) { - if (!Array.isArray(message.contains)) - return "contains: array expected"; - for (var i = 0; i < message.contains.length; ++i) - if (!$util.isString(message.contains[i])) - return "contains: string[] expected"; - } - if (message.caseInsensitive != null && message.hasOwnProperty("caseInsensitive")) - if (typeof message.caseInsensitive !== "boolean") - return "caseInsensitive: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.returnMinMax != null && message.hasOwnProperty("returnMinMax")) - if (typeof message.returnMinMax !== "boolean") - return "returnMinMax: boolean expected"; - return null; - }; + /** + * SearchResponse experimentInfo. + * @member {Array.} experimentInfo + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + */ + SearchResponse.prototype.experimentInfo = $util.emptyArray; - /** - * Creates a FacetKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} FacetKey - */ - FacetKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey(); - if (object.key != null) - message.key = String(object.key); - if (object.intervals) { - if (!Array.isArray(object.intervals)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: array expected"); - message.intervals = []; - for (var i = 0; i < object.intervals.length; ++i) { - if (typeof object.intervals[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.intervals: object expected"); - message.intervals[i] = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.intervals[i]); - } + /** + * Creates a new SearchResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse instance + */ + SearchResponse.create = function create(properties) { + return new SearchResponse(properties); + }; + + /** + * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facets != null && message.facets.length) + for (var i = 0; i < message.facets.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); + if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) + $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); + if (message.appliedControls != null && message.appliedControls.length) + for (var i = 0; i < message.appliedControls.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); + if (message.invalidConditionBoostSpecs != null && message.invalidConditionBoostSpecs.length) + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) + $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.invalidConditionBoostSpecs[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.experimentInfo != null && message.experimentInfo.length) + for (var i = 0; i < message.experimentInfo.length; ++i) + $root.google.cloud.retail.v2alpha.ExperimentInfo.encode(message.experimentInfo[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.decode(reader, reader.uint32())); + break; } - if (object.restrictedValues) { - if (!Array.isArray(object.restrictedValues)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.restrictedValues: array expected"); - message.restrictedValues = []; - for (var i = 0; i < object.restrictedValues.length; ++i) - message.restrictedValues[i] = String(object.restrictedValues[i]); + case 2: { + if (!(message.facets && message.facets.length)) + message.facets = []; + message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); + break; } - if (object.prefixes) { - if (!Array.isArray(object.prefixes)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.prefixes: array expected"); - message.prefixes = []; - for (var i = 0; i < object.prefixes.length; ++i) - message.prefixes[i] = String(object.prefixes[i]); + case 3: { + message.totalSize = reader.int32(); + break; } - if (object.contains) { - if (!Array.isArray(object.contains)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey.contains: array expected"); - message.contains = []; - for (var i = 0; i < object.contains.length; ++i) - message.contains[i] = String(object.contains[i]); + case 4: { + message.correctedQuery = reader.string(); + break; } - if (object.caseInsensitive != null) - message.caseInsensitive = Boolean(object.caseInsensitive); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.query != null) - message.query = String(object.query); - if (object.returnMinMax != null) - message.returnMinMax = Boolean(object.returnMinMax); - return message; - }; - - /** - * Creates a plain object from a FacetKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey} message FacetKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.intervals = []; - object.restrictedValues = []; - object.prefixes = []; - object.contains = []; + case 5: { + message.attributionToken = reader.string(); + break; } - if (options.defaults) { - object.key = ""; - object.orderBy = ""; - object.query = ""; - object.caseInsensitive = false; - object.returnMinMax = false; + case 6: { + message.nextPageToken = reader.string(); + break; } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.intervals && message.intervals.length) { - object.intervals = []; - for (var j = 0; j < message.intervals.length; ++j) - object.intervals[j] = $root.google.cloud.retail.v2alpha.Interval.toObject(message.intervals[j], options); + case 7: { + message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); + break; } - if (message.restrictedValues && message.restrictedValues.length) { - object.restrictedValues = []; - for (var j = 0; j < message.restrictedValues.length; ++j) - object.restrictedValues[j] = message.restrictedValues[j]; + case 10: { + message.redirectUri = reader.string(); + break; } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.prefixes && message.prefixes.length) { - object.prefixes = []; - for (var j = 0; j < message.prefixes.length; ++j) - object.prefixes[j] = message.prefixes[j]; + case 12: { + if (!(message.appliedControls && message.appliedControls.length)) + message.appliedControls = []; + message.appliedControls.push(reader.string()); + break; } - if (message.contains && message.contains.length) { - object.contains = []; - for (var j = 0; j < message.contains.length; ++j) - object.contains[j] = message.contains[j]; + case 14: { + if (!(message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length)) + message.invalidConditionBoostSpecs = []; + message.invalidConditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + break; } - if (message.caseInsensitive != null && message.hasOwnProperty("caseInsensitive")) - object.caseInsensitive = message.caseInsensitive; - if (message.returnMinMax != null && message.hasOwnProperty("returnMinMax")) - object.returnMinMax = message.returnMinMax; - return object; - }; + case 17: { + if (!(message.experimentInfo && message.experimentInfo.length)) + message.experimentInfo = []; + message.experimentInfo.push($root.google.cloud.retail.v2alpha.ExperimentInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this FacetKey to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @instance - * @returns {Object.} JSON object - */ - FacetKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for FacetKey - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FacetKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.FacetSpec.FacetKey"; - }; + /** + * Verifies a SearchResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.facets != null && message.hasOwnProperty("facets")) { + if (!Array.isArray(message.facets)) + return "facets: array expected"; + for (var i = 0; i < message.facets.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); + if (error) + return "facets." + error; + } + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + if (!$util.isString(message.correctedQuery)) + return "correctedQuery: string expected"; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { + var error = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); + if (error) + return "queryExpansionInfo." + error; + } + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + if (!$util.isString(message.redirectUri)) + return "redirectUri: string expected"; + if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { + if (!Array.isArray(message.appliedControls)) + return "appliedControls: array expected"; + for (var i = 0; i < message.appliedControls.length; ++i) + if (!$util.isString(message.appliedControls[i])) + return "appliedControls: string[] expected"; + } + if (message.invalidConditionBoostSpecs != null && message.hasOwnProperty("invalidConditionBoostSpecs")) { + if (!Array.isArray(message.invalidConditionBoostSpecs)) + return "invalidConditionBoostSpecs: array expected"; + for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.invalidConditionBoostSpecs[i]); + if (error) + return "invalidConditionBoostSpecs." + error; + } + } + if (message.experimentInfo != null && message.hasOwnProperty("experimentInfo")) { + if (!Array.isArray(message.experimentInfo)) + return "experimentInfo: array expected"; + for (var i = 0; i < message.experimentInfo.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.ExperimentInfo.verify(message.experimentInfo[i]); + if (error) + return "experimentInfo." + error; + } + } + return null; + }; - return FacetKey; - })(); + /** + * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + */ + SearchResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.SearchResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.fromObject(object.results[i]); + } + } + if (object.facets) { + if (!Array.isArray(object.facets)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: array expected"); + message.facets = []; + for (var i = 0; i < object.facets.length; ++i) { + if (typeof object.facets[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: object expected"); + message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); + } + } + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + if (object.correctedQuery != null) + message.correctedQuery = String(object.correctedQuery); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.queryExpansionInfo != null) { + if (typeof object.queryExpansionInfo !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.queryExpansionInfo: object expected"); + message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); + } + if (object.redirectUri != null) + message.redirectUri = String(object.redirectUri); + if (object.appliedControls) { + if (!Array.isArray(object.appliedControls)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.appliedControls: array expected"); + message.appliedControls = []; + for (var i = 0; i < object.appliedControls.length; ++i) + message.appliedControls[i] = String(object.appliedControls[i]); + } + if (object.invalidConditionBoostSpecs) { + if (!Array.isArray(object.invalidConditionBoostSpecs)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.invalidConditionBoostSpecs: array expected"); + message.invalidConditionBoostSpecs = []; + for (var i = 0; i < object.invalidConditionBoostSpecs.length; ++i) { + if (typeof object.invalidConditionBoostSpecs[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.invalidConditionBoostSpecs: object expected"); + message.invalidConditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.invalidConditionBoostSpecs[i]); + } + } + if (object.experimentInfo) { + if (!Array.isArray(object.experimentInfo)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.experimentInfo: array expected"); + message.experimentInfo = []; + for (var i = 0; i < object.experimentInfo.length; ++i) { + if (typeof object.experimentInfo[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.experimentInfo: object expected"); + message.experimentInfo[i] = $root.google.cloud.retail.v2alpha.ExperimentInfo.fromObject(object.experimentInfo[i]); + } + } + return message; + }; - return FacetSpec; - })(); + /** + * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {google.cloud.retail.v2alpha.SearchResponse} message SearchResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.facets = []; + object.appliedControls = []; + object.invalidConditionBoostSpecs = []; + object.experimentInfo = []; + } + if (options.defaults) { + object.totalSize = 0; + object.correctedQuery = ""; + object.attributionToken = ""; + object.nextPageToken = ""; + object.queryExpansionInfo = null; + object.redirectUri = ""; + } + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.toObject(message.results[j], options); + } + if (message.facets && message.facets.length) { + object.facets = []; + for (var j = 0; j < message.facets.length; ++j) + object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); + } + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) + object.correctedQuery = message.correctedQuery; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) + object.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); + if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) + object.redirectUri = message.redirectUri; + if (message.appliedControls && message.appliedControls.length) { + object.appliedControls = []; + for (var j = 0; j < message.appliedControls.length; ++j) + object.appliedControls[j] = message.appliedControls[j]; + } + if (message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length) { + object.invalidConditionBoostSpecs = []; + for (var j = 0; j < message.invalidConditionBoostSpecs.length; ++j) + object.invalidConditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.invalidConditionBoostSpecs[j], options); + } + if (message.experimentInfo && message.experimentInfo.length) { + object.experimentInfo = []; + for (var j = 0; j < message.experimentInfo.length; ++j) + object.experimentInfo[j] = $root.google.cloud.retail.v2alpha.ExperimentInfo.toObject(message.experimentInfo[j], options); + } + return object; + }; - SearchRequest.DynamicFacetSpec = (function() { + /** + * Converts this SearchResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @instance + * @returns {Object.} JSON object + */ + SearchResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse"; + }; + + SearchResponse.SearchResult = (function() { /** - * Properties of a DynamicFacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IDynamicFacetSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode|null} [mode] DynamicFacetSpec mode + * Properties of a SearchResult. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface ISearchResult + * @property {string|null} [id] SearchResult id + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] SearchResult product + * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount + * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields + * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues + * @property {Array.|null} [personalLabels] SearchResult personalLabels */ /** - * Constructs a new DynamicFacetSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a DynamicFacetSpec. - * @implements IDynamicFacetSpec + * Constructs a new SearchResult. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a SearchResult. + * @implements ISearchResult * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set */ - function DynamicFacetSpec(properties) { + function SearchResult(properties) { + this.matchingVariantFields = {}; + this.variantRollupValues = {}; + this.personalLabels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73220,75 +82818,192 @@ } /** - * DynamicFacetSpec mode. - * @member {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode} mode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * SearchResult id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @instance */ - DynamicFacetSpec.prototype.mode = 0; + SearchResult.prototype.id = ""; /** - * Creates a new DynamicFacetSpec instance using the specified properties. + * SearchResult product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.product = null; + + /** + * SearchResult matchingVariantCount. + * @member {number} matchingVariantCount + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantCount = 0; + + /** + * SearchResult matchingVariantFields. + * @member {Object.} matchingVariantFields + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.matchingVariantFields = $util.emptyObject; + + /** + * SearchResult variantRollupValues. + * @member {Object.} variantRollupValues + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.variantRollupValues = $util.emptyObject; + + /** + * SearchResult personalLabels. + * @member {Array.} personalLabels + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult + * @instance + */ + SearchResult.prototype.personalLabels = $util.emptyArray; + + /** + * Creates a new SearchResult instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec instance + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult instance */ - DynamicFacetSpec.create = function create(properties) { - return new DynamicFacetSpec(properties); + SearchResult.create = function create(properties) { + return new SearchResult(properties); }; /** - * Encodes the specified DynamicFacetSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DynamicFacetSpec.encode = function encode(message, writer) { + SearchResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); + if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) + for (var keys = Object.keys(message.matchingVariantFields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) + for (var keys = Object.keys(message.variantRollupValues), 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.protobuf.Value.encode(message.variantRollupValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.personalLabels != null && message.personalLabels.length) + for (var i = 0; i < message.personalLabels.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.personalLabels[i]); return writer; }; /** - * Encodes the specified DynamicFacetSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.verify|verify} messages. + * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IDynamicFacetSpec} message DynamicFacetSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DynamicFacetSpec.encodeDelimited = function encodeDelimited(message, writer) { + SearchResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer. + * Decodes a SearchResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DynamicFacetSpec.decode = function decode(reader, length) { + SearchResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.mode = reader.int32(); + message.id = reader.string(); + break; + } + case 2: { + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + break; + } + case 3: { + message.matchingVariantCount = reader.int32(); + break; + } + case 4: { + if (message.matchingVariantFields === $util.emptyObject) + message.matchingVariantFields = {}; + 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.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchingVariantFields[key] = value; + break; + } + case 5: { + if (message.variantRollupValues === $util.emptyObject) + message.variantRollupValues = {}; + 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.variantRollupValues[key] = value; + break; + } + case 7: { + if (!(message.personalLabels && message.personalLabels.length)) + message.personalLabels = []; + message.personalLabels.push(reader.string()); break; } default: @@ -73300,164 +83015,223 @@ }; /** - * Decodes a DynamicFacetSpec message from the specified reader or buffer, length delimited. + * Decodes a SearchResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DynamicFacetSpec.decodeDelimited = function decodeDelimited(reader) { + SearchResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DynamicFacetSpec message. + * Verifies a SearchResult message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DynamicFacetSpec.verify = function verify(message) { + SearchResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + if (!$util.isInteger(message.matchingVariantCount)) + return "matchingVariantCount: integer expected"; + if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { + if (!$util.isObject(message.matchingVariantFields)) + return "matchingVariantFields: object expected"; + var key = Object.keys(message.matchingVariantFields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); + if (error) + return "matchingVariantFields." + error; + } + } + if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { + if (!$util.isObject(message.variantRollupValues)) + return "variantRollupValues: object expected"; + var key = Object.keys(message.variantRollupValues); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); + if (error) + return "variantRollupValues." + error; } + } + if (message.personalLabels != null && message.hasOwnProperty("personalLabels")) { + if (!Array.isArray(message.personalLabels)) + return "personalLabels: array expected"; + for (var i = 0; i < message.personalLabels.length; ++i) + if (!$util.isString(message.personalLabels[i])) + return "personalLabels: string[] expected"; + } return null; }; /** - * Creates a DynamicFacetSpec message from a plain object. Also converts values to their respective internal types. + * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} DynamicFacetSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult */ - DynamicFacetSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec) + SearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(); + if (object.id != null) + message.id = String(object.id); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + } + if (object.matchingVariantCount != null) + message.matchingVariantCount = object.matchingVariantCount | 0; + if (object.matchingVariantFields) { + if (typeof object.matchingVariantFields !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields = {}; + for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { + if (typeof object.matchingVariantFields[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); + message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "DISABLED": - case 1: - message.mode = 1; - break; - case "ENABLED": - case 2: - message.mode = 2; - break; + } + if (object.variantRollupValues) { + if (typeof object.variantRollupValues !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues = {}; + for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { + if (typeof object.variantRollupValues[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); + message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); + } + } + if (object.personalLabels) { + if (!Array.isArray(object.personalLabels)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.personalLabels: array expected"); + message.personalLabels = []; + for (var i = 0; i < object.personalLabels.length; ++i) + message.personalLabels[i] = String(object.personalLabels[i]); } return message; }; /** - * Creates a plain object from a DynamicFacetSpec message. Also converts values to other types if specified. + * Creates a plain object from a SearchResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec} message DynamicFacetSpec + * @param {google.cloud.retail.v2alpha.SearchResponse.SearchResult} message SearchResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DynamicFacetSpec.toObject = function toObject(message, options) { + SearchResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + if (options.arrays || options.defaults) + object.personalLabels = []; + if (options.objects || options.defaults) { + object.matchingVariantFields = {}; + object.variantRollupValues = {}; + } + if (options.defaults) { + object.id = ""; + object.product = null; + object.matchingVariantCount = 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) + object.matchingVariantCount = message.matchingVariantCount; + var keys2; + if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { + object.matchingVariantFields = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); + } + if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { + object.variantRollupValues = {}; + for (var j = 0; j < keys2.length; ++j) + object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); + } + if (message.personalLabels && message.personalLabels.length) { + object.personalLabels = []; + for (var j = 0; j < message.personalLabels.length; ++j) + object.personalLabels[j] = message.personalLabels[j]; + } return object; }; /** - * Converts this DynamicFacetSpec to JSON. + * Converts this SearchResult to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @instance * @returns {Object.} JSON object */ - DynamicFacetSpec.prototype.toJSON = function toJSON() { + SearchResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DynamicFacetSpec + * Gets the default type url for SearchResult * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DynamicFacetSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.SearchResult"; }; - /** - * Mode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} ENABLED=2 ENABLED value - */ - DynamicFacetSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[2] = "ENABLED"] = 2; - return values; - })(); - - return DynamicFacetSpec; + return SearchResult; })(); - SearchRequest.BoostSpec = (function() { + SearchResponse.Facet = (function() { /** - * Properties of a BoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IBoostSpec - * @property {Array.|null} [conditionBoostSpecs] BoostSpec conditionBoostSpecs - * @property {boolean|null} [skipBoostSpecValidation] BoostSpec skipBoostSpecValidation + * Properties of a Facet. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface IFacet + * @property {string|null} [key] Facet key + * @property {Array.|null} [values] Facet values + * @property {boolean|null} [dynamicFacet] Facet dynamicFacet */ /** - * Constructs a new BoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a BoostSpec. - * @implements IBoostSpec + * Constructs a new Facet. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a Facet. + * @implements IFacet * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set */ - function BoostSpec(properties) { - this.conditionBoostSpecs = []; + function Facet(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73465,106 +83239,106 @@ } /** - * BoostSpec conditionBoostSpecs. - * @member {Array.} conditionBoostSpecs - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * Facet key. + * @member {string} key + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance */ - BoostSpec.prototype.conditionBoostSpecs = $util.emptyArray; + Facet.prototype.key = ""; /** - * BoostSpec skipBoostSpecValidation. - * @member {boolean|null|undefined} skipBoostSpecValidation - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * Facet values. + * @member {Array.} values + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance */ - BoostSpec.prototype.skipBoostSpecValidation = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Facet.prototype.values = $util.emptyArray; /** - * BoostSpec _skipBoostSpecValidation. - * @member {"skipBoostSpecValidation"|undefined} _skipBoostSpecValidation - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * Facet dynamicFacet. + * @member {boolean} dynamicFacet + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance */ - Object.defineProperty(BoostSpec.prototype, "_skipBoostSpecValidation", { - get: $util.oneOfGetter($oneOfFields = ["skipBoostSpecValidation"]), - set: $util.oneOfSetter($oneOfFields) - }); + Facet.prototype.dynamicFacet = false; /** - * Creates a new BoostSpec instance using the specified properties. + * Creates a new Facet instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec instance + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet instance */ - BoostSpec.create = function create(properties) { - return new BoostSpec(properties); + Facet.create = function create(properties) { + return new Facet(properties); }; /** - * Encodes the specified BoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostSpec.encode = function encode(message, writer) { + Facet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.conditionBoostSpecs != null && message.conditionBoostSpecs.length) - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) - $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.conditionBoostSpecs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.skipBoostSpecValidation != null && Object.hasOwnProperty.call(message, "skipBoostSpecValidation")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipBoostSpecValidation); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); return writer; }; /** - * Encodes the specified BoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.verify|verify} messages. + * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IBoostSpec} message BoostSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + Facet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BoostSpec message from the specified reader or buffer. + * Decodes a Facet message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostSpec.decode = function decode(reader, length) { + Facet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.conditionBoostSpecs && message.conditionBoostSpecs.length)) - message.conditionBoostSpecs = []; - message.conditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + message.key = reader.string(); break; } case 2: { - message.skipBoostSpecValidation = reader.bool(); + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); + break; + } + case 3: { + message.dynamicFacet = reader.bool(); break; } default: @@ -73576,150 +83350,158 @@ }; /** - * Decodes a BoostSpec message from the specified reader or buffer, length delimited. + * Decodes a Facet message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoostSpec.decodeDelimited = function decodeDelimited(reader) { + Facet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BoostSpec message. + * Verifies a Facet message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BoostSpec.verify = function verify(message) { + Facet.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.conditionBoostSpecs != null && message.hasOwnProperty("conditionBoostSpecs")) { - if (!Array.isArray(message.conditionBoostSpecs)) - return "conditionBoostSpecs: array expected"; - for (var i = 0; i < message.conditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.conditionBoostSpecs[i]); + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: 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.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify(message.values[i]); if (error) - return "conditionBoostSpecs." + error; + return "values." + error; } } - if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { - properties._skipBoostSpecValidation = 1; - if (typeof message.skipBoostSpecValidation !== "boolean") - return "skipBoostSpecValidation: boolean expected"; - } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + if (typeof message.dynamicFacet !== "boolean") + return "dynamicFacet: boolean expected"; return null; }; /** - * Creates a BoostSpec message from a plain object. Also converts values to their respective internal types. + * Creates a Facet message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} BoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet */ - BoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec) + Facet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec(); - if (object.conditionBoostSpecs) { - if (!Array.isArray(object.conditionBoostSpecs)) - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: array expected"); - message.conditionBoostSpecs = []; - for (var i = 0; i < object.conditionBoostSpecs.length; ++i) { - if (typeof object.conditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchRequest.BoostSpec.conditionBoostSpecs: object expected"); - message.conditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.conditionBoostSpecs[i]); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: object expected"); + message.values[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); } } - if (object.skipBoostSpecValidation != null) - message.skipBoostSpecValidation = Boolean(object.skipBoostSpecValidation); + if (object.dynamicFacet != null) + message.dynamicFacet = Boolean(object.dynamicFacet); return message; }; /** - * Creates a plain object from a BoostSpec message. Also converts values to other types if specified. + * Creates a plain object from a Facet message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} message BoostSpec + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet} message Facet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoostSpec.toObject = function toObject(message, options) { + Facet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.conditionBoostSpecs = []; - if (message.conditionBoostSpecs && message.conditionBoostSpecs.length) { - object.conditionBoostSpecs = []; - for (var j = 0; j < message.conditionBoostSpecs.length; ++j) - object.conditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.conditionBoostSpecs[j], options); + object.values = []; + if (options.defaults) { + object.key = ""; + object.dynamicFacet = false; } - if (message.skipBoostSpecValidation != null && message.hasOwnProperty("skipBoostSpecValidation")) { - object.skipBoostSpecValidation = message.skipBoostSpecValidation; - if (options.oneofs) - object._skipBoostSpecValidation = "skipBoostSpecValidation"; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); } + if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) + object.dynamicFacet = message.dynamicFacet; return object; }; /** - * Converts this BoostSpec to JSON. + * Converts this Facet to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @instance * @returns {Object.} JSON object */ - BoostSpec.prototype.toJSON = function toJSON() { + Facet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BoostSpec + * Gets the default type url for Facet * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Facet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.BoostSpec"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.Facet"; }; - BoostSpec.ConditionBoostSpec = (function() { + Facet.FacetValue = (function() { /** - * Properties of a ConditionBoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @interface IConditionBoostSpec - * @property {string|null} [condition] ConditionBoostSpec condition - * @property {number|null} [boost] ConditionBoostSpec boost + * Properties of a FacetValue. + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @interface IFacetValue + * @property {string|null} [value] FacetValue value + * @property {google.cloud.retail.v2alpha.IInterval|null} [interval] FacetValue interval + * @property {number|Long|null} [count] FacetValue count + * @property {number|null} [minValue] FacetValue minValue + * @property {number|null} [maxValue] FacetValue maxValue */ /** - * Constructs a new ConditionBoostSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec - * @classdesc Represents a ConditionBoostSpec. - * @implements IConditionBoostSpec + * Constructs a new FacetValue. + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet + * @classdesc Represents a FacetValue. + * @implements IFacetValue * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set */ - function ConditionBoostSpec(properties) { + function FacetValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73727,89 +83509,145 @@ } /** - * ConditionBoostSpec condition. - * @member {string} condition - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * FacetValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @instance */ - ConditionBoostSpec.prototype.condition = ""; + FacetValue.prototype.value = null; /** - * ConditionBoostSpec boost. - * @member {number} boost - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * FacetValue interval. + * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} interval + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @instance */ - ConditionBoostSpec.prototype.boost = 0; + FacetValue.prototype.interval = null; /** - * Creates a new ConditionBoostSpec instance using the specified properties. + * FacetValue count. + * @member {number|Long} count + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FacetValue minValue. + * @member {number} minValue + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.minValue = 0; + + /** + * FacetValue maxValue. + * @member {number} maxValue + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + FacetValue.prototype.maxValue = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FacetValue facetValue. + * @member {"value"|"interval"|undefined} facetValue + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue + * @instance + */ + Object.defineProperty(FacetValue.prototype, "facetValue", { + get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FacetValue instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec instance + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue instance */ - ConditionBoostSpec.create = function create(properties) { - return new ConditionBoostSpec(properties); + FacetValue.create = function create(properties) { + return new FacetValue(properties); }; /** - * Encodes the specified ConditionBoostSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConditionBoostSpec.encode = function encode(message, writer) { + FacetValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.condition); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.retail.v2alpha.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.minValue); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.maxValue); return writer; }; /** - * Encodes the specified ConditionBoostSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify|verify} messages. + * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.IConditionBoostSpec} message ConditionBoostSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConditionBoostSpec.encodeDelimited = function encodeDelimited(message, writer) { + FacetValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer. + * Decodes a FacetValue message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConditionBoostSpec.decode = function decode(reader, length) { + FacetValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.condition = reader.string(); + message.value = reader.string(); break; } case 2: { - message.boost = reader.float(); + message.interval = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + case 5: { + message.minValue = reader.double(); + break; + } + case 6: { + message.maxValue = reader.double(); break; } default: @@ -73821,135 +83659,190 @@ }; /** - * Decodes a ConditionBoostSpec message from the specified reader or buffer, length delimited. + * Decodes a FacetValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConditionBoostSpec.decodeDelimited = function decodeDelimited(reader) { + FacetValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConditionBoostSpec message. + * Verifies a FacetValue message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConditionBoostSpec.verify = function verify(message) { + FacetValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - if (!$util.isString(message.condition)) - return "condition: string expected"; - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.facetValue = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + if (properties.facetValue === 1) + return "facetValue: multiple values"; + properties.facetValue = 1; + { + var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.interval); + if (error) + return "interval." + error; + } + } + 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"; + if (message.minValue != null && message.hasOwnProperty("minValue")) + if (typeof message.minValue !== "number") + return "minValue: number expected"; + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + if (typeof message.maxValue !== "number") + return "maxValue: number expected"; return null; }; /** - * Creates a ConditionBoostSpec message from a plain object. Also converts values to their respective internal types. + * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} ConditionBoostSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue */ - ConditionBoostSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec) + FacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec(); - if (object.condition != null) - message.condition = String(object.condition); - if (object.boost != null) - message.boost = Number(object.boost); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); + if (object.value != null) + message.value = String(object.value); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.interval: object expected"); + message.interval = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.interval); + } + 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(); + if (object.minValue != null) + message.minValue = Number(object.minValue); + if (object.maxValue != null) + message.maxValue = Number(object.maxValue); return message; }; /** - * Creates a plain object from a ConditionBoostSpec message. Also converts values to other types if specified. + * Creates a plain object from a FacetValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec} message ConditionBoostSpec + * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} message FacetValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConditionBoostSpec.toObject = function toObject(message, options) { + FacetValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.condition = ""; - object.boost = 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; + object.minValue = 0; + object.maxValue = 0; } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = message.condition; - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.facetValue = "value"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.cloud.retail.v2alpha.Interval.toObject(message.interval, options); + if (options.oneofs) + object.facetValue = "interval"; + } + 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; + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = options.json && !isFinite(message.minValue) ? String(message.minValue) : message.minValue; + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = options.json && !isFinite(message.maxValue) ? String(message.maxValue) : message.maxValue; return object; }; /** - * Converts this ConditionBoostSpec to JSON. + * Converts this FacetValue to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @instance * @returns {Object.} JSON object */ - ConditionBoostSpec.prototype.toJSON = function toJSON() { + FacetValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ConditionBoostSpec + * Gets the default type url for FacetValue * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ConditionBoostSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue"; }; - return ConditionBoostSpec; + return FacetValue; })(); - return BoostSpec; + return Facet; })(); - SearchRequest.QueryExpansionSpec = (function() { + SearchResponse.QueryExpansionInfo = (function() { /** - * Properties of a QueryExpansionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IQueryExpansionSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition|null} [condition] QueryExpansionSpec condition - * @property {boolean|null} [pinUnexpandedResults] QueryExpansionSpec pinUnexpandedResults + * Properties of a QueryExpansionInfo. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @interface IQueryExpansionInfo + * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery + * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount */ /** - * Constructs a new QueryExpansionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a QueryExpansionSpec. - * @implements IQueryExpansionSpec + * Constructs a new QueryExpansionInfo. + * @memberof google.cloud.retail.v2alpha.SearchResponse + * @classdesc Represents a QueryExpansionInfo. + * @implements IQueryExpansionInfo * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set */ - function QueryExpansionSpec(properties) { + function QueryExpansionInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -73957,89 +83850,89 @@ } /** - * QueryExpansionSpec condition. - * @member {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition} condition - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * QueryExpansionInfo expandedQuery. + * @member {boolean} expandedQuery + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @instance */ - QueryExpansionSpec.prototype.condition = 0; + QueryExpansionInfo.prototype.expandedQuery = false; /** - * QueryExpansionSpec pinUnexpandedResults. - * @member {boolean} pinUnexpandedResults - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * QueryExpansionInfo pinnedResultCount. + * @member {number|Long} pinnedResultCount + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @instance */ - QueryExpansionSpec.prototype.pinUnexpandedResults = false; + QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new QueryExpansionSpec instance using the specified properties. + * Creates a new QueryExpansionInfo instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec instance + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance */ - QueryExpansionSpec.create = function create(properties) { - return new QueryExpansionSpec(properties); + QueryExpansionInfo.create = function create(properties) { + return new QueryExpansionInfo(properties); }; /** - * Encodes the specified QueryExpansionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryExpansionSpec.encode = function encode(message, writer) { + QueryExpansionInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.condition); - if (message.pinUnexpandedResults != null && Object.hasOwnProperty.call(message, "pinUnexpandedResults")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pinUnexpandedResults); + if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); + if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); return writer; }; /** - * Encodes the specified QueryExpansionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.verify|verify} messages. + * Encodes the specified QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IQueryExpansionSpec} message QueryExpansionSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryExpansionSpec.encodeDelimited = function encodeDelimited(message, writer) { + QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer. + * Decodes a QueryExpansionInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryExpansionSpec.decode = function decode(reader, length) { + QueryExpansionInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.condition = reader.int32(); + message.expandedQuery = reader.bool(); break; } case 2: { - message.pinUnexpandedResults = reader.bool(); + message.pinnedResultCount = reader.int64(); break; } default: @@ -74051,171 +83944,397 @@ }; /** - * Decodes a QueryExpansionSpec message from the specified reader or buffer, length delimited. + * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryExpansionSpec.decodeDelimited = function decodeDelimited(reader) { + QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryExpansionSpec message. + * Verifies a QueryExpansionInfo message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryExpansionSpec.verify = function verify(message) { + QueryExpansionInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.condition != null && message.hasOwnProperty("condition")) - switch (message.condition) { - default: - return "condition: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - if (typeof message.pinUnexpandedResults !== "boolean") - return "pinUnexpandedResults: boolean expected"; + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + if (typeof message.expandedQuery !== "boolean") + return "expandedQuery: boolean expected"; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) + return "pinnedResultCount: integer|Long expected"; return null; }; /** - * Creates a QueryExpansionSpec message from a plain object. Also converts values to their respective internal types. + * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} QueryExpansionSpec + * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo */ - QueryExpansionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec) + QueryExpansionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); - switch (object.condition) { - default: - if (typeof object.condition === "number") { - message.condition = object.condition; - break; - } - break; - case "CONDITION_UNSPECIFIED": - case 0: - message.condition = 0; - break; - case "DISABLED": - case 1: - message.condition = 1; - break; - case "AUTO": - case 3: - message.condition = 3; - break; - } - if (object.pinUnexpandedResults != null) - message.pinUnexpandedResults = Boolean(object.pinUnexpandedResults); + var message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); + if (object.expandedQuery != null) + message.expandedQuery = Boolean(object.expandedQuery); + if (object.pinnedResultCount != null) + if ($util.Long) + (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; + else if (typeof object.pinnedResultCount === "string") + message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); + else if (typeof object.pinnedResultCount === "number") + message.pinnedResultCount = object.pinnedResultCount; + else if (typeof object.pinnedResultCount === "object") + message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a QueryExpansionSpec message. Also converts values to other types if specified. + * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} message QueryExpansionSpec + * @param {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryExpansionSpec.toObject = function toObject(message, options) { + QueryExpansionInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.condition = options.enums === String ? "CONDITION_UNSPECIFIED" : 0; - object.pinUnexpandedResults = false; + object.expandedQuery = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.pinnedResultCount = options.longs === String ? "0" : 0; } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; - if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) - object.pinUnexpandedResults = message.pinUnexpandedResults; + if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) + object.expandedQuery = message.expandedQuery; + if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) + if (typeof message.pinnedResultCount === "number") + object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; + else + object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + return object; + }; + + /** + * Converts this QueryExpansionInfo to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + * @instance + * @returns {Object.} JSON object + */ + QueryExpansionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryExpansionInfo + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryExpansionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo"; + }; + + return QueryExpansionInfo; + })(); + + return SearchResponse; + })(); + + v2alpha.ExperimentInfo = (function() { + + /** + * Properties of an ExperimentInfo. + * @memberof google.cloud.retail.v2alpha + * @interface IExperimentInfo + * @property {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null} [servingConfigExperiment] ExperimentInfo servingConfigExperiment + * @property {string|null} [experiment] ExperimentInfo experiment + */ + + /** + * Constructs a new ExperimentInfo. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an ExperimentInfo. + * @implements IExperimentInfo + * @constructor + * @param {google.cloud.retail.v2alpha.IExperimentInfo=} [properties] Properties to set + */ + function ExperimentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentInfo servingConfigExperiment. + * @member {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null|undefined} servingConfigExperiment + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @instance + */ + ExperimentInfo.prototype.servingConfigExperiment = null; + + /** + * ExperimentInfo experiment. + * @member {string} experiment + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @instance + */ + ExperimentInfo.prototype.experiment = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExperimentInfo experimentMetadata. + * @member {"servingConfigExperiment"|undefined} experimentMetadata + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @instance + */ + Object.defineProperty(ExperimentInfo.prototype, "experimentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["servingConfigExperiment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExperimentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {google.cloud.retail.v2alpha.IExperimentInfo=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo instance + */ + ExperimentInfo.create = function create(properties) { + return new ExperimentInfo(properties); + }; + + /** + * Encodes the specified ExperimentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {google.cloud.retail.v2alpha.IExperimentInfo} message ExperimentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.experiment); + if (message.servingConfigExperiment != null && Object.hasOwnProperty.call(message, "servingConfigExperiment")) + $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.encode(message.servingConfigExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExperimentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {google.cloud.retail.v2alpha.IExperimentInfo} message ExperimentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExperimentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExperimentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.experiment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentInfo message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.servingConfigExperiment != null && message.hasOwnProperty("servingConfigExperiment")) { + properties.experimentMetadata = 1; + { + var error = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify(message.servingConfigExperiment); + if (error) + return "servingConfigExperiment." + error; + } + } + if (message.experiment != null && message.hasOwnProperty("experiment")) + if (!$util.isString(message.experiment)) + return "experiment: string expected"; + return null; + }; + + /** + * Creates an ExperimentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + */ + ExperimentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExperimentInfo) return object; - }; - - /** - * Converts this QueryExpansionSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.cloud.retail.v2alpha.ExperimentInfo(); + if (object.servingConfigExperiment != null) { + if (typeof object.servingConfigExperiment !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ExperimentInfo.servingConfigExperiment: object expected"); + message.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.fromObject(object.servingConfigExperiment); + } + if (object.experiment != null) + message.experiment = String(object.experiment); + return message; + }; - /** - * Gets the default type url for QueryExpansionSpec - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryExpansionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec"; - }; + /** + * Creates a plain object from an ExperimentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {google.cloud.retail.v2alpha.ExperimentInfo} message ExperimentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.experiment = ""; + if (message.experiment != null && message.hasOwnProperty("experiment")) + object.experiment = message.experiment; + if (message.servingConfigExperiment != null && message.hasOwnProperty("servingConfigExperiment")) { + object.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.toObject(message.servingConfigExperiment, options); + if (options.oneofs) + object.experimentMetadata = "servingConfigExperiment"; + } + return object; + }; - /** - * Condition enum. - * @name google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition - * @enum {number} - * @property {number} CONDITION_UNSPECIFIED=0 CONDITION_UNSPECIFIED value - * @property {number} DISABLED=1 DISABLED value - * @property {number} AUTO=3 AUTO value - */ - QueryExpansionSpec.Condition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DISABLED"] = 1; - values[valuesById[3] = "AUTO"] = 3; - return values; - })(); + /** + * Converts this ExperimentInfo to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @instance + * @returns {Object.} JSON object + */ + ExperimentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return QueryExpansionSpec; - })(); + /** + * Gets the default type url for ExperimentInfo + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ExperimentInfo"; + }; - SearchRequest.PersonalizationSpec = (function() { + ExperimentInfo.ServingConfigExperiment = (function() { /** - * Properties of a PersonalizationSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface IPersonalizationSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode|null} [mode] PersonalizationSpec mode + * Properties of a ServingConfigExperiment. + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @interface IServingConfigExperiment + * @property {string|null} [originalServingConfig] ServingConfigExperiment originalServingConfig + * @property {string|null} [experimentServingConfig] ServingConfigExperiment experimentServingConfig */ /** - * Constructs a new PersonalizationSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a PersonalizationSpec. - * @implements IPersonalizationSpec + * Constructs a new ServingConfigExperiment. + * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @classdesc Represents a ServingConfigExperiment. + * @implements IServingConfigExperiment * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment=} [properties] Properties to set */ - function PersonalizationSpec(properties) { + function ServingConfigExperiment(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -74223,75 +84342,89 @@ } /** - * PersonalizationSpec mode. - * @member {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode} mode - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * ServingConfigExperiment originalServingConfig. + * @member {string} originalServingConfig + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @instance */ - PersonalizationSpec.prototype.mode = 0; + ServingConfigExperiment.prototype.originalServingConfig = ""; /** - * Creates a new PersonalizationSpec instance using the specified properties. + * ServingConfigExperiment experimentServingConfig. + * @member {string} experimentServingConfig + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @instance + */ + ServingConfigExperiment.prototype.experimentServingConfig = ""; + + /** + * Creates a new ServingConfigExperiment instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec instance + * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment instance */ - PersonalizationSpec.create = function create(properties) { - return new PersonalizationSpec(properties); + ServingConfigExperiment.create = function create(properties) { + return new ServingConfigExperiment(properties); }; /** - * Encodes the specified PersonalizationSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * Encodes the specified ServingConfigExperiment message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment} message ServingConfigExperiment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PersonalizationSpec.encode = function encode(message, writer) { + ServingConfigExperiment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); + if (message.originalServingConfig != null && Object.hasOwnProperty.call(message, "originalServingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.originalServingConfig); + if (message.experimentServingConfig != null && Object.hasOwnProperty.call(message, "experimentServingConfig")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.experimentServingConfig); return writer; }; /** - * Encodes the specified PersonalizationSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify|verify} messages. + * Encodes the specified ServingConfigExperiment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec} message PersonalizationSpec message or plain object to encode + * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment} message ServingConfigExperiment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PersonalizationSpec.encodeDelimited = function encodeDelimited(message, writer) { + ServingConfigExperiment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PersonalizationSpec message from the specified reader or buffer. + * Decodes a ServingConfigExperiment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PersonalizationSpec.decode = function decode(reader, length) { + ServingConfigExperiment.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.mode = reader.int32(); + message.originalServingConfig = reader.string(); + break; + } + case 2: { + message.experimentServingConfig = reader.string(); break; } default: @@ -74303,459 +84436,1083 @@ }; /** - * Decodes a PersonalizationSpec message from the specified reader or buffer, length delimited. + * Decodes a ServingConfigExperiment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PersonalizationSpec.decodeDelimited = function decodeDelimited(reader) { + ServingConfigExperiment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PersonalizationSpec message. + * Verifies a ServingConfigExperiment message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PersonalizationSpec.verify = function verify(message) { + ServingConfigExperiment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.originalServingConfig != null && message.hasOwnProperty("originalServingConfig")) + if (!$util.isString(message.originalServingConfig)) + return "originalServingConfig: string expected"; + if (message.experimentServingConfig != null && message.hasOwnProperty("experimentServingConfig")) + if (!$util.isString(message.experimentServingConfig)) + return "experimentServingConfig: string expected"; return null; }; /** - * Creates a PersonalizationSpec message from a plain object. Also converts values to their respective internal types. + * Creates a ServingConfigExperiment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} PersonalizationSpec + * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment */ - PersonalizationSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec) + ServingConfigExperiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "AUTO": - case 1: - message.mode = 1; - break; - case "DISABLED": - case 2: - message.mode = 2; - break; - } + var message = new $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment(); + if (object.originalServingConfig != null) + message.originalServingConfig = String(object.originalServingConfig); + if (object.experimentServingConfig != null) + message.experimentServingConfig = String(object.experimentServingConfig); return message; }; /** - * Creates a plain object from a PersonalizationSpec message. Also converts values to other types if specified. + * Creates a plain object from a ServingConfigExperiment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec} message PersonalizationSpec + * @param {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} message ServingConfigExperiment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PersonalizationSpec.toObject = function toObject(message, options) { + ServingConfigExperiment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + if (options.defaults) { + object.originalServingConfig = ""; + object.experimentServingConfig = ""; + } + if (message.originalServingConfig != null && message.hasOwnProperty("originalServingConfig")) + object.originalServingConfig = message.originalServingConfig; + if (message.experimentServingConfig != null && message.hasOwnProperty("experimentServingConfig")) + object.experimentServingConfig = message.experimentServingConfig; return object; }; /** - * Converts this PersonalizationSpec to JSON. + * Converts this ServingConfigExperiment to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @instance * @returns {Object.} JSON object */ - PersonalizationSpec.prototype.toJSON = function toJSON() { + ServingConfigExperiment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PersonalizationSpec + * Gets the default type url for ServingConfigExperiment * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec + * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PersonalizationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServingConfigExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment"; }; - /** - * Mode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} AUTO=1 AUTO value - * @property {number} DISABLED=2 DISABLED value - */ - PersonalizationSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTO"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - return values; - })(); - - return PersonalizationSpec; + return ServingConfigExperiment; })(); - SearchRequest.SpellCorrectionSpec = (function() { + return ExperimentInfo; + })(); + + v2alpha.Control = (function() { + + /** + * Properties of a Control. + * @memberof google.cloud.retail.v2alpha + * @interface IControl + * @property {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null} [facetSpec] Control facetSpec + * @property {google.cloud.retail.v2alpha.IRule|null} [rule] Control rule + * @property {string|null} [name] Control name + * @property {string|null} [displayName] Control displayName + * @property {Array.|null} [associatedServingConfigIds] Control associatedServingConfigIds + * @property {Array.|null} [solutionTypes] Control solutionTypes + * @property {Array.|null} [searchSolutionUseCase] Control searchSolutionUseCase + */ + + /** + * Constructs a new Control. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a Control. + * @implements IControl + * @constructor + * @param {google.cloud.retail.v2alpha.IControl=} [properties] Properties to set + */ + function Control(properties) { + this.associatedServingConfigIds = []; + this.solutionTypes = []; + this.searchSolutionUseCase = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Control facetSpec. + * @member {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null|undefined} facetSpec + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.facetSpec = null; + + /** + * Control rule. + * @member {google.cloud.retail.v2alpha.IRule|null|undefined} rule + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.rule = null; + + /** + * Control name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.name = ""; + + /** + * Control displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.displayName = ""; + + /** + * Control associatedServingConfigIds. + * @member {Array.} associatedServingConfigIds + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.associatedServingConfigIds = $util.emptyArray; + + /** + * Control solutionTypes. + * @member {Array.} solutionTypes + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.solutionTypes = $util.emptyArray; + + /** + * Control searchSolutionUseCase. + * @member {Array.} searchSolutionUseCase + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Control.prototype.searchSolutionUseCase = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Control control. + * @member {"facetSpec"|"rule"|undefined} control + * @memberof google.cloud.retail.v2alpha.Control + * @instance + */ + Object.defineProperty(Control.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["facetSpec", "rule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Control instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {google.cloud.retail.v2alpha.IControl=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Control} Control instance + */ + Control.create = function create(properties) { + return new Control(properties); + }; + + /** + * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {google.cloud.retail.v2alpha.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encode = function encode(message, writer) { + 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.facetSpec != null && Object.hasOwnProperty.call(message, "facetSpec")) + $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) + $root.google.cloud.retail.v2alpha.Rule.encode(message.rule, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.associatedServingConfigIds != null && message.associatedServingConfigIds.length) + for (var i = 0; i < message.associatedServingConfigIds.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.associatedServingConfigIds[i]); + if (message.solutionTypes != null && message.solutionTypes.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.solutionTypes.length; ++i) + writer.int32(message.solutionTypes[i]); + writer.ldelim(); + } + if (message.searchSolutionUseCase != null && message.searchSolutionUseCase.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.searchSolutionUseCase.length; ++i) + writer.int32(message.searchSolutionUseCase[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {google.cloud.retail.v2alpha.IControl} message Control message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Control.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Control message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Control(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rule = $root.google.cloud.retail.v2alpha.Rule.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 5: { + if (!(message.associatedServingConfigIds && message.associatedServingConfigIds.length)) + message.associatedServingConfigIds = []; + message.associatedServingConfigIds.push(reader.string()); + break; + } + case 6: { + if (!(message.solutionTypes && message.solutionTypes.length)) + message.solutionTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.solutionTypes.push(reader.int32()); + } else + message.solutionTypes.push(reader.int32()); + break; + } + case 7: { + if (!(message.searchSolutionUseCase && message.searchSolutionUseCase.length)) + message.searchSolutionUseCase = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.searchSolutionUseCase.push(reader.int32()); + } else + message.searchSolutionUseCase.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Control message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Control} Control + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Control.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Control message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Control.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { + properties.control = 1; + { + var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpec); + if (error) + return "facetSpec." + error; + } + } + if (message.rule != null && message.hasOwnProperty("rule")) { + if (properties.control === 1) + return "control: multiple values"; + properties.control = 1; + { + var error = $root.google.cloud.retail.v2alpha.Rule.verify(message.rule); + if (error) + return "rule." + 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.associatedServingConfigIds != null && message.hasOwnProperty("associatedServingConfigIds")) { + if (!Array.isArray(message.associatedServingConfigIds)) + return "associatedServingConfigIds: array expected"; + for (var i = 0; i < message.associatedServingConfigIds.length; ++i) + if (!$util.isString(message.associatedServingConfigIds[i])) + return "associatedServingConfigIds: string[] expected"; + } + if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { + if (!Array.isArray(message.solutionTypes)) + return "solutionTypes: array expected"; + for (var i = 0; i < message.solutionTypes.length; ++i) + switch (message.solutionTypes[i]) { + default: + return "solutionTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.searchSolutionUseCase != null && message.hasOwnProperty("searchSolutionUseCase")) { + if (!Array.isArray(message.searchSolutionUseCase)) + return "searchSolutionUseCase: array expected"; + for (var i = 0; i < message.searchSolutionUseCase.length; ++i) + switch (message.searchSolutionUseCase[i]) { + default: + return "searchSolutionUseCase: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a Control message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Control} Control + */ + Control.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Control) + return object; + var message = new $root.google.cloud.retail.v2alpha.Control(); + if (object.facetSpec != null) { + if (typeof object.facetSpec !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Control.facetSpec: object expected"); + message.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpec); + } + if (object.rule != null) { + if (typeof object.rule !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Control.rule: object expected"); + message.rule = $root.google.cloud.retail.v2alpha.Rule.fromObject(object.rule); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.associatedServingConfigIds) { + if (!Array.isArray(object.associatedServingConfigIds)) + throw TypeError(".google.cloud.retail.v2alpha.Control.associatedServingConfigIds: array expected"); + message.associatedServingConfigIds = []; + for (var i = 0; i < object.associatedServingConfigIds.length; ++i) + message.associatedServingConfigIds[i] = String(object.associatedServingConfigIds[i]); + } + if (object.solutionTypes) { + if (!Array.isArray(object.solutionTypes)) + throw TypeError(".google.cloud.retail.v2alpha.Control.solutionTypes: array expected"); + message.solutionTypes = []; + for (var i = 0; i < object.solutionTypes.length; ++i) + switch (object.solutionTypes[i]) { + default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.solutionTypes[i] = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.solutionTypes[i] = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.solutionTypes[i] = 2; + break; + } + } + if (object.searchSolutionUseCase) { + if (!Array.isArray(object.searchSolutionUseCase)) + throw TypeError(".google.cloud.retail.v2alpha.Control.searchSolutionUseCase: array expected"); + message.searchSolutionUseCase = []; + for (var i = 0; i < object.searchSolutionUseCase.length; ++i) + switch (object.searchSolutionUseCase[i]) { + default: + if (typeof object.searchSolutionUseCase[i] === "number") { + message.searchSolutionUseCase[i] = object.searchSolutionUseCase[i]; + break; + } + case "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": + case 0: + message.searchSolutionUseCase[i] = 0; + break; + case "SEARCH_SOLUTION_USE_CASE_SEARCH": + case 1: + message.searchSolutionUseCase[i] = 1; + break; + case "SEARCH_SOLUTION_USE_CASE_BROWSE": + case 2: + message.searchSolutionUseCase[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Control message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {google.cloud.retail.v2alpha.Control} message Control + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Control.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedServingConfigIds = []; + object.solutionTypes = []; + object.searchSolutionUseCase = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { + object.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpec, options); + if (options.oneofs) + object.control = "facetSpec"; + } + if (message.rule != null && message.hasOwnProperty("rule")) { + object.rule = $root.google.cloud.retail.v2alpha.Rule.toObject(message.rule, options); + if (options.oneofs) + object.control = "rule"; + } + if (message.associatedServingConfigIds && message.associatedServingConfigIds.length) { + object.associatedServingConfigIds = []; + for (var j = 0; j < message.associatedServingConfigIds.length; ++j) + object.associatedServingConfigIds[j] = message.associatedServingConfigIds[j]; + } + if (message.solutionTypes && message.solutionTypes.length) { + object.solutionTypes = []; + for (var j = 0; j < message.solutionTypes.length; ++j) + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + } + if (message.searchSolutionUseCase && message.searchSolutionUseCase.length) { + object.searchSolutionUseCase = []; + for (var j = 0; j < message.searchSolutionUseCase.length; ++j) + object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] === undefined ? message.searchSolutionUseCase[j] : $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; + } + return object; + }; + + /** + * Converts this Control to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Control + * @instance + * @returns {Object.} JSON object + */ + Control.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Control + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Control + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Control.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Control"; + }; + + return Control; + })(); + + v2alpha.ControlService = (function() { + + /** + * Constructs a new ControlService service. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ControlService + * @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 ControlService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ControlService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ControlService; + + /** + * Creates new ControlService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.ControlService + * @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 {ControlService} RPC service. Useful where requests and/or responses are streamed. + */ + ControlService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|createControl}. + * @memberof google.cloud.retail.v2alpha.ControlService + * @typedef CreateControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Control} [response] Control + */ + + /** + * Calls CreateControl. + * @function createControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateControlRequest} request CreateControlRequest message or plain object + * @param {google.cloud.retail.v2alpha.ControlService.CreateControlCallback} callback Node-style callback called with the error, if any, and Control + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.createControl = function createControl(request, callback) { + return this.rpcCall(createControl, $root.google.cloud.retail.v2alpha.CreateControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); + }, "name", { value: "CreateControl" }); + + /** + * Calls CreateControl. + * @function createControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateControlRequest} request CreateControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|deleteControl}. + * @memberof google.cloud.retail.v2alpha.ControlService + * @typedef DeleteControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteControl. + * @function deleteControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} request DeleteControlRequest message or plain object + * @param {google.cloud.retail.v2alpha.ControlService.DeleteControlCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.deleteControl = function deleteControl(request, callback) { + return this.rpcCall(deleteControl, $root.google.cloud.retail.v2alpha.DeleteControlRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteControl" }); + + /** + * Calls DeleteControl. + * @function deleteControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} request DeleteControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|updateControl}. + * @memberof google.cloud.retail.v2alpha.ControlService + * @typedef UpdateControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Control} [response] Control + */ + + /** + * Calls UpdateControl. + * @function updateControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} request UpdateControlRequest message or plain object + * @param {google.cloud.retail.v2alpha.ControlService.UpdateControlCallback} callback Node-style callback called with the error, if any, and Control + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.updateControl = function updateControl(request, callback) { + return this.rpcCall(updateControl, $root.google.cloud.retail.v2alpha.UpdateControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); + }, "name", { value: "UpdateControl" }); + + /** + * Calls UpdateControl. + * @function updateControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} request UpdateControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|getControl}. + * @memberof google.cloud.retail.v2alpha.ControlService + * @typedef GetControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Control} [response] Control + */ + + /** + * Calls GetControl. + * @function getControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IGetControlRequest} request GetControlRequest message or plain object + * @param {google.cloud.retail.v2alpha.ControlService.GetControlCallback} callback Node-style callback called with the error, if any, and Control + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.getControl = function getControl(request, callback) { + return this.rpcCall(getControl, $root.google.cloud.retail.v2alpha.GetControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); + }, "name", { value: "GetControl" }); + + /** + * Calls GetControl. + * @function getControl + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IGetControlRequest} request GetControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|listControls}. + * @memberof google.cloud.retail.v2alpha.ControlService + * @typedef ListControlsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListControlsResponse} [response] ListControlsResponse + */ + + /** + * Calls ListControls. + * @function listControls + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IListControlsRequest} request ListControlsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ControlService.ListControlsCallback} callback Node-style callback called with the error, if any, and ListControlsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ControlService.prototype.listControls = function listControls(request, callback) { + return this.rpcCall(listControls, $root.google.cloud.retail.v2alpha.ListControlsRequest, $root.google.cloud.retail.v2alpha.ListControlsResponse, request, callback); + }, "name", { value: "ListControls" }); + + /** + * Calls ListControls. + * @function listControls + * @memberof google.cloud.retail.v2alpha.ControlService + * @instance + * @param {google.cloud.retail.v2alpha.IListControlsRequest} request ListControlsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ControlService; + })(); + + v2alpha.CreateControlRequest = (function() { + + /** + * Properties of a CreateControlRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ICreateControlRequest + * @property {string|null} [parent] CreateControlRequest parent + * @property {google.cloud.retail.v2alpha.IControl|null} [control] CreateControlRequest control + * @property {string|null} [controlId] CreateControlRequest controlId + */ + + /** + * Constructs a new CreateControlRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CreateControlRequest. + * @implements ICreateControlRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ICreateControlRequest=} [properties] Properties to set + */ + function CreateControlRequest(properties) { + if (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 SpellCorrectionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @interface ISpellCorrectionSpec - * @property {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode|null} [mode] SpellCorrectionSpec mode - */ + /** + * CreateControlRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @instance + */ + CreateControlRequest.prototype.parent = ""; - /** - * Constructs a new SpellCorrectionSpec. - * @memberof google.cloud.retail.v2alpha.SearchRequest - * @classdesc Represents a SpellCorrectionSpec. - * @implements ISpellCorrectionSpec - * @constructor - * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set - */ - function SpellCorrectionSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * CreateControlRequest control. + * @member {google.cloud.retail.v2alpha.IControl|null|undefined} control + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @instance + */ + CreateControlRequest.prototype.control = null; - /** - * SpellCorrectionSpec mode. - * @member {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode} mode - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @instance - */ - SpellCorrectionSpec.prototype.mode = 0; + /** + * CreateControlRequest controlId. + * @member {string} controlId + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @instance + */ + CreateControlRequest.prototype.controlId = ""; - /** - * Creates a new SpellCorrectionSpec instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec instance - */ - SpellCorrectionSpec.create = function create(properties) { - return new SpellCorrectionSpec(properties); - }; + /** + * Creates a new CreateControlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.ICreateControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest instance + */ + CreateControlRequest.create = function create(properties) { + return new CreateControlRequest(properties); + }; - /** - * Encodes the specified SpellCorrectionSpec message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpellCorrectionSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); - return writer; - }; + /** + * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.ICreateControlRequest} message CreateControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateControlRequest.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.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.retail.v2alpha.Control.encode(message.control, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.controlId != null && Object.hasOwnProperty.call(message, "controlId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.controlId); + return writer; + }; - /** - * Encodes the specified SpellCorrectionSpec message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.ISpellCorrectionSpec} message SpellCorrectionSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpellCorrectionSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.ICreateControlRequest} message CreateControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a SpellCorrectionSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpellCorrectionSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a CreateControlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateControlRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateControlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); break; } - } - return message; - }; - - /** - * Decodes a SpellCorrectionSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpellCorrectionSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpellCorrectionSpec message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpellCorrectionSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: + case 2: { + message.control = $root.google.cloud.retail.v2alpha.Control.decode(reader, reader.uint32()); break; } - return null; - }; - - /** - * Creates a SpellCorrectionSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} SpellCorrectionSpec - */ - SpellCorrectionSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec(); - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; + case 3: { + message.controlId = reader.string(); break; } - break; - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "SUGGESTION_ONLY": - case 1: - message.mode = 1; - break; - case "AUTO": - case 2: - message.mode = 2; + default: + reader.skipType(tag & 7); break; } - return message; - }; - - /** - * Creates a plain object from a SpellCorrectionSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} message SpellCorrectionSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpellCorrectionSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; - return object; - }; + } + return message; + }; - /** - * Converts this SpellCorrectionSpec to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @instance - * @returns {Object.} JSON object - */ - SpellCorrectionSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateControlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for SpellCorrectionSpec - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpellCorrectionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec"; - }; + /** + * Verifies a CreateControlRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateControlRequest.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.control != null && message.hasOwnProperty("control")) { + var error = $root.google.cloud.retail.v2alpha.Control.verify(message.control); + if (error) + return "control." + error; + } + if (message.controlId != null && message.hasOwnProperty("controlId")) + if (!$util.isString(message.controlId)) + return "controlId: string expected"; + return null; + }; - /** - * Mode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} SUGGESTION_ONLY=1 SUGGESTION_ONLY value - * @property {number} AUTO=2 AUTO value - */ - SpellCorrectionSpec.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUGGESTION_ONLY"] = 1; - values[valuesById[2] = "AUTO"] = 2; - return values; - })(); + /** + * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + */ + CreateControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateControlRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.CreateControlRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateControlRequest.control: object expected"); + message.control = $root.google.cloud.retail.v2alpha.Control.fromObject(object.control); + } + if (object.controlId != null) + message.controlId = String(object.controlId); + return message; + }; - return SpellCorrectionSpec; - })(); + /** + * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.CreateControlRequest} message CreateControlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateControlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.control = null; + object.controlId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.control != null && message.hasOwnProperty("control")) + object.control = $root.google.cloud.retail.v2alpha.Control.toObject(message.control, options); + if (message.controlId != null && message.hasOwnProperty("controlId")) + object.controlId = message.controlId; + return object; + }; /** - * RelevanceThreshold enum. - * @name google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold - * @enum {number} - * @property {number} RELEVANCE_THRESHOLD_UNSPECIFIED=0 RELEVANCE_THRESHOLD_UNSPECIFIED value - * @property {number} HIGH=1 HIGH value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} LOW=3 LOW value - * @property {number} LOWEST=4 LOWEST value + * Converts this CreateControlRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @instance + * @returns {Object.} JSON object */ - SearchRequest.RelevanceThreshold = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RELEVANCE_THRESHOLD_UNSPECIFIED"] = 0; - values[valuesById[1] = "HIGH"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "LOW"] = 3; - values[valuesById[4] = "LOWEST"] = 4; - return values; - })(); + CreateControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SearchMode enum. - * @name google.cloud.retail.v2alpha.SearchRequest.SearchMode - * @enum {number} - * @property {number} SEARCH_MODE_UNSPECIFIED=0 SEARCH_MODE_UNSPECIFIED value - * @property {number} PRODUCT_SEARCH_ONLY=1 PRODUCT_SEARCH_ONLY value - * @property {number} FACETED_SEARCH_ONLY=2 FACETED_SEARCH_ONLY value + * Gets the default type url for CreateControlRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - SearchRequest.SearchMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEARCH_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRODUCT_SEARCH_ONLY"] = 1; - values[valuesById[2] = "FACETED_SEARCH_ONLY"] = 2; - return values; - })(); + CreateControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateControlRequest"; + }; - return SearchRequest; + return CreateControlRequest; })(); - v2alpha.SearchResponse = (function() { + v2alpha.UpdateControlRequest = (function() { /** - * Properties of a SearchResponse. + * Properties of an UpdateControlRequest. * @memberof google.cloud.retail.v2alpha - * @interface ISearchResponse - * @property {Array.|null} [results] SearchResponse results - * @property {Array.|null} [facets] SearchResponse facets - * @property {number|null} [totalSize] SearchResponse totalSize - * @property {string|null} [correctedQuery] SearchResponse correctedQuery - * @property {string|null} [attributionToken] SearchResponse attributionToken - * @property {string|null} [nextPageToken] SearchResponse nextPageToken - * @property {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null} [queryExpansionInfo] SearchResponse queryExpansionInfo - * @property {string|null} [redirectUri] SearchResponse redirectUri - * @property {Array.|null} [appliedControls] SearchResponse appliedControls - * @property {Array.|null} [invalidConditionBoostSpecs] SearchResponse invalidConditionBoostSpecs - * @property {Array.|null} [experimentInfo] SearchResponse experimentInfo + * @interface IUpdateControlRequest + * @property {google.cloud.retail.v2alpha.IControl|null} [control] UpdateControlRequest control + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateControlRequest updateMask */ /** - * Constructs a new SearchResponse. + * Constructs a new UpdateControlRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SearchResponse. - * @implements ISearchResponse + * @classdesc Represents an UpdateControlRequest. + * @implements IUpdateControlRequest * @constructor - * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest=} [properties] Properties to set */ - function SearchResponse(properties) { - this.results = []; - this.facets = []; - this.appliedControls = []; - this.invalidConditionBoostSpecs = []; - this.experimentInfo = []; + function UpdateControlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -74763,230 +85520,514 @@ } /** - * SearchResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2alpha.SearchResponse + * UpdateControlRequest control. + * @member {google.cloud.retail.v2alpha.IControl|null|undefined} control + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest * @instance */ - SearchResponse.prototype.results = $util.emptyArray; + UpdateControlRequest.prototype.control = null; /** - * SearchResponse facets. - * @member {Array.} facets - * @memberof google.cloud.retail.v2alpha.SearchResponse + * UpdateControlRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest * @instance */ - SearchResponse.prototype.facets = $util.emptyArray; + UpdateControlRequest.prototype.updateMask = null; /** - * SearchResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Creates a new UpdateControlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest instance */ - SearchResponse.prototype.totalSize = 0; + UpdateControlRequest.create = function create(properties) { + return new UpdateControlRequest(properties); + }; /** - * SearchResponse correctedQuery. - * @member {string} correctedQuery - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchResponse.prototype.correctedQuery = ""; + UpdateControlRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.control != null && Object.hasOwnProperty.call(message, "control")) + $root.google.cloud.retail.v2alpha.Control.encode(message.control, 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; + }; /** - * SearchResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SearchResponse.prototype.attributionToken = ""; + UpdateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * SearchResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Decodes an UpdateControlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.prototype.nextPageToken = ""; + UpdateControlRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateControlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.control = $root.google.cloud.retail.v2alpha.Control.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; + }; /** - * SearchResponse queryExpansionInfo. - * @member {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo|null|undefined} queryExpansionInfo - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.prototype.queryExpansionInfo = null; + UpdateControlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * SearchResponse redirectUri. - * @member {string} redirectUri - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Verifies an UpdateControlRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.prototype.redirectUri = ""; + UpdateControlRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.control != null && message.hasOwnProperty("control")) { + var error = $root.google.cloud.retail.v2alpha.Control.verify(message.control); + if (error) + return "control." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; /** - * SearchResponse appliedControls. - * @member {Array.} appliedControls - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance + * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest */ - SearchResponse.prototype.appliedControls = $util.emptyArray; + UpdateControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateControlRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.UpdateControlRequest(); + if (object.control != null) { + if (typeof object.control !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateControlRequest.control: object expected"); + message.control = $root.google.cloud.retail.v2alpha.Control.fromObject(object.control); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateControlRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * SearchResponse invalidConditionBoostSpecs. - * @member {Array.} invalidConditionBoostSpecs - * @memberof google.cloud.retail.v2alpha.SearchResponse + * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {google.cloud.retail.v2alpha.UpdateControlRequest} message UpdateControlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateControlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.control = null; + object.updateMask = null; + } + if (message.control != null && message.hasOwnProperty("control")) + object.control = $root.google.cloud.retail.v2alpha.Control.toObject(message.control, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateControlRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest * @instance + * @returns {Object.} JSON object */ - SearchResponse.prototype.invalidConditionBoostSpecs = $util.emptyArray; + UpdateControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SearchResponse experimentInfo. - * @member {Array.} experimentInfo - * @memberof google.cloud.retail.v2alpha.SearchResponse + * Gets the default type url for UpdateControlRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateControlRequest"; + }; + + return UpdateControlRequest; + })(); + + v2alpha.DeleteControlRequest = (function() { + + /** + * Properties of a DeleteControlRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IDeleteControlRequest + * @property {string|null} [name] DeleteControlRequest name + */ + + /** + * Constructs a new DeleteControlRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a DeleteControlRequest. + * @implements IDeleteControlRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest=} [properties] Properties to set + */ + function DeleteControlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteControlRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest * @instance */ - SearchResponse.prototype.experimentInfo = $util.emptyArray; + DeleteControlRequest.prototype.name = ""; /** - * Creates a new SearchResponse instance using the specified properties. + * Creates a new DeleteControlRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse instance + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest instance */ - SearchResponse.create = function create(properties) { - return new SearchResponse(properties); + DeleteControlRequest.create = function create(properties) { + return new DeleteControlRequest(properties); }; /** - * Encodes the specified SearchResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encode = function encode(message, writer) { + DeleteControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.facets != null && message.facets.length) - for (var i = 0; i < message.facets.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.Facet.encode(message.facets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); - if (message.correctedQuery != null && Object.hasOwnProperty.call(message, "correctedQuery")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.correctedQuery); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.attributionToken); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.nextPageToken); - if (message.queryExpansionInfo != null && Object.hasOwnProperty.call(message, "queryExpansionInfo")) - $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.encode(message.queryExpansionInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.redirectUri != null && Object.hasOwnProperty.call(message, "redirectUri")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.redirectUri); - if (message.appliedControls != null && message.appliedControls.length) - for (var i = 0; i < message.appliedControls.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.appliedControls[i]); - if (message.invalidConditionBoostSpecs != null && message.invalidConditionBoostSpecs.length) - for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) - $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.encode(message.invalidConditionBoostSpecs[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.experimentInfo != null && message.experimentInfo.length) - for (var i = 0; i < message.experimentInfo.length; ++i) - $root.google.cloud.retail.v2alpha.ExperimentInfo.encode(message.experimentInfo[i], writer.uint32(/* id 17, wireType 2 =*/138).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 SearchResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.verify|verify} messages. + * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest * @static - * @param {google.cloud.retail.v2alpha.ISearchResponse} message SearchResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchResponse message from the specified reader or buffer. + * Decodes a DeleteControlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decode = function decode(reader, length) { + DeleteControlRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteControlRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.facets && message.facets.length)) - message.facets = []; - message.facets.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.decode(reader, reader.uint32())); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - case 4: { - message.correctedQuery = reader.string(); - break; - } - case 5: { - message.attributionToken = reader.string(); - break; - } - case 6: { - message.nextPageToken = reader.string(); - break; - } - case 7: { - message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.decode(reader, reader.uint32()); - break; - } - case 10: { - message.redirectUri = reader.string(); - break; - } - case 12: { - if (!(message.appliedControls && message.appliedControls.length)) - message.appliedControls = []; - message.appliedControls.push(reader.string()); - break; - } - case 14: { - if (!(message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length)) - message.invalidConditionBoostSpecs = []; - message.invalidConditionBoostSpecs.push($root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.decode(reader, reader.uint32())); + message.name = reader.string(); break; } - case 17: { - if (!(message.experimentInfo && message.experimentInfo.length)) - message.experimentInfo = []; - message.experimentInfo.push($root.google.cloud.retail.v2alpha.ExperimentInfo.decode(reader, reader.uint32())); + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteControlRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteControlRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteControlRequest.verify = function verify(message) { + if (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 DeleteControlRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest + */ + DeleteControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.DeleteControlRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.DeleteControlRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @static + * @param {google.cloud.retail.v2alpha.DeleteControlRequest} message DeleteControlRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteControlRequest.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 DeleteControlRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteControlRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteControlRequest"; + }; + + return DeleteControlRequest; + })(); + + v2alpha.GetControlRequest = (function() { + + /** + * Properties of a GetControlRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IGetControlRequest + * @property {string|null} [name] GetControlRequest name + */ + + /** + * Constructs a new GetControlRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a GetControlRequest. + * @implements IGetControlRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IGetControlRequest=} [properties] Properties to set + */ + function GetControlRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetControlRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @instance + */ + GetControlRequest.prototype.name = ""; + + /** + * Creates a new GetControlRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetControlRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest instance + */ + GetControlRequest.create = function create(properties) { + return new GetControlRequest(properties); + }; + + /** + * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetControlRequest} message GetControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetControlRequest.encode = function encode(message, writer) { + 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 GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @static + * @param {google.cloud.retail.v2alpha.IGetControlRequest} message GetControlRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetControlRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetControlRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetControlRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); break; } default: @@ -74998,1571 +86039,653 @@ }; /** - * Decodes a SearchResponse message from the specified reader or buffer, length delimited. + * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.GetControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchResponse.decodeDelimited = function decodeDelimited(reader) { + GetControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchResponse message. + * Verifies a GetControlRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.GetControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchResponse.verify = function verify(message) { + GetControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify(message.results[i]); - if (error) - return "results." + error; - } - } - if (message.facets != null && message.hasOwnProperty("facets")) { - if (!Array.isArray(message.facets)) - return "facets: array expected"; - for (var i = 0; i < message.facets.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.verify(message.facets[i]); - if (error) - return "facets." + error; - } - } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - if (!$util.isString(message.correctedQuery)) - return "correctedQuery: string expected"; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) { - var error = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify(message.queryExpansionInfo); - if (error) - return "queryExpansionInfo." + error; - } - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - if (!$util.isString(message.redirectUri)) - return "redirectUri: string expected"; - if (message.appliedControls != null && message.hasOwnProperty("appliedControls")) { - if (!Array.isArray(message.appliedControls)) - return "appliedControls: array expected"; - for (var i = 0; i < message.appliedControls.length; ++i) - if (!$util.isString(message.appliedControls[i])) - return "appliedControls: string[] expected"; - } - if (message.invalidConditionBoostSpecs != null && message.hasOwnProperty("invalidConditionBoostSpecs")) { - if (!Array.isArray(message.invalidConditionBoostSpecs)) - return "invalidConditionBoostSpecs: array expected"; - for (var i = 0; i < message.invalidConditionBoostSpecs.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.verify(message.invalidConditionBoostSpecs[i]); - if (error) - return "invalidConditionBoostSpecs." + error; - } - } - if (message.experimentInfo != null && message.hasOwnProperty("experimentInfo")) { - if (!Array.isArray(message.experimentInfo)) - return "experimentInfo: array expected"; - for (var i = 0; i < message.experimentInfo.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.ExperimentInfo.verify(message.experimentInfo[i]); - if (error) - return "experimentInfo." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SearchResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.GetControlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse} SearchResponse + * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest */ - SearchResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse) + GetControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetControlRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.fromObject(object.results[i]); - } - } - if (object.facets) { - if (!Array.isArray(object.facets)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: array expected"); - message.facets = []; - for (var i = 0; i < object.facets.length; ++i) { - if (typeof object.facets[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.facets: object expected"); - message.facets[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.fromObject(object.facets[i]); - } - } - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - if (object.correctedQuery != null) - message.correctedQuery = String(object.correctedQuery); - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.queryExpansionInfo != null) { - if (typeof object.queryExpansionInfo !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.queryExpansionInfo: object expected"); - message.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.fromObject(object.queryExpansionInfo); - } - if (object.redirectUri != null) - message.redirectUri = String(object.redirectUri); - if (object.appliedControls) { - if (!Array.isArray(object.appliedControls)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.appliedControls: array expected"); - message.appliedControls = []; - for (var i = 0; i < object.appliedControls.length; ++i) - message.appliedControls[i] = String(object.appliedControls[i]); - } - if (object.invalidConditionBoostSpecs) { - if (!Array.isArray(object.invalidConditionBoostSpecs)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.invalidConditionBoostSpecs: array expected"); - message.invalidConditionBoostSpecs = []; - for (var i = 0; i < object.invalidConditionBoostSpecs.length; ++i) { - if (typeof object.invalidConditionBoostSpecs[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.invalidConditionBoostSpecs: object expected"); - message.invalidConditionBoostSpecs[i] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.fromObject(object.invalidConditionBoostSpecs[i]); - } - } - if (object.experimentInfo) { - if (!Array.isArray(object.experimentInfo)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.experimentInfo: array expected"); - message.experimentInfo = []; - for (var i = 0; i < object.experimentInfo.length; ++i) { - if (typeof object.experimentInfo[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.experimentInfo: object expected"); - message.experimentInfo[i] = $root.google.cloud.retail.v2alpha.ExperimentInfo.fromObject(object.experimentInfo[i]); - } - } + var message = new $root.google.cloud.retail.v2alpha.GetControlRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SearchResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse + * @memberof google.cloud.retail.v2alpha.GetControlRequest * @static - * @param {google.cloud.retail.v2alpha.SearchResponse} message SearchResponse + * @param {google.cloud.retail.v2alpha.GetControlRequest} message GetControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchResponse.toObject = function toObject(message, options) { + GetControlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.facets = []; - object.appliedControls = []; - object.invalidConditionBoostSpecs = []; - object.experimentInfo = []; - } - if (options.defaults) { - object.totalSize = 0; - object.correctedQuery = ""; - object.attributionToken = ""; - object.nextPageToken = ""; - object.queryExpansionInfo = null; - object.redirectUri = ""; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult.toObject(message.results[j], options); - } - if (message.facets && message.facets.length) { - object.facets = []; - for (var j = 0; j < message.facets.length; ++j) - object.facets[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.toObject(message.facets[j], options); - } - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - if (message.correctedQuery != null && message.hasOwnProperty("correctedQuery")) - object.correctedQuery = message.correctedQuery; - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.queryExpansionInfo != null && message.hasOwnProperty("queryExpansionInfo")) - object.queryExpansionInfo = $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.toObject(message.queryExpansionInfo, options); - if (message.redirectUri != null && message.hasOwnProperty("redirectUri")) - object.redirectUri = message.redirectUri; - if (message.appliedControls && message.appliedControls.length) { - object.appliedControls = []; - for (var j = 0; j < message.appliedControls.length; ++j) - object.appliedControls[j] = message.appliedControls[j]; - } - if (message.invalidConditionBoostSpecs && message.invalidConditionBoostSpecs.length) { - object.invalidConditionBoostSpecs = []; - for (var j = 0; j < message.invalidConditionBoostSpecs.length; ++j) - object.invalidConditionBoostSpecs[j] = $root.google.cloud.retail.v2alpha.SearchRequest.BoostSpec.ConditionBoostSpec.toObject(message.invalidConditionBoostSpecs[j], options); - } - if (message.experimentInfo && message.experimentInfo.length) { - object.experimentInfo = []; - for (var j = 0; j < message.experimentInfo.length; ++j) - object.experimentInfo[j] = $root.google.cloud.retail.v2alpha.ExperimentInfo.toObject(message.experimentInfo[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SearchResponse to JSON. + * Converts this GetControlRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @instance - * @returns {Object.} JSON object - */ - SearchResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchResponse - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse"; - }; - - SearchResponse.SearchResult = (function() { - - /** - * Properties of a SearchResult. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface ISearchResult - * @property {string|null} [id] SearchResult id - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] SearchResult product - * @property {number|null} [matchingVariantCount] SearchResult matchingVariantCount - * @property {Object.|null} [matchingVariantFields] SearchResult matchingVariantFields - * @property {Object.|null} [variantRollupValues] SearchResult variantRollupValues - * @property {Array.|null} [personalLabels] SearchResult personalLabels - */ - - /** - * Constructs a new SearchResult. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a SearchResult. - * @implements ISearchResult - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set - */ - function SearchResult(properties) { - this.matchingVariantFields = {}; - this.variantRollupValues = {}; - this.personalLabels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SearchResult id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.id = ""; - - /** - * SearchResult product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.product = null; - - /** - * SearchResult matchingVariantCount. - * @member {number} matchingVariantCount - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantCount = 0; - - /** - * SearchResult matchingVariantFields. - * @member {Object.} matchingVariantFields - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.matchingVariantFields = $util.emptyObject; - - /** - * SearchResult variantRollupValues. - * @member {Object.} variantRollupValues - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.variantRollupValues = $util.emptyObject; - - /** - * SearchResult personalLabels. - * @member {Array.} personalLabels - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - */ - SearchResult.prototype.personalLabels = $util.emptyArray; - - /** - * Creates a new SearchResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult instance - */ - SearchResult.create = function create(properties) { - return new SearchResult(properties); - }; - - /** - * Encodes the specified SearchResult message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.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.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.matchingVariantCount != null && Object.hasOwnProperty.call(message, "matchingVariantCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.matchingVariantCount); - if (message.matchingVariantFields != null && Object.hasOwnProperty.call(message, "matchingVariantFields")) - for (var keys = Object.keys(message.matchingVariantFields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.FieldMask.encode(message.matchingVariantFields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.variantRollupValues != null && Object.hasOwnProperty.call(message, "variantRollupValues")) - for (var keys = Object.keys(message.variantRollupValues), 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.protobuf.Value.encode(message.variantRollupValues[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.personalLabels != null && message.personalLabels.length) - for (var i = 0; i < message.personalLabels.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.personalLabels[i]); - return writer; - }; - - /** - * Encodes the specified SearchResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.SearchResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.ISearchResult} message SearchResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SearchResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SearchResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); - break; - } - case 3: { - message.matchingVariantCount = reader.int32(); - break; - } - case 4: { - if (message.matchingVariantFields === $util.emptyObject) - message.matchingVariantFields = {}; - 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.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.matchingVariantFields[key] = value; - break; - } - case 5: { - if (message.variantRollupValues === $util.emptyObject) - message.variantRollupValues = {}; - 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.variantRollupValues[key] = value; - break; - } - case 7: { - if (!(message.personalLabels && message.personalLabels.length)) - message.personalLabels = []; - message.personalLabels.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SearchResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SearchResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SearchResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SearchResult.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.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - if (!$util.isInteger(message.matchingVariantCount)) - return "matchingVariantCount: integer expected"; - if (message.matchingVariantFields != null && message.hasOwnProperty("matchingVariantFields")) { - if (!$util.isObject(message.matchingVariantFields)) - return "matchingVariantFields: object expected"; - var key = Object.keys(message.matchingVariantFields); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.FieldMask.verify(message.matchingVariantFields[key[i]]); - if (error) - return "matchingVariantFields." + error; - } - } - if (message.variantRollupValues != null && message.hasOwnProperty("variantRollupValues")) { - if (!$util.isObject(message.variantRollupValues)) - return "variantRollupValues: object expected"; - var key = Object.keys(message.variantRollupValues); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.protobuf.Value.verify(message.variantRollupValues[key[i]]); - if (error) - return "variantRollupValues." + error; - } - } - if (message.personalLabels != null && message.hasOwnProperty("personalLabels")) { - if (!Array.isArray(message.personalLabels)) - return "personalLabels: array expected"; - for (var i = 0; i < message.personalLabels.length; ++i) - if (!$util.isString(message.personalLabels[i])) - return "personalLabels: string[] expected"; - } - return null; - }; - - /** - * Creates a SearchResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.SearchResult} SearchResult - */ - SearchResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.SearchResult(); - if (object.id != null) - message.id = String(object.id); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); - } - if (object.matchingVariantCount != null) - message.matchingVariantCount = object.matchingVariantCount | 0; - if (object.matchingVariantFields) { - if (typeof object.matchingVariantFields !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields = {}; - for (var keys = Object.keys(object.matchingVariantFields), i = 0; i < keys.length; ++i) { - if (typeof object.matchingVariantFields[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.matchingVariantFields: object expected"); - message.matchingVariantFields[keys[i]] = $root.google.protobuf.FieldMask.fromObject(object.matchingVariantFields[keys[i]]); - } - } - if (object.variantRollupValues) { - if (typeof object.variantRollupValues !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues = {}; - for (var keys = Object.keys(object.variantRollupValues), i = 0; i < keys.length; ++i) { - if (typeof object.variantRollupValues[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.variantRollupValues: object expected"); - message.variantRollupValues[keys[i]] = $root.google.protobuf.Value.fromObject(object.variantRollupValues[keys[i]]); - } - } - if (object.personalLabels) { - if (!Array.isArray(object.personalLabels)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.SearchResult.personalLabels: array expected"); - message.personalLabels = []; - for (var i = 0; i < object.personalLabels.length; ++i) - message.personalLabels[i] = String(object.personalLabels[i]); - } - return message; - }; - - /** - * Creates a plain object from a SearchResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.SearchResult} message SearchResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SearchResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.personalLabels = []; - if (options.objects || options.defaults) { - object.matchingVariantFields = {}; - object.variantRollupValues = {}; - } - if (options.defaults) { - object.id = ""; - object.product = null; - object.matchingVariantCount = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.matchingVariantCount != null && message.hasOwnProperty("matchingVariantCount")) - object.matchingVariantCount = message.matchingVariantCount; - var keys2; - if (message.matchingVariantFields && (keys2 = Object.keys(message.matchingVariantFields)).length) { - object.matchingVariantFields = {}; - for (var j = 0; j < keys2.length; ++j) - object.matchingVariantFields[keys2[j]] = $root.google.protobuf.FieldMask.toObject(message.matchingVariantFields[keys2[j]], options); - } - if (message.variantRollupValues && (keys2 = Object.keys(message.variantRollupValues)).length) { - object.variantRollupValues = {}; - for (var j = 0; j < keys2.length; ++j) - object.variantRollupValues[keys2[j]] = $root.google.protobuf.Value.toObject(message.variantRollupValues[keys2[j]], options); - } - if (message.personalLabels && message.personalLabels.length) { - object.personalLabels = []; - for (var j = 0; j < message.personalLabels.length; ++j) - object.personalLabels[j] = message.personalLabels[j]; - } - return object; - }; - - /** - * Converts this SearchResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @instance - * @returns {Object.} JSON object - */ - SearchResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SearchResult - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchResponse.SearchResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.SearchResult"; - }; - - return SearchResult; - })(); - - SearchResponse.Facet = (function() { - - /** - * Properties of a Facet. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface IFacet - * @property {string|null} [key] Facet key - * @property {Array.|null} [values] Facet values - * @property {boolean|null} [dynamicFacet] Facet dynamicFacet - */ - - /** - * Constructs a new Facet. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a Facet. - * @implements IFacet - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set - */ - function Facet(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]]; - } - - /** - * Facet key. - * @member {string} key - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.key = ""; - - /** - * Facet values. - * @member {Array.} values - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.values = $util.emptyArray; - - /** - * Facet dynamicFacet. - * @member {boolean} dynamicFacet - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - */ - Facet.prototype.dynamicFacet = false; - - /** - * Creates a new Facet instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet instance - */ - Facet.create = function create(properties) { - return new Facet(properties); - }; - - /** - * Encodes the specified Facet message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.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.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dynamicFacet != null && Object.hasOwnProperty.call(message, "dynamicFacet")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamicFacet); - return writer; - }; - - /** - * Encodes the specified Facet message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IFacet} message Facet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Facet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Facet message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.key = reader.string(); - break; - } - case 2: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.decode(reader, reader.uint32())); - break; - } - case 3: { - message.dynamicFacet = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Facet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Facet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Facet message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Facet.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.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.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - if (typeof message.dynamicFacet !== "boolean") - return "dynamicFacet: boolean expected"; - return null; - }; - - /** - * Creates a Facet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet} Facet - */ - Facet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet(); - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.values: object expected"); - message.values[i] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.fromObject(object.values[i]); - } - } - if (object.dynamicFacet != null) - message.dynamicFacet = Boolean(object.dynamicFacet); - return message; - }; - - /** - * Creates a plain object from a Facet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet} message Facet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Facet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.key = ""; - object.dynamicFacet = false; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.toObject(message.values[j], options); - } - if (message.dynamicFacet != null && message.hasOwnProperty("dynamicFacet")) - object.dynamicFacet = message.dynamicFacet; - return object; - }; - - /** - * Converts this Facet to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @instance - * @returns {Object.} JSON object - */ - Facet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Facet - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Facet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.Facet"; - }; - - Facet.FacetValue = (function() { - - /** - * Properties of a FacetValue. - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @interface IFacetValue - * @property {string|null} [value] FacetValue value - * @property {google.cloud.retail.v2alpha.IInterval|null} [interval] FacetValue interval - * @property {number|Long|null} [count] FacetValue count - * @property {number|null} [minValue] FacetValue minValue - * @property {number|null} [maxValue] FacetValue maxValue - */ - - /** - * Constructs a new FacetValue. - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet - * @classdesc Represents a FacetValue. - * @implements IFacetValue - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - */ - function FacetValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FacetValue value. - * @member {string|null|undefined} value - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.value = null; + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @instance + * @returns {Object.} JSON object + */ + GetControlRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FacetValue interval. - * @member {google.cloud.retail.v2alpha.IInterval|null|undefined} interval - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.interval = null; + /** + * Gets the default type url for GetControlRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetControlRequest"; + }; - /** - * FacetValue count. - * @member {number|Long} count - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + return GetControlRequest; + })(); - /** - * FacetValue minValue. - * @member {number} minValue - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.minValue = 0; + v2alpha.ListControlsRequest = (function() { - /** - * FacetValue maxValue. - * @member {number} maxValue - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - FacetValue.prototype.maxValue = 0; + /** + * Properties of a ListControlsRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IListControlsRequest + * @property {string|null} [parent] ListControlsRequest parent + * @property {number|null} [pageSize] ListControlsRequest pageSize + * @property {string|null} [pageToken] ListControlsRequest pageToken + * @property {string|null} [filter] ListControlsRequest filter + */ - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Constructs a new ListControlsRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListControlsRequest. + * @implements IListControlsRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IListControlsRequest=} [properties] Properties to set + */ + function ListControlsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FacetValue facetValue. - * @member {"value"|"interval"|undefined} facetValue - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - */ - Object.defineProperty(FacetValue.prototype, "facetValue", { - get: $util.oneOfGetter($oneOfFields = ["value", "interval"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ListControlsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @instance + */ + ListControlsRequest.prototype.parent = ""; - /** - * Creates a new FacetValue instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue instance - */ - FacetValue.create = function create(properties) { - return new FacetValue(properties); - }; + /** + * ListControlsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @instance + */ + ListControlsRequest.prototype.pageSize = 0; - /** - * Encodes the specified FacetValue message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.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.interval != null && Object.hasOwnProperty.call(message, "interval")) - $root.google.cloud.retail.v2alpha.Interval.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.minValue); - if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.maxValue); - return writer; - }; + /** + * ListControlsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @instance + */ + ListControlsRequest.prototype.pageToken = ""; - /** - * Encodes the specified FacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.IFacetValue} message FacetValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FacetValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListControlsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @instance + */ + ListControlsRequest.prototype.filter = ""; - /** - * Decodes a FacetValue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.interval = $root.google.cloud.retail.v2alpha.Interval.decode(reader, reader.uint32()); - break; - } - case 3: { - message.count = reader.int64(); - break; - } - case 5: { - message.minValue = reader.double(); - break; - } - case 6: { - message.maxValue = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new ListControlsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {google.cloud.retail.v2alpha.IListControlsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest instance + */ + ListControlsRequest.create = function create(properties) { + return new ListControlsRequest(properties); + }; - /** - * Decodes a FacetValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FacetValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {google.cloud.retail.v2alpha.IListControlsRequest} message ListControlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListControlsRequest.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; + }; - /** - * Verifies a FacetValue message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FacetValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.facetValue = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.interval != null && message.hasOwnProperty("interval")) { - if (properties.facetValue === 1) - return "facetValue: multiple values"; - properties.facetValue = 1; - { - var error = $root.google.cloud.retail.v2alpha.Interval.verify(message.interval); - if (error) - return "interval." + error; - } - } - 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"; - if (message.minValue != null && message.hasOwnProperty("minValue")) - if (typeof message.minValue !== "number") - return "minValue: number expected"; - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - if (typeof message.maxValue !== "number") - return "maxValue: number expected"; - return null; - }; + /** + * Encodes the specified ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {google.cloud.retail.v2alpha.IListControlsRequest} message ListControlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListControlsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a FacetValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} FacetValue - */ - FacetValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue(); - if (object.value != null) - message.value = String(object.value); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue.interval: object expected"); - message.interval = $root.google.cloud.retail.v2alpha.Interval.fromObject(object.interval); + /** + * Decodes a ListControlsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListControlsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; } - 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(); - if (object.minValue != null) - message.minValue = Number(object.minValue); - if (object.maxValue != null) - message.maxValue = Number(object.maxValue); - return message; - }; - - /** - * Creates a plain object from a FacetValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue} message FacetValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FacetValue.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.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.minValue = 0; - object.maxValue = 0; + case 2: { + message.pageSize = reader.int32(); + break; } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.facetValue = "value"; + case 3: { + message.pageToken = reader.string(); + break; } - if (message.interval != null && message.hasOwnProperty("interval")) { - object.interval = $root.google.cloud.retail.v2alpha.Interval.toObject(message.interval, options); - if (options.oneofs) - object.facetValue = "interval"; + case 4: { + message.filter = reader.string(); + break; } - 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; - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = options.json && !isFinite(message.minValue) ? String(message.minValue) : message.minValue; - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = options.json && !isFinite(message.maxValue) ? String(message.maxValue) : message.maxValue; - return object; - }; - - /** - * Converts this FacetValue to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @instance - * @returns {Object.} JSON object - */ - FacetValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Gets the default type url for FacetValue - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.Facet.FacetValue"; - }; + /** + * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return FacetValue; - })(); + /** + * Verifies a ListControlsRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListControlsRequest.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; + }; - return Facet; - })(); + /** + * Creates a ListControlsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest + */ + ListControlsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListControlsRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.ListControlsRequest(); + 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; + }; - SearchResponse.QueryExpansionInfo = (function() { + /** + * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {google.cloud.retail.v2alpha.ListControlsRequest} message ListControlsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListControlsRequest.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; + }; - /** - * Properties of a QueryExpansionInfo. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @interface IQueryExpansionInfo - * @property {boolean|null} [expandedQuery] QueryExpansionInfo expandedQuery - * @property {number|Long|null} [pinnedResultCount] QueryExpansionInfo pinnedResultCount - */ + /** + * Converts this ListControlsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @instance + * @returns {Object.} JSON object + */ + ListControlsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new QueryExpansionInfo. - * @memberof google.cloud.retail.v2alpha.SearchResponse - * @classdesc Represents a QueryExpansionInfo. - * @implements IQueryExpansionInfo - * @constructor - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - */ - function QueryExpansionInfo(properties) { - if (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 ListControlsRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ListControlsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListControlsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListControlsRequest"; + }; - /** - * QueryExpansionInfo expandedQuery. - * @member {boolean} expandedQuery - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.expandedQuery = false; + return ListControlsRequest; + })(); - /** - * QueryExpansionInfo pinnedResultCount. - * @member {number|Long} pinnedResultCount - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - */ - QueryExpansionInfo.prototype.pinnedResultCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + v2alpha.ListControlsResponse = (function() { - /** - * Creates a new QueryExpansionInfo instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo instance - */ - QueryExpansionInfo.create = function create(properties) { - return new QueryExpansionInfo(properties); - }; + /** + * Properties of a ListControlsResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IListControlsResponse + * @property {Array.|null} [controls] ListControlsResponse controls + * @property {string|null} [nextPageToken] ListControlsResponse nextPageToken + */ - /** - * Encodes the specified QueryExpansionInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expandedQuery != null && Object.hasOwnProperty.call(message, "expandedQuery")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandedQuery); - if (message.pinnedResultCount != null && Object.hasOwnProperty.call(message, "pinnedResultCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pinnedResultCount); - return writer; - }; + /** + * Constructs a new ListControlsResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListControlsResponse. + * @implements IListControlsResponse + * @constructor + * @param {google.cloud.retail.v2alpha.IListControlsResponse=} [properties] Properties to set + */ + function ListControlsResponse(properties) { + this.controls = []; + if (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 QueryExpansionInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.IQueryExpansionInfo} message QueryExpansionInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryExpansionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListControlsResponse controls. + * @member {Array.} controls + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @instance + */ + ListControlsResponse.prototype.controls = $util.emptyArray; - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.expandedQuery = reader.bool(); - break; - } - case 2: { - message.pinnedResultCount = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); + /** + * ListControlsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @instance + */ + ListControlsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListControlsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {google.cloud.retail.v2alpha.IListControlsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse instance + */ + ListControlsResponse.create = function create(properties) { + return new ListControlsResponse(properties); + }; + + /** + * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {google.cloud.retail.v2alpha.IListControlsResponse} message ListControlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListControlsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.controls != null && message.controls.length) + for (var i = 0; i < message.controls.length; ++i) + $root.google.cloud.retail.v2alpha.Control.encode(message.controls[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 ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {google.cloud.retail.v2alpha.IListControlsResponse} message ListControlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListControlsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListControlsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListControlsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.controls && message.controls.length)) + message.controls = []; + message.controls.push($root.google.cloud.retail.v2alpha.Control.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a QueryExpansionInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryExpansionInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryExpansionInfo message. - * @function verify - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryExpansionInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - if (typeof message.expandedQuery !== "boolean") - return "expandedQuery: boolean expected"; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (!$util.isInteger(message.pinnedResultCount) && !(message.pinnedResultCount && $util.isInteger(message.pinnedResultCount.low) && $util.isInteger(message.pinnedResultCount.high))) - return "pinnedResultCount: integer|Long expected"; - return null; - }; + } + return message; + }; - /** - * Creates a QueryExpansionInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} QueryExpansionInfo - */ - QueryExpansionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo) - return object; - var message = new $root.google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo(); - if (object.expandedQuery != null) - message.expandedQuery = Boolean(object.expandedQuery); - if (object.pinnedResultCount != null) - if ($util.Long) - (message.pinnedResultCount = $util.Long.fromValue(object.pinnedResultCount)).unsigned = false; - else if (typeof object.pinnedResultCount === "string") - message.pinnedResultCount = parseInt(object.pinnedResultCount, 10); - else if (typeof object.pinnedResultCount === "number") - message.pinnedResultCount = object.pinnedResultCount; - else if (typeof object.pinnedResultCount === "object") - message.pinnedResultCount = new $util.LongBits(object.pinnedResultCount.low >>> 0, object.pinnedResultCount.high >>> 0).toNumber(); - return message; - }; + /** + * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListControlsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a QueryExpansionInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo} message QueryExpansionInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryExpansionInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expandedQuery = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.pinnedResultCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.pinnedResultCount = options.longs === String ? "0" : 0; + /** + * Verifies a ListControlsResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListControlsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.controls != null && message.hasOwnProperty("controls")) { + if (!Array.isArray(message.controls)) + return "controls: array expected"; + for (var i = 0; i < message.controls.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Control.verify(message.controls[i]); + if (error) + return "controls." + error; } - if (message.expandedQuery != null && message.hasOwnProperty("expandedQuery")) - object.expandedQuery = message.expandedQuery; - if (message.pinnedResultCount != null && message.hasOwnProperty("pinnedResultCount")) - if (typeof message.pinnedResultCount === "number") - object.pinnedResultCount = options.longs === String ? String(message.pinnedResultCount) : message.pinnedResultCount; - else - object.pinnedResultCount = options.longs === String ? $util.Long.prototype.toString.call(message.pinnedResultCount) : options.longs === Number ? new $util.LongBits(message.pinnedResultCount.low >>> 0, message.pinnedResultCount.high >>> 0).toNumber() : message.pinnedResultCount; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse + */ + ListControlsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListControlsResponse) return object; - }; + var message = new $root.google.cloud.retail.v2alpha.ListControlsResponse(); + if (object.controls) { + if (!Array.isArray(object.controls)) + throw TypeError(".google.cloud.retail.v2alpha.ListControlsResponse.controls: array expected"); + message.controls = []; + for (var i = 0; i < object.controls.length; ++i) { + if (typeof object.controls[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListControlsResponse.controls: object expected"); + message.controls[i] = $root.google.cloud.retail.v2alpha.Control.fromObject(object.controls[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this QueryExpansionInfo to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @instance - * @returns {Object.} JSON object - */ - QueryExpansionInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListControlsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {google.cloud.retail.v2alpha.ListControlsResponse} message ListControlsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListControlsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.controls = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.controls && message.controls.length) { + object.controls = []; + for (var j = 0; j < message.controls.length; ++j) + object.controls[j] = $root.google.cloud.retail.v2alpha.Control.toObject(message.controls[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Gets the default type url for QueryExpansionInfo - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryExpansionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SearchResponse.QueryExpansionInfo"; - }; + /** + * Converts this ListControlsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @instance + * @returns {Object.} JSON object + */ + ListControlsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return QueryExpansionInfo; - })(); + /** + * Gets the default type url for ListControlsResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ListControlsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListControlsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListControlsResponse"; + }; - return SearchResponse; + return ListControlsResponse; })(); - v2alpha.ExperimentInfo = (function() { + v2alpha.MerchantCenterAccountLink = (function() { /** - * Properties of an ExperimentInfo. + * Properties of a MerchantCenterAccountLink. * @memberof google.cloud.retail.v2alpha - * @interface IExperimentInfo - * @property {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null} [servingConfigExperiment] ExperimentInfo servingConfigExperiment - * @property {string|null} [experiment] ExperimentInfo experiment + * @interface IMerchantCenterAccountLink + * @property {string|null} [name] MerchantCenterAccountLink name + * @property {string|null} [id] MerchantCenterAccountLink id + * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterAccountLink merchantCenterAccountId + * @property {string|null} [branchId] MerchantCenterAccountLink branchId + * @property {string|null} [feedLabel] MerchantCenterAccountLink feedLabel + * @property {string|null} [languageCode] MerchantCenterAccountLink languageCode + * @property {Array.|null} [feedFilters] MerchantCenterAccountLink feedFilters + * @property {google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|null} [state] MerchantCenterAccountLink state + * @property {string|null} [projectId] MerchantCenterAccountLink projectId + * @property {string|null} [source] MerchantCenterAccountLink source */ /** - * Constructs a new ExperimentInfo. + * Constructs a new MerchantCenterAccountLink. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an ExperimentInfo. - * @implements IExperimentInfo + * @classdesc Represents a MerchantCenterAccountLink. + * @implements IMerchantCenterAccountLink * @constructor - * @param {google.cloud.retail.v2alpha.IExperimentInfo=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink=} [properties] Properties to set */ - function ExperimentInfo(properties) { + function MerchantCenterAccountLink(properties) { + this.feedFilters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -76570,103 +86693,204 @@ } /** - * ExperimentInfo servingConfigExperiment. - * @member {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment|null|undefined} servingConfigExperiment - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * MerchantCenterAccountLink name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @instance */ - ExperimentInfo.prototype.servingConfigExperiment = null; + MerchantCenterAccountLink.prototype.name = ""; /** - * ExperimentInfo experiment. - * @member {string} experiment - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * MerchantCenterAccountLink id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @instance */ - ExperimentInfo.prototype.experiment = ""; + MerchantCenterAccountLink.prototype.id = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * MerchantCenterAccountLink merchantCenterAccountId. + * @member {number|Long} merchantCenterAccountId + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ExperimentInfo experimentMetadata. - * @member {"servingConfigExperiment"|undefined} experimentMetadata - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * MerchantCenterAccountLink branchId. + * @member {string} branchId + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @instance */ - Object.defineProperty(ExperimentInfo.prototype, "experimentMetadata", { - get: $util.oneOfGetter($oneOfFields = ["servingConfigExperiment"]), - set: $util.oneOfSetter($oneOfFields) - }); + MerchantCenterAccountLink.prototype.branchId = ""; /** - * Creates a new ExperimentInfo instance using the specified properties. + * MerchantCenterAccountLink feedLabel. + * @member {string} feedLabel + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.feedLabel = ""; + + /** + * MerchantCenterAccountLink languageCode. + * @member {string} languageCode + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.languageCode = ""; + + /** + * MerchantCenterAccountLink feedFilters. + * @member {Array.} feedFilters + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.feedFilters = $util.emptyArray; + + /** + * MerchantCenterAccountLink state. + * @member {google.cloud.retail.v2alpha.MerchantCenterAccountLink.State} state + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.state = 0; + + /** + * MerchantCenterAccountLink projectId. + * @member {string} projectId + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.projectId = ""; + + /** + * MerchantCenterAccountLink source. + * @member {string} source + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @instance + */ + MerchantCenterAccountLink.prototype.source = ""; + + /** + * Creates a new MerchantCenterAccountLink instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static - * @param {google.cloud.retail.v2alpha.IExperimentInfo=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo instance + * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink instance */ - ExperimentInfo.create = function create(properties) { - return new ExperimentInfo(properties); + MerchantCenterAccountLink.create = function create(properties) { + return new MerchantCenterAccountLink(properties); }; /** - * Encodes the specified ExperimentInfo message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * Encodes the specified MerchantCenterAccountLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static - * @param {google.cloud.retail.v2alpha.IExperimentInfo} message ExperimentInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink} message MerchantCenterAccountLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExperimentInfo.encode = function encode(message, writer) { + MerchantCenterAccountLink.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.experiment != null && Object.hasOwnProperty.call(message, "experiment")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.experiment); - if (message.servingConfigExperiment != null && Object.hasOwnProperty.call(message, "servingConfigExperiment")) - $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.encode(message.servingConfigExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.merchantCenterAccountId); + if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.branchId); + if (message.feedLabel != null && Object.hasOwnProperty.call(message, "feedLabel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.feedLabel); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + if (message.feedFilters != null && message.feedFilters.length) + for (var i = 0; i < message.feedFilters.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.encode(message.feedFilters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.id); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.projectId); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.source); return writer; }; /** - * Encodes the specified ExperimentInfo message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.verify|verify} messages. + * Encodes the specified MerchantCenterAccountLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static - * @param {google.cloud.retail.v2alpha.IExperimentInfo} message ExperimentInfo message or plain object to encode + * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink} message MerchantCenterAccountLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExperimentInfo.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterAccountLink.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExperimentInfo message from the specified reader or buffer. + * Decodes a MerchantCenterAccountLink message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExperimentInfo.decode = function decode(reader, length) { + MerchantCenterAccountLink.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExperimentInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.id = reader.string(); + break; + } case 2: { - message.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.decode(reader, reader.uint32()); + message.merchantCenterAccountId = reader.int64(); break; } - case 1: { - message.experiment = reader.string(); + case 3: { + message.branchId = reader.string(); + break; + } + case 4: { + message.feedLabel = reader.string(); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + case 6: { + if (!(message.feedFilters && message.feedFilters.length)) + message.feedFilters = []; + message.feedFilters.push($root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 9: { + message.projectId = reader.string(); + break; + } + case 10: { + message.source = reader.string(); break; } default: @@ -76678,139 +86902,254 @@ }; /** - * Decodes an ExperimentInfo message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterAccountLink message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExperimentInfo.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterAccountLink.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExperimentInfo message. + * Verifies a MerchantCenterAccountLink message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExperimentInfo.verify = function verify(message) { + MerchantCenterAccountLink.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.servingConfigExperiment != null && message.hasOwnProperty("servingConfigExperiment")) { - properties.experimentMetadata = 1; - { - var error = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify(message.servingConfigExperiment); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) + return "merchantCenterAccountId: integer|Long expected"; + if (message.branchId != null && message.hasOwnProperty("branchId")) + if (!$util.isString(message.branchId)) + return "branchId: string expected"; + if (message.feedLabel != null && message.hasOwnProperty("feedLabel")) + if (!$util.isString(message.feedLabel)) + return "feedLabel: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.feedFilters != null && message.hasOwnProperty("feedFilters")) { + if (!Array.isArray(message.feedFilters)) + return "feedFilters: array expected"; + for (var i = 0; i < message.feedFilters.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify(message.feedFilters[i]); if (error) - return "servingConfigExperiment." + error; + return "feedFilters." + error; } } - if (message.experiment != null && message.hasOwnProperty("experiment")) - if (!$util.isString(message.experiment)) - return "experiment: 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: + break; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; return null; }; /** - * Creates an ExperimentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterAccountLink message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExperimentInfo} ExperimentInfo + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink */ - ExperimentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExperimentInfo) + MerchantCenterAccountLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink) return object; - var message = new $root.google.cloud.retail.v2alpha.ExperimentInfo(); - if (object.servingConfigExperiment != null) { - if (typeof object.servingConfigExperiment !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ExperimentInfo.servingConfigExperiment: object expected"); - message.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.fromObject(object.servingConfigExperiment); + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.merchantCenterAccountId != null) + if ($util.Long) + (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; + else if (typeof object.merchantCenterAccountId === "string") + message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); + else if (typeof object.merchantCenterAccountId === "number") + message.merchantCenterAccountId = object.merchantCenterAccountId; + else if (typeof object.merchantCenterAccountId === "object") + message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); + if (object.branchId != null) + message.branchId = String(object.branchId); + if (object.feedLabel != null) + message.feedLabel = String(object.feedLabel); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.feedFilters) { + if (!Array.isArray(object.feedFilters)) + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterAccountLink.feedFilters: array expected"); + message.feedFilters = []; + for (var i = 0; i < object.feedFilters.length; ++i) { + if (typeof object.feedFilters[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterAccountLink.feedFilters: object expected"); + message.feedFilters[i] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.fromObject(object.feedFilters[i]); + } } - if (object.experiment != null) - message.experiment = String(object.experiment); + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.source != null) + message.source = String(object.source); return message; }; /** - * Creates a plain object from an ExperimentInfo message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterAccountLink message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static - * @param {google.cloud.retail.v2alpha.ExperimentInfo} message ExperimentInfo + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink} message MerchantCenterAccountLink * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExperimentInfo.toObject = function toObject(message, options) { + MerchantCenterAccountLink.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.experiment = ""; - if (message.experiment != null && message.hasOwnProperty("experiment")) - object.experiment = message.experiment; - if (message.servingConfigExperiment != null && message.hasOwnProperty("servingConfigExperiment")) { - object.servingConfigExperiment = $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.toObject(message.servingConfigExperiment, options); - if (options.oneofs) - object.experimentMetadata = "servingConfigExperiment"; + if (options.arrays || options.defaults) + object.feedFilters = []; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.merchantCenterAccountId = options.longs === String ? "0" : 0; + object.branchId = ""; + object.feedLabel = ""; + object.languageCode = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.id = ""; + object.projectId = ""; + object.source = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) + if (typeof message.merchantCenterAccountId === "number") + object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; + else + object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; + if (message.branchId != null && message.hasOwnProperty("branchId")) + object.branchId = message.branchId; + if (message.feedLabel != null && message.hasOwnProperty("feedLabel")) + object.feedLabel = message.feedLabel; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.feedFilters && message.feedFilters.length) { + object.feedFilters = []; + for (var j = 0; j < message.feedFilters.length; ++j) + object.feedFilters[j] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.toObject(message.feedFilters[j], options); } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.State[message.state] === undefined ? message.state : $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.State[message.state] : message.state; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; return object; }; /** - * Converts this ExperimentInfo to JSON. + * Converts this MerchantCenterAccountLink to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @instance * @returns {Object.} JSON object */ - ExperimentInfo.prototype.toJSON = function toJSON() { + MerchantCenterAccountLink.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExperimentInfo + * Gets the default type url for MerchantCenterAccountLink * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ExperimentInfo + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExperimentInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MerchantCenterAccountLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ExperimentInfo"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterAccountLink"; }; - ExperimentInfo.ServingConfigExperiment = (function() { + MerchantCenterAccountLink.MerchantCenterFeedFilter = (function() { /** - * Properties of a ServingConfigExperiment. - * @memberof google.cloud.retail.v2alpha.ExperimentInfo - * @interface IServingConfigExperiment - * @property {string|null} [originalServingConfig] ServingConfigExperiment originalServingConfig - * @property {string|null} [experimentServingConfig] ServingConfigExperiment experimentServingConfig + * Properties of a MerchantCenterFeedFilter. + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @interface IMerchantCenterFeedFilter + * @property {number|Long|null} [primaryFeedId] MerchantCenterFeedFilter primaryFeedId + * @property {string|null} [primaryFeedName] MerchantCenterFeedFilter primaryFeedName */ /** - * Constructs a new ServingConfigExperiment. - * @memberof google.cloud.retail.v2alpha.ExperimentInfo - * @classdesc Represents a ServingConfigExperiment. - * @implements IServingConfigExperiment + * Constructs a new MerchantCenterFeedFilter. + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink + * @classdesc Represents a MerchantCenterFeedFilter. + * @implements IMerchantCenterFeedFilter * @constructor - * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter=} [properties] Properties to set */ - function ServingConfigExperiment(properties) { + function MerchantCenterFeedFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -76818,89 +87157,89 @@ } /** - * ServingConfigExperiment originalServingConfig. - * @member {string} originalServingConfig - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * MerchantCenterFeedFilter primaryFeedId. + * @member {number|Long} primaryFeedId + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @instance */ - ServingConfigExperiment.prototype.originalServingConfig = ""; + MerchantCenterFeedFilter.prototype.primaryFeedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ServingConfigExperiment experimentServingConfig. - * @member {string} experimentServingConfig - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * MerchantCenterFeedFilter primaryFeedName. + * @member {string} primaryFeedName + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @instance */ - ServingConfigExperiment.prototype.experimentServingConfig = ""; + MerchantCenterFeedFilter.prototype.primaryFeedName = ""; /** - * Creates a new ServingConfigExperiment instance using the specified properties. + * Creates a new MerchantCenterFeedFilter instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment instance + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter instance */ - ServingConfigExperiment.create = function create(properties) { - return new ServingConfigExperiment(properties); + MerchantCenterFeedFilter.create = function create(properties) { + return new MerchantCenterFeedFilter(properties); }; /** - * Encodes the specified ServingConfigExperiment message. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. + * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment} message ServingConfigExperiment message or plain object to encode + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServingConfigExperiment.encode = function encode(message, writer) { + MerchantCenterFeedFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalServingConfig != null && Object.hasOwnProperty.call(message, "originalServingConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.originalServingConfig); - if (message.experimentServingConfig != null && Object.hasOwnProperty.call(message, "experimentServingConfig")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.experimentServingConfig); + if (message.primaryFeedId != null && Object.hasOwnProperty.call(message, "primaryFeedId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.primaryFeedId); + if (message.primaryFeedName != null && Object.hasOwnProperty.call(message, "primaryFeedName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryFeedName); return writer; }; /** - * Encodes the specified ServingConfigExperiment message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment.verify|verify} messages. + * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.ExperimentInfo.IServingConfigExperiment} message ServingConfigExperiment message or plain object to encode + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServingConfigExperiment.encodeDelimited = function encodeDelimited(message, writer) { + MerchantCenterFeedFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServingConfigExperiment message from the specified reader or buffer. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServingConfigExperiment.decode = function decode(reader, length) { + MerchantCenterFeedFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.originalServingConfig = reader.string(); + message.primaryFeedId = reader.int64(); break; } case 2: { - message.experimentServingConfig = reader.string(); + message.primaryFeedName = reader.string(); break; } default: @@ -76912,143 +87251,167 @@ }; /** - * Decodes a ServingConfigExperiment message from the specified reader or buffer, length delimited. + * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServingConfigExperiment.decodeDelimited = function decodeDelimited(reader) { + MerchantCenterFeedFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServingConfigExperiment message. + * Verifies a MerchantCenterFeedFilter message. * @function verify - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServingConfigExperiment.verify = function verify(message) { + MerchantCenterFeedFilter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.originalServingConfig != null && message.hasOwnProperty("originalServingConfig")) - if (!$util.isString(message.originalServingConfig)) - return "originalServingConfig: string expected"; - if (message.experimentServingConfig != null && message.hasOwnProperty("experimentServingConfig")) - if (!$util.isString(message.experimentServingConfig)) - return "experimentServingConfig: string expected"; + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (!$util.isInteger(message.primaryFeedId) && !(message.primaryFeedId && $util.isInteger(message.primaryFeedId.low) && $util.isInteger(message.primaryFeedId.high))) + return "primaryFeedId: integer|Long expected"; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + if (!$util.isString(message.primaryFeedName)) + return "primaryFeedName: string expected"; return null; }; /** - * Creates a ServingConfigExperiment message from a plain object. Also converts values to their respective internal types. + * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} ServingConfigExperiment + * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter */ - ServingConfigExperiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment) + MerchantCenterFeedFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter) return object; - var message = new $root.google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment(); - if (object.originalServingConfig != null) - message.originalServingConfig = String(object.originalServingConfig); - if (object.experimentServingConfig != null) - message.experimentServingConfig = String(object.experimentServingConfig); + var message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter(); + if (object.primaryFeedId != null) + if ($util.Long) + (message.primaryFeedId = $util.Long.fromValue(object.primaryFeedId)).unsigned = false; + else if (typeof object.primaryFeedId === "string") + message.primaryFeedId = parseInt(object.primaryFeedId, 10); + else if (typeof object.primaryFeedId === "number") + message.primaryFeedId = object.primaryFeedId; + else if (typeof object.primaryFeedId === "object") + message.primaryFeedId = new $util.LongBits(object.primaryFeedId.low >>> 0, object.primaryFeedId.high >>> 0).toNumber(); + if (object.primaryFeedName != null) + message.primaryFeedName = String(object.primaryFeedName); return message; }; /** - * Creates a plain object from a ServingConfigExperiment message. Also converts values to other types if specified. + * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static - * @param {google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment} message ServingConfigExperiment + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} message MerchantCenterFeedFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServingConfigExperiment.toObject = function toObject(message, options) { + MerchantCenterFeedFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalServingConfig = ""; - object.experimentServingConfig = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.primaryFeedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.primaryFeedId = options.longs === String ? "0" : 0; + object.primaryFeedName = ""; } - if (message.originalServingConfig != null && message.hasOwnProperty("originalServingConfig")) - object.originalServingConfig = message.originalServingConfig; - if (message.experimentServingConfig != null && message.hasOwnProperty("experimentServingConfig")) - object.experimentServingConfig = message.experimentServingConfig; + if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) + if (typeof message.primaryFeedId === "number") + object.primaryFeedId = options.longs === String ? String(message.primaryFeedId) : message.primaryFeedId; + else + object.primaryFeedId = options.longs === String ? $util.Long.prototype.toString.call(message.primaryFeedId) : options.longs === Number ? new $util.LongBits(message.primaryFeedId.low >>> 0, message.primaryFeedId.high >>> 0).toNumber() : message.primaryFeedId; + if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) + object.primaryFeedName = message.primaryFeedName; return object; }; /** - * Converts this ServingConfigExperiment to JSON. + * Converts this MerchantCenterFeedFilter to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @instance * @returns {Object.} JSON object */ - ServingConfigExperiment.prototype.toJSON = function toJSON() { + MerchantCenterFeedFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServingConfigExperiment + * Gets the default type url for MerchantCenterFeedFilter * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServingConfigExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MerchantCenterFeedFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ExperimentInfo.ServingConfigExperiment"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter"; }; - return ServingConfigExperiment; + return MerchantCenterFeedFilter; })(); - return ExperimentInfo; + /** + * State enum. + * @name google.cloud.retail.v2alpha.MerchantCenterAccountLink.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + */ + MerchantCenterAccountLink.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return MerchantCenterAccountLink; })(); - v2alpha.Control = (function() { + v2alpha.CreateMerchantCenterAccountLinkMetadata = (function() { /** - * Properties of a Control. + * Properties of a CreateMerchantCenterAccountLinkMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IControl - * @property {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null} [facetSpec] Control facetSpec - * @property {google.cloud.retail.v2alpha.IRule|null} [rule] Control rule - * @property {string|null} [name] Control name - * @property {string|null} [displayName] Control displayName - * @property {Array.|null} [associatedServingConfigIds] Control associatedServingConfigIds - * @property {Array.|null} [solutionTypes] Control solutionTypes - * @property {Array.|null} [searchSolutionUseCase] Control searchSolutionUseCase + * @interface ICreateMerchantCenterAccountLinkMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateMerchantCenterAccountLinkMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CreateMerchantCenterAccountLinkMetadata updateTime */ /** - * Constructs a new Control. + * Constructs a new CreateMerchantCenterAccountLinkMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Control. - * @implements IControl + * @classdesc Represents a CreateMerchantCenterAccountLinkMetadata. + * @implements ICreateMerchantCenterAccountLinkMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IControl=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata=} [properties] Properties to set */ - function Control(properties) { - this.associatedServingConfigIds = []; - this.solutionTypes = []; - this.searchSolutionUseCase = []; + function CreateMerchantCenterAccountLinkMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -77056,198 +87419,89 @@ } /** - * Control facetSpec. - * @member {google.cloud.retail.v2alpha.SearchRequest.IFacetSpec|null|undefined} facetSpec - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.facetSpec = null; - - /** - * Control rule. - * @member {google.cloud.retail.v2alpha.IRule|null|undefined} rule - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.rule = null; - - /** - * Control name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.name = ""; - - /** - * Control displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.displayName = ""; - - /** - * Control associatedServingConfigIds. - * @member {Array.} associatedServingConfigIds - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.associatedServingConfigIds = $util.emptyArray; - - /** - * Control solutionTypes. - * @member {Array.} solutionTypes - * @memberof google.cloud.retail.v2alpha.Control - * @instance - */ - Control.prototype.solutionTypes = $util.emptyArray; - - /** - * Control searchSolutionUseCase. - * @member {Array.} searchSolutionUseCase - * @memberof google.cloud.retail.v2alpha.Control + * CreateMerchantCenterAccountLinkMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @instance */ - Control.prototype.searchSolutionUseCase = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateMerchantCenterAccountLinkMetadata.prototype.createTime = null; /** - * Control control. - * @member {"facetSpec"|"rule"|undefined} control - * @memberof google.cloud.retail.v2alpha.Control + * CreateMerchantCenterAccountLinkMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @instance */ - Object.defineProperty(Control.prototype, "control", { - get: $util.oneOfGetter($oneOfFields = ["facetSpec", "rule"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateMerchantCenterAccountLinkMetadata.prototype.updateTime = null; /** - * Creates a new Control instance using the specified properties. + * Creates a new CreateMerchantCenterAccountLinkMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static - * @param {google.cloud.retail.v2alpha.IControl=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Control} Control instance + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata instance */ - Control.create = function create(properties) { - return new Control(properties); + CreateMerchantCenterAccountLinkMetadata.create = function create(properties) { + return new CreateMerchantCenterAccountLinkMetadata(properties); }; /** - * Encodes the specified Control message. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * Encodes the specified CreateMerchantCenterAccountLinkMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static - * @param {google.cloud.retail.v2alpha.IControl} message Control message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Control.encode = function encode(message, writer) { + CreateMerchantCenterAccountLinkMetadata.encode = function encode(message, writer) { 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.facetSpec != null && Object.hasOwnProperty.call(message, "facetSpec")) - $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.encode(message.facetSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.rule != null && Object.hasOwnProperty.call(message, "rule")) - $root.google.cloud.retail.v2alpha.Rule.encode(message.rule, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.associatedServingConfigIds != null && message.associatedServingConfigIds.length) - for (var i = 0; i < message.associatedServingConfigIds.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.associatedServingConfigIds[i]); - if (message.solutionTypes != null && message.solutionTypes.length) { - writer.uint32(/* id 6, wireType 2 =*/50).fork(); - for (var i = 0; i < message.solutionTypes.length; ++i) - writer.int32(message.solutionTypes[i]); - writer.ldelim(); - } - if (message.searchSolutionUseCase != null && message.searchSolutionUseCase.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.searchSolutionUseCase.length; ++i) - writer.int32(message.searchSolutionUseCase[i]); - writer.ldelim(); - } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Control message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Control.verify|verify} messages. + * Encodes the specified CreateMerchantCenterAccountLinkMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static - * @param {google.cloud.retail.v2alpha.IControl} message Control message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Control.encodeDelimited = function encodeDelimited(message, writer) { + CreateMerchantCenterAccountLinkMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Control message from the specified reader or buffer. + * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Control} Control + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Control.decode = function decode(reader, length) { + CreateMerchantCenterAccountLinkMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Control(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: { - message.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.decode(reader, reader.uint32()); - break; - } - case 4: { - message.rule = $root.google.cloud.retail.v2alpha.Rule.decode(reader, reader.uint32()); - break; - } case 1: { - message.name = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.displayName = reader.string(); - break; - } - case 5: { - if (!(message.associatedServingConfigIds && message.associatedServingConfigIds.length)) - message.associatedServingConfigIds = []; - message.associatedServingConfigIds.push(reader.string()); - break; - } - case 6: { - if (!(message.solutionTypes && message.solutionTypes.length)) - message.solutionTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.solutionTypes.push(reader.int32()); - } else - message.solutionTypes.push(reader.int32()); - break; - } - case 7: { - if (!(message.searchSolutionUseCase && message.searchSolutionUseCase.length)) - message.searchSolutionUseCase = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.searchSolutionUseCase.push(reader.int32()); - } else - message.searchSolutionUseCase.push(reader.int32()); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -77259,482 +87513,479 @@ }; /** - * Decodes a Control message from the specified reader or buffer, length delimited. + * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Control} Control + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Control.decodeDelimited = function decodeDelimited(reader) { + CreateMerchantCenterAccountLinkMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Control message. + * Verifies a CreateMerchantCenterAccountLinkMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Control.verify = function verify(message) { + CreateMerchantCenterAccountLinkMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { - properties.control = 1; - { - var error = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.verify(message.facetSpec); - if (error) - return "facetSpec." + error; - } - } - if (message.rule != null && message.hasOwnProperty("rule")) { - if (properties.control === 1) - return "control: multiple values"; - properties.control = 1; - { - var error = $root.google.cloud.retail.v2alpha.Rule.verify(message.rule); - if (error) - return "rule." + 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.associatedServingConfigIds != null && message.hasOwnProperty("associatedServingConfigIds")) { - if (!Array.isArray(message.associatedServingConfigIds)) - return "associatedServingConfigIds: array expected"; - for (var i = 0; i < message.associatedServingConfigIds.length; ++i) - if (!$util.isString(message.associatedServingConfigIds[i])) - return "associatedServingConfigIds: string[] expected"; - } - if (message.solutionTypes != null && message.hasOwnProperty("solutionTypes")) { - if (!Array.isArray(message.solutionTypes)) - return "solutionTypes: array expected"; - for (var i = 0; i < message.solutionTypes.length; ++i) - switch (message.solutionTypes[i]) { - default: - return "solutionTypes: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } - if (message.searchSolutionUseCase != null && message.hasOwnProperty("searchSolutionUseCase")) { - if (!Array.isArray(message.searchSolutionUseCase)) - return "searchSolutionUseCase: array expected"; - for (var i = 0; i < message.searchSolutionUseCase.length; ++i) - switch (message.searchSolutionUseCase[i]) { - default: - return "searchSolutionUseCase: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } return null; }; /** - * Creates a Control message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMerchantCenterAccountLinkMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Control} Control + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata */ - Control.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Control) + CreateMerchantCenterAccountLinkMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.Control(); - if (object.facetSpec != null) { - if (typeof object.facetSpec !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Control.facetSpec: object expected"); - message.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.fromObject(object.facetSpec); - } - if (object.rule != null) { - if (typeof object.rule !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Control.rule: object expected"); - message.rule = $root.google.cloud.retail.v2alpha.Rule.fromObject(object.rule); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.associatedServingConfigIds) { - if (!Array.isArray(object.associatedServingConfigIds)) - throw TypeError(".google.cloud.retail.v2alpha.Control.associatedServingConfigIds: array expected"); - message.associatedServingConfigIds = []; - for (var i = 0; i < object.associatedServingConfigIds.length; ++i) - message.associatedServingConfigIds[i] = String(object.associatedServingConfigIds[i]); - } - if (object.solutionTypes) { - if (!Array.isArray(object.solutionTypes)) - throw TypeError(".google.cloud.retail.v2alpha.Control.solutionTypes: array expected"); - message.solutionTypes = []; - for (var i = 0; i < object.solutionTypes.length; ++i) - switch (object.solutionTypes[i]) { - default: - if (typeof object.solutionTypes[i] === "number") { - message.solutionTypes[i] = object.solutionTypes[i]; - break; - } - case "SOLUTION_TYPE_UNSPECIFIED": - case 0: - message.solutionTypes[i] = 0; - break; - case "SOLUTION_TYPE_RECOMMENDATION": - case 1: - message.solutionTypes[i] = 1; - break; - case "SOLUTION_TYPE_SEARCH": - case 2: - message.solutionTypes[i] = 2; - break; - } + var message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.searchSolutionUseCase) { - if (!Array.isArray(object.searchSolutionUseCase)) - throw TypeError(".google.cloud.retail.v2alpha.Control.searchSolutionUseCase: array expected"); - message.searchSolutionUseCase = []; - for (var i = 0; i < object.searchSolutionUseCase.length; ++i) - switch (object.searchSolutionUseCase[i]) { - default: - if (typeof object.searchSolutionUseCase[i] === "number") { - message.searchSolutionUseCase[i] = object.searchSolutionUseCase[i]; - break; - } - case "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": - case 0: - message.searchSolutionUseCase[i] = 0; - break; - case "SEARCH_SOLUTION_USE_CASE_SEARCH": - case 1: - message.searchSolutionUseCase[i] = 1; - break; - case "SEARCH_SOLUTION_USE_CASE_BROWSE": - case 2: - message.searchSolutionUseCase[i] = 2; - break; - } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** - * Creates a plain object from a Control message. Also converts values to other types if specified. + * Creates a plain object from a CreateMerchantCenterAccountLinkMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static - * @param {google.cloud.retail.v2alpha.Control} message Control + * @param {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Control.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.associatedServingConfigIds = []; - object.solutionTypes = []; - object.searchSolutionUseCase = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.facetSpec != null && message.hasOwnProperty("facetSpec")) { - object.facetSpec = $root.google.cloud.retail.v2alpha.SearchRequest.FacetSpec.toObject(message.facetSpec, options); - if (options.oneofs) - object.control = "facetSpec"; - } - if (message.rule != null && message.hasOwnProperty("rule")) { - object.rule = $root.google.cloud.retail.v2alpha.Rule.toObject(message.rule, options); - if (options.oneofs) - object.control = "rule"; - } - if (message.associatedServingConfigIds && message.associatedServingConfigIds.length) { - object.associatedServingConfigIds = []; - for (var j = 0; j < message.associatedServingConfigIds.length; ++j) - object.associatedServingConfigIds[j] = message.associatedServingConfigIds[j]; - } - if (message.solutionTypes && message.solutionTypes.length) { - object.solutionTypes = []; - for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; - } - if (message.searchSolutionUseCase && message.searchSolutionUseCase.length) { - object.searchSolutionUseCase = []; - for (var j = 0; j < message.searchSolutionUseCase.length; ++j) - object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] === undefined ? message.searchSolutionUseCase[j] : $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; + * @returns {Object.} Plain object + */ + CreateMerchantCenterAccountLinkMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; } + 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); return object; }; /** - * Converts this Control to JSON. + * Converts this CreateMerchantCenterAccountLinkMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @instance * @returns {Object.} JSON object */ - Control.prototype.toJSON = function toJSON() { + CreateMerchantCenterAccountLinkMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Control + * Gets the default type url for CreateMerchantCenterAccountLinkMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Control + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Control.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateMerchantCenterAccountLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Control"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata"; }; - return Control; + return CreateMerchantCenterAccountLinkMetadata; })(); - v2alpha.ControlService = (function() { + v2alpha.MerchantCenterAccountLinkService = (function() { /** - * Constructs a new ControlService service. + * Constructs a new MerchantCenterAccountLinkService service. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ControlService + * @classdesc Represents a MerchantCenterAccountLinkService * @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 ControlService(rpcImpl, requestDelimited, responseDelimited) { + function MerchantCenterAccountLinkService(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (ControlService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ControlService; + (MerchantCenterAccountLinkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MerchantCenterAccountLinkService; /** - * Creates new ControlService service using the specified rpc implementation. + * Creates new MerchantCenterAccountLinkService service using the specified rpc implementation. * @function create - * @memberof google.cloud.retail.v2alpha.ControlService + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @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 {ControlService} RPC service. Useful where requests and/or responses are streamed. + * @returns {MerchantCenterAccountLinkService} RPC service. Useful where requests and/or responses are streamed. */ - ControlService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + MerchantCenterAccountLinkService.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|createControl}. - * @memberof google.cloud.retail.v2alpha.ControlService - * @typedef CreateControlCallback + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|listMerchantCenterAccountLinks}. + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService + * @typedef ListMerchantCenterAccountLinksCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Control} [response] Control + * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} [response] ListMerchantCenterAccountLinksResponse */ /** - * Calls CreateControl. - * @function createControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls ListMerchantCenterAccountLinks. + * @function listMerchantCenterAccountLinks + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.ICreateControlRequest} request CreateControlRequest message or plain object - * @param {google.cloud.retail.v2alpha.ControlService.CreateControlCallback} callback Node-style callback called with the error, if any, and Control + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} request ListMerchantCenterAccountLinksRequest message or plain object + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.ListMerchantCenterAccountLinksCallback} callback Node-style callback called with the error, if any, and ListMerchantCenterAccountLinksResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(ControlService.prototype.createControl = function createControl(request, callback) { - return this.rpcCall(createControl, $root.google.cloud.retail.v2alpha.CreateControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); - }, "name", { value: "CreateControl" }); + Object.defineProperty(MerchantCenterAccountLinkService.prototype.listMerchantCenterAccountLinks = function listMerchantCenterAccountLinks(request, callback) { + return this.rpcCall(listMerchantCenterAccountLinks, $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest, $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse, request, callback); + }, "name", { value: "ListMerchantCenterAccountLinks" }); /** - * Calls CreateControl. - * @function createControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls ListMerchantCenterAccountLinks. + * @function listMerchantCenterAccountLinks + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.ICreateControlRequest} request CreateControlRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} request ListMerchantCenterAccountLinksRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|deleteControl}. - * @memberof google.cloud.retail.v2alpha.ControlService - * @typedef DeleteControlCallback + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|createMerchantCenterAccountLink}. + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService + * @typedef CreateMerchantCenterAccountLinkCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls DeleteControl. - * @function deleteControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls CreateMerchantCenterAccountLink. + * @function createMerchantCenterAccountLink + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} request DeleteControlRequest message or plain object - * @param {google.cloud.retail.v2alpha.ControlService.DeleteControlCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} request CreateMerchantCenterAccountLinkRequest message or plain object + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.CreateMerchantCenterAccountLinkCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ - Object.defineProperty(ControlService.prototype.deleteControl = function deleteControl(request, callback) { - return this.rpcCall(deleteControl, $root.google.cloud.retail.v2alpha.DeleteControlRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteControl" }); + Object.defineProperty(MerchantCenterAccountLinkService.prototype.createMerchantCenterAccountLink = function createMerchantCenterAccountLink(request, callback) { + return this.rpcCall(createMerchantCenterAccountLink, $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMerchantCenterAccountLink" }); /** - * Calls DeleteControl. - * @function deleteControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls CreateMerchantCenterAccountLink. + * @function createMerchantCenterAccountLink + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} request DeleteControlRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} request CreateMerchantCenterAccountLinkRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|updateControl}. - * @memberof google.cloud.retail.v2alpha.ControlService - * @typedef UpdateControlCallback + * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|deleteMerchantCenterAccountLink}. + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService + * @typedef DeleteMerchantCenterAccountLinkCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Control} [response] Control + * @param {google.protobuf.Empty} [response] Empty */ /** - * Calls UpdateControl. - * @function updateControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls DeleteMerchantCenterAccountLink. + * @function deleteMerchantCenterAccountLink + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} request UpdateControlRequest message or plain object - * @param {google.cloud.retail.v2alpha.ControlService.UpdateControlCallback} callback Node-style callback called with the error, if any, and Control + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} request DeleteMerchantCenterAccountLinkRequest message or plain object + * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.DeleteMerchantCenterAccountLinkCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ - Object.defineProperty(ControlService.prototype.updateControl = function updateControl(request, callback) { - return this.rpcCall(updateControl, $root.google.cloud.retail.v2alpha.UpdateControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); - }, "name", { value: "UpdateControl" }); + Object.defineProperty(MerchantCenterAccountLinkService.prototype.deleteMerchantCenterAccountLink = function deleteMerchantCenterAccountLink(request, callback) { + return this.rpcCall(deleteMerchantCenterAccountLink, $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMerchantCenterAccountLink" }); /** - * Calls UpdateControl. - * @function updateControl - * @memberof google.cloud.retail.v2alpha.ControlService + * Calls DeleteMerchantCenterAccountLink. + * @function deleteMerchantCenterAccountLink + * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService * @instance - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} request UpdateControlRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} request DeleteMerchantCenterAccountLinkRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ + return MerchantCenterAccountLinkService; + })(); + + v2alpha.ListMerchantCenterAccountLinksRequest = (function() { + /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|getControl}. - * @memberof google.cloud.retail.v2alpha.ControlService - * @typedef GetControlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Control} [response] Control + * Properties of a ListMerchantCenterAccountLinksRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IListMerchantCenterAccountLinksRequest + * @property {string|null} [parent] ListMerchantCenterAccountLinksRequest parent */ /** - * Calls GetControl. - * @function getControl - * @memberof google.cloud.retail.v2alpha.ControlService - * @instance - * @param {google.cloud.retail.v2alpha.IGetControlRequest} request GetControlRequest message or plain object - * @param {google.cloud.retail.v2alpha.ControlService.GetControlCallback} callback Node-style callback called with the error, if any, and Control - * @returns {undefined} - * @variation 1 + * Constructs a new ListMerchantCenterAccountLinksRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListMerchantCenterAccountLinksRequest. + * @implements IListMerchantCenterAccountLinksRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest=} [properties] Properties to set */ - Object.defineProperty(ControlService.prototype.getControl = function getControl(request, callback) { - return this.rpcCall(getControl, $root.google.cloud.retail.v2alpha.GetControlRequest, $root.google.cloud.retail.v2alpha.Control, request, callback); - }, "name", { value: "GetControl" }); + function ListMerchantCenterAccountLinksRequest(properties) { + if (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 GetControl. - * @function getControl - * @memberof google.cloud.retail.v2alpha.ControlService + * ListMerchantCenterAccountLinksRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest * @instance - * @param {google.cloud.retail.v2alpha.IGetControlRequest} request GetControlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListMerchantCenterAccountLinksRequest.prototype.parent = ""; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ControlService|listControls}. - * @memberof google.cloud.retail.v2alpha.ControlService - * @typedef ListControlsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListControlsResponse} [response] ListControlsResponse + * Creates a new ListMerchantCenterAccountLinksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest instance */ + ListMerchantCenterAccountLinksRequest.create = function create(properties) { + return new ListMerchantCenterAccountLinksRequest(properties); + }; /** - * Calls ListControls. - * @function listControls - * @memberof google.cloud.retail.v2alpha.ControlService - * @instance - * @param {google.cloud.retail.v2alpha.IListControlsRequest} request ListControlsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ControlService.ListControlsCallback} callback Node-style callback called with the error, if any, and ListControlsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified ListMerchantCenterAccountLinksRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ControlService.prototype.listControls = function listControls(request, callback) { - return this.rpcCall(listControls, $root.google.cloud.retail.v2alpha.ListControlsRequest, $root.google.cloud.retail.v2alpha.ListControlsResponse, request, callback); - }, "name", { value: "ListControls" }); + ListMerchantCenterAccountLinksRequest.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); + return writer; + }; /** - * Calls ListControls. - * @function listControls - * @memberof google.cloud.retail.v2alpha.ControlService + * Encodes the specified ListMerchantCenterAccountLinksRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMerchantCenterAccountLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMerchantCenterAccountLinksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMerchantCenterAccountLinksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMerchantCenterAccountLinksRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMerchantCenterAccountLinksRequest.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"; + return null; + }; + + /** + * Creates a ListMerchantCenterAccountLinksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + */ + ListMerchantCenterAccountLinksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListMerchantCenterAccountLinksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMerchantCenterAccountLinksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListMerchantCenterAccountLinksRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest * @instance - * @param {google.cloud.retail.v2alpha.IListControlsRequest} request ListControlsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListMerchantCenterAccountLinksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ControlService; + /** + * Gets the default type url for ListMerchantCenterAccountLinksRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMerchantCenterAccountLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest"; + }; + + return ListMerchantCenterAccountLinksRequest; })(); - v2alpha.CreateControlRequest = (function() { + v2alpha.ListMerchantCenterAccountLinksResponse = (function() { /** - * Properties of a CreateControlRequest. + * Properties of a ListMerchantCenterAccountLinksResponse. * @memberof google.cloud.retail.v2alpha - * @interface ICreateControlRequest - * @property {string|null} [parent] CreateControlRequest parent - * @property {google.cloud.retail.v2alpha.IControl|null} [control] CreateControlRequest control - * @property {string|null} [controlId] CreateControlRequest controlId + * @interface IListMerchantCenterAccountLinksResponse + * @property {Array.|null} [merchantCenterAccountLinks] ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks */ /** - * Constructs a new CreateControlRequest. + * Constructs a new ListMerchantCenterAccountLinksResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateControlRequest. - * @implements ICreateControlRequest + * @classdesc Represents a ListMerchantCenterAccountLinksResponse. + * @implements IListMerchantCenterAccountLinksResponse * @constructor - * @param {google.cloud.retail.v2alpha.ICreateControlRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse=} [properties] Properties to set */ - function CreateControlRequest(properties) { + function ListMerchantCenterAccountLinksResponse(properties) { + this.merchantCenterAccountLinks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -77742,103 +87993,78 @@ } /** - * CreateControlRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CreateControlRequest - * @instance - */ - CreateControlRequest.prototype.parent = ""; - - /** - * CreateControlRequest control. - * @member {google.cloud.retail.v2alpha.IControl|null|undefined} control - * @memberof google.cloud.retail.v2alpha.CreateControlRequest - * @instance - */ - CreateControlRequest.prototype.control = null; - - /** - * CreateControlRequest controlId. - * @member {string} controlId - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks. + * @member {Array.} merchantCenterAccountLinks + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @instance */ - CreateControlRequest.prototype.controlId = ""; + ListMerchantCenterAccountLinksResponse.prototype.merchantCenterAccountLinks = $util.emptyArray; /** - * Creates a new CreateControlRequest instance using the specified properties. + * Creates a new ListMerchantCenterAccountLinksResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateControlRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest instance + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse instance */ - CreateControlRequest.create = function create(properties) { - return new CreateControlRequest(properties); + ListMerchantCenterAccountLinksResponse.create = function create(properties) { + return new ListMerchantCenterAccountLinksResponse(properties); }; /** - * Encodes the specified CreateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * Encodes the specified ListMerchantCenterAccountLinksResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateControlRequest} message CreateControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateControlRequest.encode = function encode(message, writer) { + ListMerchantCenterAccountLinksResponse.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.control != null && Object.hasOwnProperty.call(message, "control")) - $root.google.cloud.retail.v2alpha.Control.encode(message.control, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.controlId != null && Object.hasOwnProperty.call(message, "controlId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.controlId); + if (message.merchantCenterAccountLinks != null && message.merchantCenterAccountLinks.length) + for (var i = 0; i < message.merchantCenterAccountLinks.length; ++i) + $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.encode(message.merchantCenterAccountLinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateControlRequest.verify|verify} messages. + * Encodes the specified ListMerchantCenterAccountLinksResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateControlRequest} message CreateControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMerchantCenterAccountLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateControlRequest message from the specified reader or buffer. + * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateControlRequest.decode = function decode(reader, length) { + ListMerchantCenterAccountLinksResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateControlRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.control = $root.google.cloud.retail.v2alpha.Control.decode(reader, reader.uint32()); - break; - } - case 3: { - message.controlId = reader.string(); + if (!(message.merchantCenterAccountLinks && message.merchantCenterAccountLinks.length)) + message.merchantCenterAccountLinks = []; + message.merchantCenterAccountLinks.push($root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.decode(reader, reader.uint32())); break; } default: @@ -77850,145 +88076,140 @@ }; /** - * Decodes a CreateControlRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateControlRequest.decodeDelimited = function decodeDelimited(reader) { + ListMerchantCenterAccountLinksResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateControlRequest message. + * Verifies a ListMerchantCenterAccountLinksResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateControlRequest.verify = function verify(message) { + ListMerchantCenterAccountLinksResponse.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.control != null && message.hasOwnProperty("control")) { - var error = $root.google.cloud.retail.v2alpha.Control.verify(message.control); - if (error) - return "control." + error; + if (message.merchantCenterAccountLinks != null && message.hasOwnProperty("merchantCenterAccountLinks")) { + if (!Array.isArray(message.merchantCenterAccountLinks)) + return "merchantCenterAccountLinks: array expected"; + for (var i = 0; i < message.merchantCenterAccountLinks.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify(message.merchantCenterAccountLinks[i]); + if (error) + return "merchantCenterAccountLinks." + error; + } } - if (message.controlId != null && message.hasOwnProperty("controlId")) - if (!$util.isString(message.controlId)) - return "controlId: string expected"; return null; }; /** - * Creates a CreateControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMerchantCenterAccountLinksResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateControlRequest} CreateControlRequest + * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse */ - CreateControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateControlRequest) + ListMerchantCenterAccountLinksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateControlRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.control != null) { - if (typeof object.control !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateControlRequest.control: object expected"); - message.control = $root.google.cloud.retail.v2alpha.Control.fromObject(object.control); + var message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse(); + if (object.merchantCenterAccountLinks) { + if (!Array.isArray(object.merchantCenterAccountLinks)) + throw TypeError(".google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.merchantCenterAccountLinks: array expected"); + message.merchantCenterAccountLinks = []; + for (var i = 0; i < object.merchantCenterAccountLinks.length; ++i) { + if (typeof object.merchantCenterAccountLinks[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.merchantCenterAccountLinks: object expected"); + message.merchantCenterAccountLinks[i] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.fromObject(object.merchantCenterAccountLinks[i]); + } } - if (object.controlId != null) - message.controlId = String(object.controlId); return message; }; /** - * Creates a plain object from a CreateControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMerchantCenterAccountLinksResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static - * @param {google.cloud.retail.v2alpha.CreateControlRequest} message CreateControlRequest + * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateControlRequest.toObject = function toObject(message, options) { + ListMerchantCenterAccountLinksResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.control = null; - object.controlId = ""; + if (options.arrays || options.defaults) + object.merchantCenterAccountLinks = []; + if (message.merchantCenterAccountLinks && message.merchantCenterAccountLinks.length) { + object.merchantCenterAccountLinks = []; + for (var j = 0; j < message.merchantCenterAccountLinks.length; ++j) + object.merchantCenterAccountLinks[j] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.toObject(message.merchantCenterAccountLinks[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.control != null && message.hasOwnProperty("control")) - object.control = $root.google.cloud.retail.v2alpha.Control.toObject(message.control, options); - if (message.controlId != null && message.hasOwnProperty("controlId")) - object.controlId = message.controlId; return object; }; /** - * Converts this CreateControlRequest to JSON. + * Converts this ListMerchantCenterAccountLinksResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @instance * @returns {Object.} JSON object */ - CreateControlRequest.prototype.toJSON = function toJSON() { + ListMerchantCenterAccountLinksResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateControlRequest + * Gets the default type url for ListMerchantCenterAccountLinksResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateControlRequest + * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMerchantCenterAccountLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateControlRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse"; }; - return CreateControlRequest; + return ListMerchantCenterAccountLinksResponse; })(); - v2alpha.UpdateControlRequest = (function() { + v2alpha.CreateMerchantCenterAccountLinkRequest = (function() { /** - * Properties of an UpdateControlRequest. + * Properties of a CreateMerchantCenterAccountLinkRequest. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateControlRequest - * @property {google.cloud.retail.v2alpha.IControl|null} [control] UpdateControlRequest control - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateControlRequest updateMask + * @interface ICreateMerchantCenterAccountLinkRequest + * @property {string|null} [parent] CreateMerchantCenterAccountLinkRequest parent + * @property {google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null} [merchantCenterAccountLink] CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink */ /** - * Constructs a new UpdateControlRequest. + * Constructs a new CreateMerchantCenterAccountLinkRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateControlRequest. - * @implements IUpdateControlRequest + * @classdesc Represents a CreateMerchantCenterAccountLinkRequest. + * @implements ICreateMerchantCenterAccountLinkRequest * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest=} [properties] Properties to set */ - function UpdateControlRequest(properties) { + function CreateMerchantCenterAccountLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -77996,89 +88217,89 @@ } /** - * UpdateControlRequest control. - * @member {google.cloud.retail.v2alpha.IControl|null|undefined} control - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * CreateMerchantCenterAccountLinkRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @instance */ - UpdateControlRequest.prototype.control = null; + CreateMerchantCenterAccountLinkRequest.prototype.parent = ""; /** - * UpdateControlRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink. + * @member {google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null|undefined} merchantCenterAccountLink + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @instance */ - UpdateControlRequest.prototype.updateMask = null; + CreateMerchantCenterAccountLinkRequest.prototype.merchantCenterAccountLink = null; /** - * Creates a new UpdateControlRequest instance using the specified properties. + * Creates a new CreateMerchantCenterAccountLinkRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest instance + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest instance */ - UpdateControlRequest.create = function create(properties) { - return new UpdateControlRequest(properties); + CreateMerchantCenterAccountLinkRequest.create = function create(properties) { + return new CreateMerchantCenterAccountLinkRequest(properties); }; /** - * Encodes the specified UpdateControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * Encodes the specified CreateMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateControlRequest.encode = function encode(message, writer) { + CreateMerchantCenterAccountLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.control != null && Object.hasOwnProperty.call(message, "control")) - $root.google.cloud.retail.v2alpha.Control.encode(message.control, 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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.merchantCenterAccountLink != null && Object.hasOwnProperty.call(message, "merchantCenterAccountLink")) + $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.encode(message.merchantCenterAccountLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateControlRequest.verify|verify} messages. + * Encodes the specified CreateMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IUpdateControlRequest} message UpdateControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateMerchantCenterAccountLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateControlRequest message from the specified reader or buffer. + * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateControlRequest.decode = function decode(reader, length) { + CreateMerchantCenterAccountLinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateControlRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.control = $root.google.cloud.retail.v2alpha.Control.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.decode(reader, reader.uint32()); break; } default: @@ -78090,141 +88311,136 @@ }; /** - * Decodes an UpdateControlRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateControlRequest.decodeDelimited = function decodeDelimited(reader) { + CreateMerchantCenterAccountLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateControlRequest message. + * Verifies a CreateMerchantCenterAccountLinkRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateControlRequest.verify = function verify(message) { + CreateMerchantCenterAccountLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.control != null && message.hasOwnProperty("control")) { - var error = $root.google.cloud.retail.v2alpha.Control.verify(message.control); - if (error) - return "control." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.merchantCenterAccountLink != null && message.hasOwnProperty("merchantCenterAccountLink")) { + var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify(message.merchantCenterAccountLink); if (error) - return "updateMask." + error; + return "merchantCenterAccountLink." + error; } return null; }; /** - * Creates an UpdateControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateControlRequest} UpdateControlRequest + * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest */ - UpdateControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateControlRequest) + CreateMerchantCenterAccountLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateControlRequest(); - if (object.control != null) { - if (typeof object.control !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateControlRequest.control: object expected"); - message.control = $root.google.cloud.retail.v2alpha.Control.fromObject(object.control); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateControlRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.merchantCenterAccountLink != null) { + if (typeof object.merchantCenterAccountLink !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.merchantCenterAccountLink: object expected"); + message.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.fromObject(object.merchantCenterAccountLink); } return message; }; /** - * Creates a plain object from an UpdateControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.UpdateControlRequest} message UpdateControlRequest + * @param {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateControlRequest.toObject = function toObject(message, options) { + CreateMerchantCenterAccountLinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.control = null; - object.updateMask = null; + object.parent = ""; + object.merchantCenterAccountLink = null; } - if (message.control != null && message.hasOwnProperty("control")) - object.control = $root.google.cloud.retail.v2alpha.Control.toObject(message.control, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.merchantCenterAccountLink != null && message.hasOwnProperty("merchantCenterAccountLink")) + object.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.toObject(message.merchantCenterAccountLink, options); return object; }; /** - * Converts this UpdateControlRequest to JSON. + * Converts this CreateMerchantCenterAccountLinkRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @instance * @returns {Object.} JSON object */ - UpdateControlRequest.prototype.toJSON = function toJSON() { + CreateMerchantCenterAccountLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateControlRequest + * Gets the default type url for CreateMerchantCenterAccountLinkRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateControlRequest + * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateMerchantCenterAccountLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateControlRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest"; }; - return UpdateControlRequest; + return CreateMerchantCenterAccountLinkRequest; })(); - v2alpha.DeleteControlRequest = (function() { + v2alpha.DeleteMerchantCenterAccountLinkRequest = (function() { /** - * Properties of a DeleteControlRequest. + * Properties of a DeleteMerchantCenterAccountLinkRequest. * @memberof google.cloud.retail.v2alpha - * @interface IDeleteControlRequest - * @property {string|null} [name] DeleteControlRequest name + * @interface IDeleteMerchantCenterAccountLinkRequest + * @property {string|null} [name] DeleteMerchantCenterAccountLinkRequest name */ /** - * Constructs a new DeleteControlRequest. + * Constructs a new DeleteMerchantCenterAccountLinkRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a DeleteControlRequest. - * @implements IDeleteControlRequest + * @classdesc Represents a DeleteMerchantCenterAccountLinkRequest. + * @implements IDeleteMerchantCenterAccountLinkRequest * @constructor - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest=} [properties] Properties to set */ - function DeleteControlRequest(properties) { + function DeleteMerchantCenterAccountLinkRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -78232,35 +88448,35 @@ } /** - * DeleteControlRequest name. + * DeleteMerchantCenterAccountLinkRequest name. * @member {string} name - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @instance */ - DeleteControlRequest.prototype.name = ""; + DeleteMerchantCenterAccountLinkRequest.prototype.name = ""; /** - * Creates a new DeleteControlRequest instance using the specified properties. + * Creates a new DeleteMerchantCenterAccountLinkRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest instance + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest instance */ - DeleteControlRequest.create = function create(properties) { - return new DeleteControlRequest(properties); + DeleteMerchantCenterAccountLinkRequest.create = function create(properties) { + return new DeleteMerchantCenterAccountLinkRequest(properties); }; /** - * Encodes the specified DeleteControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. + * Encodes the specified DeleteMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteControlRequest.encode = function encode(message, writer) { + DeleteMerchantCenterAccountLinkRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -78269,33 +88485,33 @@ }; /** - * Encodes the specified DeleteControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteControlRequest.verify|verify} messages. + * Encodes the specified DeleteMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteControlRequest} message DeleteControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMerchantCenterAccountLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteControlRequest message from the specified reader or buffer. + * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest + * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteControlRequest.decode = function decode(reader, length) { + DeleteMerchantCenterAccountLinkRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteControlRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -78312,30 +88528,30 @@ }; /** - * Decodes a DeleteControlRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest + * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteControlRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteMerchantCenterAccountLinkRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteControlRequest message. + * Verifies a DeleteMerchantCenterAccountLinkRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteControlRequest.verify = function verify(message) { + DeleteMerchantCenterAccountLinkRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -78345,32 +88561,32 @@ }; /** - * Creates a DeleteControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.DeleteControlRequest} DeleteControlRequest + * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest */ - DeleteControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.DeleteControlRequest) + DeleteMerchantCenterAccountLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.DeleteControlRequest(); + var message = new $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static - * @param {google.cloud.retail.v2alpha.DeleteControlRequest} message DeleteControlRequest + * @param {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteControlRequest.toObject = function toObject(message, options) { + DeleteMerchantCenterAccountLinkRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -78382,130 +88598,373 @@ }; /** - * Converts this DeleteControlRequest to JSON. + * Converts this DeleteMerchantCenterAccountLinkRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @instance * @returns {Object.} JSON object */ - DeleteControlRequest.prototype.toJSON = function toJSON() { + DeleteMerchantCenterAccountLinkRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteControlRequest + * Gets the default type url for DeleteMerchantCenterAccountLinkRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.DeleteControlRequest + * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteMerchantCenterAccountLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteControlRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest"; }; - return DeleteControlRequest; + return DeleteMerchantCenterAccountLinkRequest; })(); - v2alpha.GetControlRequest = (function() { + v2alpha.Model = (function() { /** - * Properties of a GetControlRequest. + * Properties of a Model. * @memberof google.cloud.retail.v2alpha - * @interface IGetControlRequest - * @property {string|null} [name] GetControlRequest name + * @interface IModel + * @property {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null} [pageOptimizationConfig] Model pageOptimizationConfig + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {google.cloud.retail.v2alpha.Model.TrainingState|null} [trainingState] Model trainingState + * @property {google.cloud.retail.v2alpha.Model.ServingState|null} [servingState] Model servingState + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {string|null} [type] Model type + * @property {string|null} [optimizationObjective] Model optimizationObjective + * @property {google.cloud.retail.v2alpha.Model.PeriodicTuningState|null} [periodicTuningState] Model periodicTuningState + * @property {google.protobuf.ITimestamp|null} [lastTuneTime] Model lastTuneTime + * @property {string|null} [tuningOperation] Model tuningOperation + * @property {google.cloud.retail.v2alpha.Model.DataState|null} [dataState] Model dataState + * @property {google.cloud.retail.v2alpha.RecommendationsFilteringOption|null} [filteringOption] Model filteringOption + * @property {Array.|null} [servingConfigLists] Model servingConfigLists + * @property {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig|null} [modelFeaturesConfig] Model modelFeaturesConfig + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.retail.v2alpha.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.servingConfigLists = []; + if (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 pageOptimizationConfig. + * @member {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null|undefined} pageOptimizationConfig + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.pageOptimizationConfig = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model trainingState. + * @member {google.cloud.retail.v2alpha.Model.TrainingState} trainingState + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.trainingState = 0; + + /** + * Model servingState. + * @member {google.cloud.retail.v2alpha.Model.ServingState} servingState + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.servingState = 0; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.type = ""; + + /** + * Model optimizationObjective. + * @member {string} optimizationObjective + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.optimizationObjective = ""; + + /** + * Model periodicTuningState. + * @member {google.cloud.retail.v2alpha.Model.PeriodicTuningState} periodicTuningState + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.periodicTuningState = 0; + + /** + * Model lastTuneTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastTuneTime + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.lastTuneTime = null; + + /** + * Model tuningOperation. + * @member {string} tuningOperation + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.tuningOperation = ""; + + /** + * Model dataState. + * @member {google.cloud.retail.v2alpha.Model.DataState} dataState + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.dataState = 0; + + /** + * Model filteringOption. + * @member {google.cloud.retail.v2alpha.RecommendationsFilteringOption} filteringOption + * @memberof google.cloud.retail.v2alpha.Model + * @instance + */ + Model.prototype.filteringOption = 0; + + /** + * Model servingConfigLists. + * @member {Array.} servingConfigLists + * @memberof google.cloud.retail.v2alpha.Model + * @instance */ + Model.prototype.servingConfigLists = $util.emptyArray; /** - * Constructs a new GetControlRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetControlRequest. - * @implements IGetControlRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IGetControlRequest=} [properties] Properties to set + * Model modelFeaturesConfig. + * @member {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig|null|undefined} modelFeaturesConfig + * @memberof google.cloud.retail.v2alpha.Model + * @instance */ - function GetControlRequest(properties) { - if (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.prototype.modelFeaturesConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * GetControlRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * Model trainingConfig. + * @member {"pageOptimizationConfig"|undefined} trainingConfig + * @memberof google.cloud.retail.v2alpha.Model * @instance */ - GetControlRequest.prototype.name = ""; + Object.defineProperty(Model.prototype, "trainingConfig", { + get: $util.oneOfGetter($oneOfFields = ["pageOptimizationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new GetControlRequest instance using the specified properties. + * Creates a new Model instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static - * @param {google.cloud.retail.v2alpha.IGetControlRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest instance + * @param {google.cloud.retail.v2alpha.IModel=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model} Model instance */ - GetControlRequest.create = function create(properties) { - return new GetControlRequest(properties); + Model.create = function create(properties) { + return new Model(properties); }; /** - * Encodes the specified GetControlRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * Encodes the specified Model message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static - * @param {google.cloud.retail.v2alpha.IGetControlRequest} message GetControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IModel} message Model message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetControlRequest.encode = function encode(message, 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.trainingState != null && Object.hasOwnProperty.call(message, "trainingState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingState); + if (message.servingState != null && Object.hasOwnProperty.call(message, "servingState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.servingState); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.type); + if (message.optimizationObjective != null && Object.hasOwnProperty.call(message, "optimizationObjective")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.optimizationObjective); + if (message.periodicTuningState != null && Object.hasOwnProperty.call(message, "periodicTuningState")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.periodicTuningState); + if (message.lastTuneTime != null && Object.hasOwnProperty.call(message, "lastTuneTime")) + $root.google.protobuf.Timestamp.encode(message.lastTuneTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.tuningOperation != null && Object.hasOwnProperty.call(message, "tuningOperation")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.tuningOperation); + if (message.dataState != null && Object.hasOwnProperty.call(message, "dataState")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.dataState); + if (message.pageOptimizationConfig != null && Object.hasOwnProperty.call(message, "pageOptimizationConfig")) + $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.encode(message.pageOptimizationConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.filteringOption != null && Object.hasOwnProperty.call(message, "filteringOption")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.filteringOption); + if (message.servingConfigLists != null && message.servingConfigLists.length) + for (var i = 0; i < message.servingConfigLists.length; ++i) + $root.google.cloud.retail.v2alpha.Model.ServingConfigList.encode(message.servingConfigLists[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.modelFeaturesConfig != null && Object.hasOwnProperty.call(message, "modelFeaturesConfig")) + $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.encode(message.modelFeaturesConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetControlRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetControlRequest.verify|verify} messages. + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static - * @param {google.cloud.retail.v2alpha.IGetControlRequest} message GetControlRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IModel} message Model message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + Model.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetControlRequest message from the specified reader or buffer. + * Decodes a Model message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest + * @returns {google.cloud.retail.v2alpha.Model} Model * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetControlRequest.decode = function decode(reader, length) { + 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.retail.v2alpha.GetControlRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 17: { + message.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.decode(reader, reader.uint32()); + break; + } case 1: { message.name = reader.string(); break; } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.trainingState = reader.int32(); + break; + } + case 4: { + message.servingState = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.type = reader.string(); + break; + } + case 8: { + message.optimizationObjective = reader.string(); + break; + } + case 11: { + message.periodicTuningState = reader.int32(); + break; + } + case 12: { + message.lastTuneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.tuningOperation = reader.string(); + break; + } + case 16: { + message.dataState = reader.int32(); + break; + } + case 18: { + message.filteringOption = reader.int32(); + break; + } + case 19: { + if (!(message.servingConfigLists && message.servingConfigLists.length)) + message.servingConfigLists = []; + message.servingConfigLists.push($root.google.cloud.retail.v2alpha.Model.ServingConfigList.decode(reader, reader.uint32())); + break; + } + case 22: { + message.modelFeaturesConfig = $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -78515,1094 +88974,1689 @@ }; /** - * Decodes a GetControlRequest message from the specified reader or buffer, length delimited. + * Decodes a Model message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest + * @returns {google.cloud.retail.v2alpha.Model} Model * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetControlRequest.decodeDelimited = function decodeDelimited(reader) { + Model.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetControlRequest message. + * Verifies a Model message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetControlRequest.verify = function verify(message) { + Model.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.pageOptimizationConfig != null && message.hasOwnProperty("pageOptimizationConfig")) { + properties.trainingConfig = 1; + { + var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify(message.pageOptimizationConfig); + if (error) + return "pageOptimizationConfig." + 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.trainingState != null && message.hasOwnProperty("trainingState")) + switch (message.trainingState) { + default: + return "trainingState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.servingState != null && message.hasOwnProperty("servingState")) + switch (message.servingState) { + default: + return "servingState: 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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + if (!$util.isString(message.optimizationObjective)) + return "optimizationObjective: string expected"; + if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) + switch (message.periodicTuningState) { + default: + return "periodicTuningState: enum value expected"; + case 0: + case 1: + case 3: + case 2: + break; + } + if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastTuneTime); + if (error) + return "lastTuneTime." + error; + } + if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) + if (!$util.isString(message.tuningOperation)) + return "tuningOperation: string expected"; + if (message.dataState != null && message.hasOwnProperty("dataState")) + switch (message.dataState) { + default: + return "dataState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) + switch (message.filteringOption) { + default: + return "filteringOption: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.servingConfigLists != null && message.hasOwnProperty("servingConfigLists")) { + if (!Array.isArray(message.servingConfigLists)) + return "servingConfigLists: array expected"; + for (var i = 0; i < message.servingConfigLists.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.verify(message.servingConfigLists[i]); + if (error) + return "servingConfigLists." + error; + } + } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) { + var error = $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.verify(message.modelFeaturesConfig); + if (error) + return "modelFeaturesConfig." + error; + } return null; }; /** - * Creates a GetControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Model message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetControlRequest} GetControlRequest + * @returns {google.cloud.retail.v2alpha.Model} Model */ - GetControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetControlRequest) + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model) return object; - var message = new $root.google.cloud.retail.v2alpha.GetControlRequest(); + var message = new $root.google.cloud.retail.v2alpha.Model(); + if (object.pageOptimizationConfig != null) { + if (typeof object.pageOptimizationConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.pageOptimizationConfig: object expected"); + message.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.fromObject(object.pageOptimizationConfig); + } if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.trainingState) { + default: + if (typeof object.trainingState === "number") { + message.trainingState = object.trainingState; + break; + } + break; + case "TRAINING_STATE_UNSPECIFIED": + case 0: + message.trainingState = 0; + break; + case "PAUSED": + case 1: + message.trainingState = 1; + break; + case "TRAINING": + case 2: + message.trainingState = 2; + break; + } + switch (object.servingState) { + default: + if (typeof object.servingState === "number") { + message.servingState = object.servingState; + break; + } + break; + case "SERVING_STATE_UNSPECIFIED": + case 0: + message.servingState = 0; + break; + case "INACTIVE": + case 1: + message.servingState = 1; + break; + case "ACTIVE": + case 2: + message.servingState = 2; + break; + case "TUNED": + case 3: + message.servingState = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.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.retail.v2alpha.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.type != null) + message.type = String(object.type); + if (object.optimizationObjective != null) + message.optimizationObjective = String(object.optimizationObjective); + switch (object.periodicTuningState) { + default: + if (typeof object.periodicTuningState === "number") { + message.periodicTuningState = object.periodicTuningState; + break; + } + break; + case "PERIODIC_TUNING_STATE_UNSPECIFIED": + case 0: + message.periodicTuningState = 0; + break; + case "PERIODIC_TUNING_DISABLED": + case 1: + message.periodicTuningState = 1; + break; + case "ALL_TUNING_DISABLED": + case 3: + message.periodicTuningState = 3; + break; + case "PERIODIC_TUNING_ENABLED": + case 2: + message.periodicTuningState = 2; + break; + } + if (object.lastTuneTime != null) { + if (typeof object.lastTuneTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.lastTuneTime: object expected"); + message.lastTuneTime = $root.google.protobuf.Timestamp.fromObject(object.lastTuneTime); + } + if (object.tuningOperation != null) + message.tuningOperation = String(object.tuningOperation); + switch (object.dataState) { + default: + if (typeof object.dataState === "number") { + message.dataState = object.dataState; + break; + } + break; + case "DATA_STATE_UNSPECIFIED": + case 0: + message.dataState = 0; + break; + case "DATA_OK": + case 1: + message.dataState = 1; + break; + case "DATA_ERROR": + case 2: + message.dataState = 2; + break; + } + switch (object.filteringOption) { + default: + if (typeof object.filteringOption === "number") { + message.filteringOption = object.filteringOption; + break; + } + break; + case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": + case 0: + message.filteringOption = 0; + break; + case "RECOMMENDATIONS_FILTERING_DISABLED": + case 1: + message.filteringOption = 1; + break; + case "RECOMMENDATIONS_FILTERING_ENABLED": + case 3: + message.filteringOption = 3; + break; + } + if (object.servingConfigLists) { + if (!Array.isArray(object.servingConfigLists)) + throw TypeError(".google.cloud.retail.v2alpha.Model.servingConfigLists: array expected"); + message.servingConfigLists = []; + for (var i = 0; i < object.servingConfigLists.length; ++i) { + if (typeof object.servingConfigLists[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.servingConfigLists: object expected"); + message.servingConfigLists[i] = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.fromObject(object.servingConfigLists[i]); + } + } + if (object.modelFeaturesConfig != null) { + if (typeof object.modelFeaturesConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.modelFeaturesConfig: object expected"); + message.modelFeaturesConfig = $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.fromObject(object.modelFeaturesConfig); + } return message; }; /** - * Creates a plain object from a GetControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a Model message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static - * @param {google.cloud.retail.v2alpha.GetControlRequest} message GetControlRequest + * @param {google.cloud.retail.v2alpha.Model} message Model * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetControlRequest.toObject = function toObject(message, options) { + Model.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.arrays || options.defaults) + object.servingConfigLists = []; + if (options.defaults) { object.name = ""; + object.displayName = ""; + object.trainingState = options.enums === String ? "TRAINING_STATE_UNSPECIFIED" : 0; + object.servingState = options.enums === String ? "SERVING_STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.type = ""; + object.optimizationObjective = ""; + object.periodicTuningState = options.enums === String ? "PERIODIC_TUNING_STATE_UNSPECIFIED" : 0; + object.lastTuneTime = null; + object.tuningOperation = ""; + object.dataState = options.enums === String ? "DATA_STATE_UNSPECIFIED" : 0; + object.filteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; + object.modelFeaturesConfig = 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.trainingState != null && message.hasOwnProperty("trainingState")) + object.trainingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] === undefined ? message.trainingState : $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] : message.trainingState; + if (message.servingState != null && message.hasOwnProperty("servingState")) + object.servingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] === undefined ? message.servingState : $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] : message.servingState; + 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.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + object.optimizationObjective = message.optimizationObjective; + if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) + object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] === undefined ? message.periodicTuningState : $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; + if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) + object.lastTuneTime = $root.google.protobuf.Timestamp.toObject(message.lastTuneTime, options); + if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) + object.tuningOperation = message.tuningOperation; + if (message.dataState != null && message.hasOwnProperty("dataState")) + object.dataState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] === undefined ? message.dataState : $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] : message.dataState; + if (message.pageOptimizationConfig != null && message.hasOwnProperty("pageOptimizationConfig")) { + object.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.toObject(message.pageOptimizationConfig, options); + if (options.oneofs) + object.trainingConfig = "pageOptimizationConfig"; + } + if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) + object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] === undefined ? message.filteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; + if (message.servingConfigLists && message.servingConfigLists.length) { + object.servingConfigLists = []; + for (var j = 0; j < message.servingConfigLists.length; ++j) + object.servingConfigLists[j] = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.toObject(message.servingConfigLists[j], options); + } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) + object.modelFeaturesConfig = $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.toObject(message.modelFeaturesConfig, options); return object; }; /** - * Converts this GetControlRequest to JSON. + * Converts this Model to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @instance * @returns {Object.} JSON object */ - GetControlRequest.prototype.toJSON = function toJSON() { + Model.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetControlRequest + * Gets the default type url for Model * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetControlRequest + * @memberof google.cloud.retail.v2alpha.Model * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetControlRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model"; }; - return GetControlRequest; - })(); + Model.PageOptimizationConfig = (function() { - v2alpha.ListControlsRequest = (function() { + /** + * Properties of a PageOptimizationConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @interface IPageOptimizationConfig + * @property {string|null} [pageOptimizationEventType] PageOptimizationConfig pageOptimizationEventType + * @property {Array.|null} [panels] PageOptimizationConfig panels + * @property {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|null} [restriction] PageOptimizationConfig restriction + */ - /** - * Properties of a ListControlsRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IListControlsRequest - * @property {string|null} [parent] ListControlsRequest parent - * @property {number|null} [pageSize] ListControlsRequest pageSize - * @property {string|null} [pageToken] ListControlsRequest pageToken - * @property {string|null} [filter] ListControlsRequest filter - */ + /** + * Constructs a new PageOptimizationConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @classdesc Represents a PageOptimizationConfig. + * @implements IPageOptimizationConfig + * @constructor + * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig=} [properties] Properties to set + */ + function PageOptimizationConfig(properties) { + this.panels = []; + if (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 ListControlsRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListControlsRequest. - * @implements IListControlsRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IListControlsRequest=} [properties] Properties to set - */ - function ListControlsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * PageOptimizationConfig pageOptimizationEventType. + * @member {string} pageOptimizationEventType + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @instance + */ + PageOptimizationConfig.prototype.pageOptimizationEventType = ""; - /** - * ListControlsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @instance - */ - ListControlsRequest.prototype.parent = ""; + /** + * PageOptimizationConfig panels. + * @member {Array.} panels + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @instance + */ + PageOptimizationConfig.prototype.panels = $util.emptyArray; - /** - * ListControlsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @instance - */ - ListControlsRequest.prototype.pageSize = 0; + /** + * PageOptimizationConfig restriction. + * @member {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction} restriction + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @instance + */ + PageOptimizationConfig.prototype.restriction = 0; - /** - * ListControlsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @instance - */ - ListControlsRequest.prototype.pageToken = ""; + /** + * Creates a new PageOptimizationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig instance + */ + PageOptimizationConfig.create = function create(properties) { + return new PageOptimizationConfig(properties); + }; - /** - * ListControlsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @instance - */ - ListControlsRequest.prototype.filter = ""; + /** + * Encodes the specified PageOptimizationConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig} message PageOptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageOptimizationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageOptimizationEventType != null && Object.hasOwnProperty.call(message, "pageOptimizationEventType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pageOptimizationEventType); + if (message.panels != null && message.panels.length) + for (var i = 0; i < message.panels.length; ++i) + $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.encode(message.panels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.restriction != null && Object.hasOwnProperty.call(message, "restriction")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.restriction); + return writer; + }; - /** - * Creates a new ListControlsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {google.cloud.retail.v2alpha.IListControlsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest instance - */ - ListControlsRequest.create = function create(properties) { - return new ListControlsRequest(properties); - }; + /** + * Encodes the specified PageOptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig} message PageOptimizationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageOptimizationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ListControlsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {google.cloud.retail.v2alpha.IListControlsRequest} message ListControlsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListControlsRequest.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; - }; + /** + * Decodes a PageOptimizationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageOptimizationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageOptimizationEventType = reader.string(); + break; + } + case 2: { + if (!(message.panels && message.panels.length)) + message.panels = []; + message.panels.push($root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.decode(reader, reader.uint32())); + break; + } + case 3: { + message.restriction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListControlsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {google.cloud.retail.v2alpha.IListControlsRequest} message ListControlsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListControlsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a PageOptimizationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageOptimizationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a ListControlsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListControlsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListControlsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); + /** + * Verifies a PageOptimizationConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageOptimizationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageOptimizationEventType != null && message.hasOwnProperty("pageOptimizationEventType")) + if (!$util.isString(message.pageOptimizationEventType)) + return "pageOptimizationEventType: string expected"; + if (message.panels != null && message.hasOwnProperty("panels")) { + if (!Array.isArray(message.panels)) + return "panels: array expected"; + for (var i = 0; i < message.panels.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify(message.panels[i]); + if (error) + return "panels." + error; + } + } + if (message.restriction != null && message.hasOwnProperty("restriction")) + switch (message.restriction) { + default: + return "restriction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: break; } - case 2: { - message.pageSize = reader.int32(); + return null; + }; + + /** + * Creates a PageOptimizationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig + */ + PageOptimizationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig(); + if (object.pageOptimizationEventType != null) + message.pageOptimizationEventType = String(object.pageOptimizationEventType); + if (object.panels) { + if (!Array.isArray(object.panels)) + throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.panels: array expected"); + message.panels = []; + for (var i = 0; i < object.panels.length; ++i) { + if (typeof object.panels[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.panels: object expected"); + message.panels[i] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.fromObject(object.panels[i]); + } + } + switch (object.restriction) { + default: + if (typeof object.restriction === "number") { + message.restriction = object.restriction; break; } - case 3: { - message.pageToken = reader.string(); - break; + break; + case "RESTRICTION_UNSPECIFIED": + case 0: + message.restriction = 0; + break; + case "NO_RESTRICTION": + case 1: + message.restriction = 1; + break; + case "UNIQUE_SERVING_CONFIG_RESTRICTION": + case 2: + message.restriction = 2; + break; + case "UNIQUE_MODEL_RESTRICTION": + case 3: + message.restriction = 3; + break; + case "UNIQUE_MODEL_TYPE_RESTRICTION": + case 4: + message.restriction = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a PageOptimizationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} message PageOptimizationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageOptimizationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.panels = []; + if (options.defaults) { + object.pageOptimizationEventType = ""; + object.restriction = options.enums === String ? "RESTRICTION_UNSPECIFIED" : 0; + } + if (message.pageOptimizationEventType != null && message.hasOwnProperty("pageOptimizationEventType")) + object.pageOptimizationEventType = message.pageOptimizationEventType; + if (message.panels && message.panels.length) { + object.panels = []; + for (var j = 0; j < message.panels.length; ++j) + object.panels[j] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.toObject(message.panels[j], options); + } + if (message.restriction != null && message.hasOwnProperty("restriction")) + object.restriction = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] === undefined ? message.restriction : $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] : message.restriction; + return object; + }; + + /** + * Converts this PageOptimizationConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @instance + * @returns {Object.} JSON object + */ + PageOptimizationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageOptimizationConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageOptimizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig"; + }; + + PageOptimizationConfig.Candidate = (function() { + + /** + * Properties of a Candidate. + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @interface ICandidate + * @property {string|null} [servingConfigId] Candidate servingConfigId + */ + + /** + * Constructs a new Candidate. + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @classdesc Represents a Candidate. + * @implements ICandidate + * @constructor + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate=} [properties] Properties to set + */ + function Candidate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Candidate servingConfigId. + * @member {string|null|undefined} servingConfigId + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @instance + */ + Candidate.prototype.servingConfigId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Candidate candidate. + * @member {"servingConfigId"|undefined} candidate + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @instance + */ + Object.defineProperty(Candidate.prototype, "candidate", { + get: $util.oneOfGetter($oneOfFields = ["servingConfigId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Candidate instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate instance + */ + Candidate.create = function create(properties) { + return new Candidate(properties); + }; + + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate} message Candidate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Candidate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfigId != null && Object.hasOwnProperty.call(message, "servingConfigId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfigId); + return writer; + }; + + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate} message Candidate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Candidate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Candidate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Candidate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.servingConfigId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Candidate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Candidate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Candidate message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Candidate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) { + properties.candidate = 1; + if (!$util.isString(message.servingConfigId)) + return "servingConfigId: string expected"; } - case 4: { - message.filter = reader.string(); - break; + return null; + }; + + /** + * Creates a Candidate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate + */ + Candidate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate) + return object; + var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate(); + if (object.servingConfigId != null) + message.servingConfigId = String(object.servingConfigId); + return message; + }; + + /** + * Creates a plain object from a Candidate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} message Candidate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Candidate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) { + object.servingConfigId = message.servingConfigId; + if (options.oneofs) + object.candidate = "servingConfigId"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return object; + }; - /** - * Decodes a ListControlsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListControlsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this Candidate to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @instance + * @returns {Object.} JSON object + */ + Candidate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a ListControlsRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListControlsRequest.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; - }; + /** + * Gets the default type url for Candidate + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate"; + }; - /** - * Creates a ListControlsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListControlsRequest} ListControlsRequest - */ - ListControlsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListControlsRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.ListControlsRequest(); - 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; - }; + return Candidate; + })(); - /** - * Creates a plain object from a ListControlsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {google.cloud.retail.v2alpha.ListControlsRequest} message ListControlsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListControlsRequest.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; - }; + PageOptimizationConfig.Panel = (function() { - /** - * Converts this ListControlsRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @instance - * @returns {Object.} JSON object - */ - ListControlsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a Panel. + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @interface IPanel + * @property {string|null} [displayName] Panel displayName + * @property {Array.|null} [candidates] Panel candidates + * @property {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null} [defaultCandidate] Panel defaultCandidate + */ - /** - * Gets the default type url for ListControlsRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListControlsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListControlsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListControlsRequest"; - }; + /** + * Constructs a new Panel. + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig + * @classdesc Represents a Panel. + * @implements IPanel + * @constructor + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel=} [properties] Properties to set + */ + function Panel(properties) { + this.candidates = []; + if (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 ListControlsRequest; - })(); + /** + * Panel displayName. + * @member {string} displayName + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @instance + */ + Panel.prototype.displayName = ""; - v2alpha.ListControlsResponse = (function() { + /** + * Panel candidates. + * @member {Array.} candidates + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @instance + */ + Panel.prototype.candidates = $util.emptyArray; - /** - * Properties of a ListControlsResponse. - * @memberof google.cloud.retail.v2alpha - * @interface IListControlsResponse - * @property {Array.|null} [controls] ListControlsResponse controls - * @property {string|null} [nextPageToken] ListControlsResponse nextPageToken - */ + /** + * Panel defaultCandidate. + * @member {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null|undefined} defaultCandidate + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @instance + */ + Panel.prototype.defaultCandidate = null; - /** - * Constructs a new ListControlsResponse. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListControlsResponse. - * @implements IListControlsResponse - * @constructor - * @param {google.cloud.retail.v2alpha.IListControlsResponse=} [properties] Properties to set - */ - function ListControlsResponse(properties) { - this.controls = []; - if (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 Panel instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel instance + */ + Panel.create = function create(properties) { + return new Panel(properties); + }; - /** - * ListControlsResponse controls. - * @member {Array.} controls - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @instance - */ - ListControlsResponse.prototype.controls = $util.emptyArray; + /** + * Encodes the specified Panel message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel} message Panel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Panel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.encode(message.candidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultCandidate != null && Object.hasOwnProperty.call(message, "defaultCandidate")) + $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.encode(message.defaultCandidate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * ListControlsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @instance - */ - ListControlsResponse.prototype.nextPageToken = ""; + /** + * Encodes the specified Panel message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel} message Panel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Panel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ListControlsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListControlsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse instance - */ - ListControlsResponse.create = function create(properties) { - return new ListControlsResponse(properties); - }; + /** + * Decodes a Panel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Panel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.decode(reader, reader.uint32())); + break; + } + case 3: { + message.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListControlsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListControlsResponse} message ListControlsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListControlsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.controls != null && message.controls.length) - for (var i = 0; i < message.controls.length; ++i) - $root.google.cloud.retail.v2alpha.Control.encode(message.controls[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; - }; + /** + * Decodes a Panel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Panel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListControlsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListControlsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {google.cloud.retail.v2alpha.IListControlsResponse} message ListControlsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListControlsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a Panel message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Panel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.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.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.defaultCandidate != null && message.hasOwnProperty("defaultCandidate")) { + var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify(message.defaultCandidate); + if (error) + return "defaultCandidate." + error; + } + return null; + }; - /** - * Decodes a ListControlsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListControlsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListControlsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.controls && message.controls.length)) - message.controls = []; - message.controls.push($root.google.cloud.retail.v2alpha.Control.decode(reader, reader.uint32())); - break; + /** + * Creates a Panel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel + */ + Panel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel) + return object; + var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.candidates: object expected"); + message.candidates[i] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.fromObject(object.candidates[i]); + } } - case 2: { - message.nextPageToken = reader.string(); - break; + if (object.defaultCandidate != null) { + if (typeof object.defaultCandidate !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.defaultCandidate: object expected"); + message.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.fromObject(object.defaultCandidate); } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return message; + }; - /** - * Decodes a ListControlsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListControlsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a Panel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} message Panel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Panel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (options.defaults) { + object.displayName = ""; + object.defaultCandidate = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.toObject(message.candidates[j], options); + } + if (message.defaultCandidate != null && message.hasOwnProperty("defaultCandidate")) + object.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.toObject(message.defaultCandidate, options); + return object; + }; - /** - * Verifies a ListControlsResponse message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListControlsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.controls != null && message.hasOwnProperty("controls")) { - if (!Array.isArray(message.controls)) - return "controls: array expected"; - for (var i = 0; i < message.controls.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Control.verify(message.controls[i]); - if (error) - return "controls." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * Converts this Panel to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @instance + * @returns {Object.} JSON object + */ + Panel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a ListControlsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListControlsResponse} ListControlsResponse - */ - ListControlsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListControlsResponse) - return object; - var message = new $root.google.cloud.retail.v2alpha.ListControlsResponse(); - if (object.controls) { - if (!Array.isArray(object.controls)) - throw TypeError(".google.cloud.retail.v2alpha.ListControlsResponse.controls: array expected"); - message.controls = []; - for (var i = 0; i < object.controls.length; ++i) { - if (typeof object.controls[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListControlsResponse.controls: object expected"); - message.controls[i] = $root.google.cloud.retail.v2alpha.Control.fromObject(object.controls[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + /** + * Gets the default type url for Panel + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Panel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel"; + }; - /** - * Creates a plain object from a ListControlsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {google.cloud.retail.v2alpha.ListControlsResponse} message ListControlsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListControlsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.controls = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.controls && message.controls.length) { - object.controls = []; - for (var j = 0; j < message.controls.length; ++j) - object.controls[j] = $root.google.cloud.retail.v2alpha.Control.toObject(message.controls[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + return Panel; + })(); - /** - * Converts this ListControlsResponse to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @instance - * @returns {Object.} JSON object - */ - ListControlsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Restriction enum. + * @name google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction + * @enum {number} + * @property {number} RESTRICTION_UNSPECIFIED=0 RESTRICTION_UNSPECIFIED value + * @property {number} NO_RESTRICTION=1 NO_RESTRICTION value + * @property {number} UNIQUE_SERVING_CONFIG_RESTRICTION=2 UNIQUE_SERVING_CONFIG_RESTRICTION value + * @property {number} UNIQUE_MODEL_RESTRICTION=3 UNIQUE_MODEL_RESTRICTION value + * @property {number} UNIQUE_MODEL_TYPE_RESTRICTION=4 UNIQUE_MODEL_TYPE_RESTRICTION value + */ + PageOptimizationConfig.Restriction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESTRICTION"] = 1; + values[valuesById[2] = "UNIQUE_SERVING_CONFIG_RESTRICTION"] = 2; + values[valuesById[3] = "UNIQUE_MODEL_RESTRICTION"] = 3; + values[valuesById[4] = "UNIQUE_MODEL_TYPE_RESTRICTION"] = 4; + return values; + })(); - /** - * Gets the default type url for ListControlsResponse - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListControlsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListControlsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + return PageOptimizationConfig; + })(); + + Model.ServingConfigList = (function() { + + /** + * Properties of a ServingConfigList. + * @memberof google.cloud.retail.v2alpha.Model + * @interface IServingConfigList + * @property {Array.|null} [servingConfigIds] ServingConfigList servingConfigIds + */ + + /** + * Constructs a new ServingConfigList. + * @memberof google.cloud.retail.v2alpha.Model + * @classdesc Represents a ServingConfigList. + * @implements IServingConfigList + * @constructor + * @param {google.cloud.retail.v2alpha.Model.IServingConfigList=} [properties] Properties to set + */ + function ServingConfigList(properties) { + this.servingConfigIds = []; + if (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 typeUrlPrefix + "/google.cloud.retail.v2alpha.ListControlsResponse"; - }; - return ListControlsResponse; - })(); + /** + * ServingConfigList servingConfigIds. + * @member {Array.} servingConfigIds + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @instance + */ + ServingConfigList.prototype.servingConfigIds = $util.emptyArray; - v2alpha.MerchantCenterAccountLink = (function() { + /** + * Creates a new ServingConfigList instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {google.cloud.retail.v2alpha.Model.IServingConfigList=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList instance + */ + ServingConfigList.create = function create(properties) { + return new ServingConfigList(properties); + }; - /** - * Properties of a MerchantCenterAccountLink. - * @memberof google.cloud.retail.v2alpha - * @interface IMerchantCenterAccountLink - * @property {string|null} [name] MerchantCenterAccountLink name - * @property {string|null} [id] MerchantCenterAccountLink id - * @property {number|Long|null} [merchantCenterAccountId] MerchantCenterAccountLink merchantCenterAccountId - * @property {string|null} [branchId] MerchantCenterAccountLink branchId - * @property {string|null} [feedLabel] MerchantCenterAccountLink feedLabel - * @property {string|null} [languageCode] MerchantCenterAccountLink languageCode - * @property {Array.|null} [feedFilters] MerchantCenterAccountLink feedFilters - * @property {google.cloud.retail.v2alpha.MerchantCenterAccountLink.State|null} [state] MerchantCenterAccountLink state - * @property {string|null} [projectId] MerchantCenterAccountLink projectId - */ + /** + * Encodes the specified ServingConfigList message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {google.cloud.retail.v2alpha.Model.IServingConfigList} message ServingConfigList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServingConfigList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfigIds != null && message.servingConfigIds.length) + for (var i = 0; i < message.servingConfigIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfigIds[i]); + return writer; + }; - /** - * Constructs a new MerchantCenterAccountLink. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterAccountLink. - * @implements IMerchantCenterAccountLink - * @constructor - * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink=} [properties] Properties to set - */ - function MerchantCenterAccountLink(properties) { - this.feedFilters = []; - if (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 ServingConfigList message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {google.cloud.retail.v2alpha.Model.IServingConfigList} message ServingConfigList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServingConfigList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * MerchantCenterAccountLink name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.name = ""; + /** + * Decodes a ServingConfigList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServingConfigList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.ServingConfigList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.servingConfigIds && message.servingConfigIds.length)) + message.servingConfigIds = []; + message.servingConfigIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * MerchantCenterAccountLink id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.id = ""; + /** + * Decodes a ServingConfigList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServingConfigList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * MerchantCenterAccountLink merchantCenterAccountId. - * @member {number|Long} merchantCenterAccountId - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.merchantCenterAccountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Verifies a ServingConfigList message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServingConfigList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfigIds != null && message.hasOwnProperty("servingConfigIds")) { + if (!Array.isArray(message.servingConfigIds)) + return "servingConfigIds: array expected"; + for (var i = 0; i < message.servingConfigIds.length; ++i) + if (!$util.isString(message.servingConfigIds[i])) + return "servingConfigIds: string[] expected"; + } + return null; + }; - /** - * MerchantCenterAccountLink branchId. - * @member {string} branchId - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.branchId = ""; + /** + * Creates a ServingConfigList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList + */ + ServingConfigList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.ServingConfigList) + return object; + var message = new $root.google.cloud.retail.v2alpha.Model.ServingConfigList(); + if (object.servingConfigIds) { + if (!Array.isArray(object.servingConfigIds)) + throw TypeError(".google.cloud.retail.v2alpha.Model.ServingConfigList.servingConfigIds: array expected"); + message.servingConfigIds = []; + for (var i = 0; i < object.servingConfigIds.length; ++i) + message.servingConfigIds[i] = String(object.servingConfigIds[i]); + } + return message; + }; - /** - * MerchantCenterAccountLink feedLabel. - * @member {string} feedLabel - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.feedLabel = ""; + /** + * Creates a plain object from a ServingConfigList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {google.cloud.retail.v2alpha.Model.ServingConfigList} message ServingConfigList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServingConfigList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.servingConfigIds = []; + if (message.servingConfigIds && message.servingConfigIds.length) { + object.servingConfigIds = []; + for (var j = 0; j < message.servingConfigIds.length; ++j) + object.servingConfigIds[j] = message.servingConfigIds[j]; + } + return object; + }; - /** - * MerchantCenterAccountLink languageCode. - * @member {string} languageCode - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.languageCode = ""; + /** + * Converts this ServingConfigList to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @instance + * @returns {Object.} JSON object + */ + ServingConfigList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MerchantCenterAccountLink feedFilters. - * @member {Array.} feedFilters - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.feedFilters = $util.emptyArray; + /** + * Gets the default type url for ServingConfigList + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServingConfigList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.ServingConfigList"; + }; - /** - * MerchantCenterAccountLink state. - * @member {google.cloud.retail.v2alpha.MerchantCenterAccountLink.State} state - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.state = 0; + return ServingConfigList; + })(); - /** - * MerchantCenterAccountLink projectId. - * @member {string} projectId - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - */ - MerchantCenterAccountLink.prototype.projectId = ""; + Model.FrequentlyBoughtTogetherFeaturesConfig = (function() { - /** - * Creates a new MerchantCenterAccountLink instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink instance - */ - MerchantCenterAccountLink.create = function create(properties) { - return new MerchantCenterAccountLink(properties); - }; + /** + * Properties of a FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @interface IFrequentlyBoughtTogetherFeaturesConfig + * @property {google.cloud.retail.v2alpha.Model.ContextProductsType|null} [contextProductsType] FrequentlyBoughtTogetherFeaturesConfig contextProductsType + */ - /** - * Encodes the specified MerchantCenterAccountLink message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink} message MerchantCenterAccountLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterAccountLink.encode = function encode(message, writer) { - 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.merchantCenterAccountId != null && Object.hasOwnProperty.call(message, "merchantCenterAccountId")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.merchantCenterAccountId); - if (message.branchId != null && Object.hasOwnProperty.call(message, "branchId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.branchId); - if (message.feedLabel != null && Object.hasOwnProperty.call(message, "feedLabel")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.feedLabel); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); - if (message.feedFilters != null && message.feedFilters.length) - for (var i = 0; i < message.feedFilters.length; ++i) - $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.encode(message.feedFilters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.id); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.projectId); - return writer; - }; + /** + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @classdesc Represents a FrequentlyBoughtTogetherFeaturesConfig. + * @implements IFrequentlyBoughtTogetherFeaturesConfig + * @constructor + * @param {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + */ + function FrequentlyBoughtTogetherFeaturesConfig(properties) { + if (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 MerchantCenterAccountLink message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {google.cloud.retail.v2alpha.IMerchantCenterAccountLink} message MerchantCenterAccountLink message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MerchantCenterAccountLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FrequentlyBoughtTogetherFeaturesConfig contextProductsType. + * @member {google.cloud.retail.v2alpha.Model.ContextProductsType} contextProductsType + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.contextProductsType = 0; - /** - * Decodes a MerchantCenterAccountLink message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterAccountLink.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 8: { - message.id = reader.string(); - break; - } - case 2: { - message.merchantCenterAccountId = reader.int64(); - break; - } - case 3: { - message.branchId = reader.string(); - break; - } - case 4: { - message.feedLabel = reader.string(); - break; - } - case 5: { - message.languageCode = reader.string(); - break; - } - case 6: { - if (!(message.feedFilters && message.feedFilters.length)) - message.feedFilters = []; - message.feedFilters.push($root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.decode(reader, reader.uint32())); + /** + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig instance + */ + FrequentlyBoughtTogetherFeaturesConfig.create = function create(properties) { + return new FrequentlyBoughtTogetherFeaturesConfig(properties); + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contextProductsType != null && Object.hasOwnProperty.call(message, "contextProductsType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.contextProductsType); + return writer; + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.contextProductsType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 7: { - message.state = reader.int32(); + } + return message; + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. + * @function verify + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FrequentlyBoughtTogetherFeaturesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + switch (message.contextProductsType) { + default: + return "contextProductsType: enum value expected"; + case 0: + case 1: + case 2: break; } - case 9: { - message.projectId = reader.string(); + return null; + }; + + /** + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + */ + FrequentlyBoughtTogetherFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig) + return object; + var message = new $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig(); + switch (object.contextProductsType) { + default: + if (typeof object.contextProductsType === "number") { + message.contextProductsType = object.contextProductsType; break; } - default: - reader.skipType(tag & 7); break; - } - } - return message; - }; - - /** - * Decodes a MerchantCenterAccountLink message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MerchantCenterAccountLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MerchantCenterAccountLink message. - * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MerchantCenterAccountLink.verify = function verify(message) { - if (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.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (!$util.isInteger(message.merchantCenterAccountId) && !(message.merchantCenterAccountId && $util.isInteger(message.merchantCenterAccountId.low) && $util.isInteger(message.merchantCenterAccountId.high))) - return "merchantCenterAccountId: integer|Long expected"; - if (message.branchId != null && message.hasOwnProperty("branchId")) - if (!$util.isString(message.branchId)) - return "branchId: string expected"; - if (message.feedLabel != null && message.hasOwnProperty("feedLabel")) - if (!$util.isString(message.feedLabel)) - return "feedLabel: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.feedFilters != null && message.hasOwnProperty("feedFilters")) { - if (!Array.isArray(message.feedFilters)) - return "feedFilters: array expected"; - for (var i = 0; i < message.feedFilters.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify(message.feedFilters[i]); - if (error) - return "feedFilters." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; + case "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": case 0: + message.contextProductsType = 0; + break; + case "SINGLE_CONTEXT_PRODUCT": case 1: + message.contextProductsType = 1; + break; + case "MULTIPLE_CONTEXT_PRODUCTS": case 2: - case 3: + message.contextProductsType = 2; break; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - return null; - }; + return message; + }; - /** - * Creates a MerchantCenterAccountLink message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink} MerchantCenterAccountLink - */ - MerchantCenterAccountLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink) + /** + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FrequentlyBoughtTogetherFeaturesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contextProductsType = options.enums === String ? "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" : 0; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + object.contextProductsType = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.ContextProductsType[message.contextProductsType] === undefined ? message.contextProductsType : $root.google.cloud.retail.v2alpha.Model.ContextProductsType[message.contextProductsType] : message.contextProductsType; return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink(); - if (object.name != null) - message.name = String(object.name); - if (object.id != null) - message.id = String(object.id); - if (object.merchantCenterAccountId != null) - if ($util.Long) - (message.merchantCenterAccountId = $util.Long.fromValue(object.merchantCenterAccountId)).unsigned = false; - else if (typeof object.merchantCenterAccountId === "string") - message.merchantCenterAccountId = parseInt(object.merchantCenterAccountId, 10); - else if (typeof object.merchantCenterAccountId === "number") - message.merchantCenterAccountId = object.merchantCenterAccountId; - else if (typeof object.merchantCenterAccountId === "object") - message.merchantCenterAccountId = new $util.LongBits(object.merchantCenterAccountId.low >>> 0, object.merchantCenterAccountId.high >>> 0).toNumber(); - if (object.branchId != null) - message.branchId = String(object.branchId); - if (object.feedLabel != null) - message.feedLabel = String(object.feedLabel); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.feedFilters) { - if (!Array.isArray(object.feedFilters)) - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterAccountLink.feedFilters: array expected"); - message.feedFilters = []; - for (var i = 0; i < object.feedFilters.length; ++i) { - if (typeof object.feedFilters[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.MerchantCenterAccountLink.feedFilters: object expected"); - message.feedFilters[i] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.fromObject(object.feedFilters[i]); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "FAILED": - case 3: - message.state = 3; - break; - } - if (object.projectId != null) - message.projectId = String(object.projectId); - return message; - }; + }; - /** - * Creates a plain object from a MerchantCenterAccountLink message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink} message MerchantCenterAccountLink - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MerchantCenterAccountLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.feedFilters = []; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.merchantCenterAccountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.merchantCenterAccountId = options.longs === String ? "0" : 0; - object.branchId = ""; - object.feedLabel = ""; - object.languageCode = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.id = ""; - object.projectId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.merchantCenterAccountId != null && message.hasOwnProperty("merchantCenterAccountId")) - if (typeof message.merchantCenterAccountId === "number") - object.merchantCenterAccountId = options.longs === String ? String(message.merchantCenterAccountId) : message.merchantCenterAccountId; - else - object.merchantCenterAccountId = options.longs === String ? $util.Long.prototype.toString.call(message.merchantCenterAccountId) : options.longs === Number ? new $util.LongBits(message.merchantCenterAccountId.low >>> 0, message.merchantCenterAccountId.high >>> 0).toNumber() : message.merchantCenterAccountId; - if (message.branchId != null && message.hasOwnProperty("branchId")) - object.branchId = message.branchId; - if (message.feedLabel != null && message.hasOwnProperty("feedLabel")) - object.feedLabel = message.feedLabel; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.feedFilters && message.feedFilters.length) { - object.feedFilters = []; - for (var j = 0; j < message.feedFilters.length; ++j) - object.feedFilters[j] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.toObject(message.feedFilters[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.State[message.state] === undefined ? message.state : $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.State[message.state] : message.state; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; + /** + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + * @returns {Object.} JSON object + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this MerchantCenterAccountLink to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @instance - * @returns {Object.} JSON object - */ - MerchantCenterAccountLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FrequentlyBoughtTogetherFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig"; + }; - /** - * Gets the default type url for MerchantCenterAccountLink - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MerchantCenterAccountLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterAccountLink"; - }; + return FrequentlyBoughtTogetherFeaturesConfig; + })(); - MerchantCenterAccountLink.MerchantCenterFeedFilter = (function() { + Model.ModelFeaturesConfig = (function() { /** - * Properties of a MerchantCenterFeedFilter. - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @interface IMerchantCenterFeedFilter - * @property {number|Long|null} [primaryFeedId] MerchantCenterFeedFilter primaryFeedId - * @property {string|null} [primaryFeedName] MerchantCenterFeedFilter primaryFeedName + * Properties of a ModelFeaturesConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @interface IModelFeaturesConfig + * @property {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig|null} [frequentlyBoughtTogetherConfig] ModelFeaturesConfig frequentlyBoughtTogetherConfig */ /** - * Constructs a new MerchantCenterFeedFilter. - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink - * @classdesc Represents a MerchantCenterFeedFilter. - * @implements IMerchantCenterFeedFilter + * Constructs a new ModelFeaturesConfig. + * @memberof google.cloud.retail.v2alpha.Model + * @classdesc Represents a ModelFeaturesConfig. + * @implements IModelFeaturesConfig * @constructor - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig=} [properties] Properties to set */ - function MerchantCenterFeedFilter(properties) { + function ModelFeaturesConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -79610,89 +90664,89 @@ } /** - * MerchantCenterFeedFilter primaryFeedId. - * @member {number|Long} primaryFeedId - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * ModelFeaturesConfig frequentlyBoughtTogetherConfig. + * @member {google.cloud.retail.v2alpha.Model.IFrequentlyBoughtTogetherFeaturesConfig|null|undefined} frequentlyBoughtTogetherConfig + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @instance */ - MerchantCenterFeedFilter.prototype.primaryFeedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ModelFeaturesConfig.prototype.frequentlyBoughtTogetherConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * MerchantCenterFeedFilter primaryFeedName. - * @member {string} primaryFeedName - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * ModelFeaturesConfig typeDedicatedConfig. + * @member {"frequentlyBoughtTogetherConfig"|undefined} typeDedicatedConfig + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @instance */ - MerchantCenterFeedFilter.prototype.primaryFeedName = ""; + Object.defineProperty(ModelFeaturesConfig.prototype, "typeDedicatedConfig", { + get: $util.oneOfGetter($oneOfFields = ["frequentlyBoughtTogetherConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new MerchantCenterFeedFilter instance using the specified properties. + * Creates a new ModelFeaturesConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter instance + * @param {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Model.ModelFeaturesConfig} ModelFeaturesConfig instance */ - MerchantCenterFeedFilter.create = function create(properties) { - return new MerchantCenterFeedFilter(properties); + ModelFeaturesConfig.create = function create(properties) { + return new ModelFeaturesConfig(properties); }; /** - * Encodes the specified MerchantCenterFeedFilter message. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode + * @param {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MerchantCenterFeedFilter.encode = function encode(message, writer) { + ModelFeaturesConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primaryFeedId != null && Object.hasOwnProperty.call(message, "primaryFeedId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.primaryFeedId); - if (message.primaryFeedName != null && Object.hasOwnProperty.call(message, "primaryFeedName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.primaryFeedName); + if (message.frequentlyBoughtTogetherConfig != null && Object.hasOwnProperty.call(message, "frequentlyBoughtTogetherConfig")) + $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.encode(message.frequentlyBoughtTogetherConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MerchantCenterFeedFilter message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter.verify|verify} messages. + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.IMerchantCenterFeedFilter} message MerchantCenterFeedFilter message or plain object to encode + * @param {google.cloud.retail.v2alpha.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MerchantCenterFeedFilter.encodeDelimited = function encodeDelimited(message, writer) { + ModelFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer. + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter + * @returns {google.cloud.retail.v2alpha.Model.ModelFeaturesConfig} ModelFeaturesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MerchantCenterFeedFilter.decode = function decode(reader, length) { + ModelFeaturesConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.primaryFeedId = reader.int64(); - break; - } - case 2: { - message.primaryFeedName = reader.string(); + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.decode(reader, reader.uint32()); break; } default: @@ -79704,167 +90758,520 @@ }; /** - * Decodes a MerchantCenterFeedFilter message from the specified reader or buffer, length delimited. + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter + * @returns {google.cloud.retail.v2alpha.Model.ModelFeaturesConfig} ModelFeaturesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MerchantCenterFeedFilter.decodeDelimited = function decodeDelimited(reader) { + ModelFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MerchantCenterFeedFilter message. + * Verifies a ModelFeaturesConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MerchantCenterFeedFilter.verify = function verify(message) { + ModelFeaturesConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) - if (!$util.isInteger(message.primaryFeedId) && !(message.primaryFeedId && $util.isInteger(message.primaryFeedId.low) && $util.isInteger(message.primaryFeedId.high))) - return "primaryFeedId: integer|Long expected"; - if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) - if (!$util.isString(message.primaryFeedName)) - return "primaryFeedName: string expected"; + var properties = {}; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + properties.typeDedicatedConfig = 1; + { + var error = $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.verify(message.frequentlyBoughtTogetherConfig); + if (error) + return "frequentlyBoughtTogetherConfig." + error; + } + } return null; }; /** - * Creates a MerchantCenterFeedFilter message from a plain object. Also converts values to their respective internal types. + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} MerchantCenterFeedFilter + * @returns {google.cloud.retail.v2alpha.Model.ModelFeaturesConfig} ModelFeaturesConfig */ - MerchantCenterFeedFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter) + ModelFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter(); - if (object.primaryFeedId != null) - if ($util.Long) - (message.primaryFeedId = $util.Long.fromValue(object.primaryFeedId)).unsigned = false; - else if (typeof object.primaryFeedId === "string") - message.primaryFeedId = parseInt(object.primaryFeedId, 10); - else if (typeof object.primaryFeedId === "number") - message.primaryFeedId = object.primaryFeedId; - else if (typeof object.primaryFeedId === "object") - message.primaryFeedId = new $util.LongBits(object.primaryFeedId.low >>> 0, object.primaryFeedId.high >>> 0).toNumber(); - if (object.primaryFeedName != null) - message.primaryFeedName = String(object.primaryFeedName); + var message = new $root.google.cloud.retail.v2alpha.Model.ModelFeaturesConfig(); + if (object.frequentlyBoughtTogetherConfig != null) { + if (typeof object.frequentlyBoughtTogetherConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.Model.ModelFeaturesConfig.frequentlyBoughtTogetherConfig: object expected"); + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.fromObject(object.frequentlyBoughtTogetherConfig); + } return message; }; /** - * Creates a plain object from a MerchantCenterFeedFilter message. Also converts values to other types if specified. + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter} message MerchantCenterFeedFilter + * @param {google.cloud.retail.v2alpha.Model.ModelFeaturesConfig} message ModelFeaturesConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MerchantCenterFeedFilter.toObject = function toObject(message, options) { + ModelFeaturesConfig.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.primaryFeedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.primaryFeedId = options.longs === String ? "0" : 0; - object.primaryFeedName = ""; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + object.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2alpha.Model.FrequentlyBoughtTogetherFeaturesConfig.toObject(message.frequentlyBoughtTogetherConfig, options); + if (options.oneofs) + object.typeDedicatedConfig = "frequentlyBoughtTogetherConfig"; } - if (message.primaryFeedId != null && message.hasOwnProperty("primaryFeedId")) - if (typeof message.primaryFeedId === "number") - object.primaryFeedId = options.longs === String ? String(message.primaryFeedId) : message.primaryFeedId; - else - object.primaryFeedId = options.longs === String ? $util.Long.prototype.toString.call(message.primaryFeedId) : options.longs === Number ? new $util.LongBits(message.primaryFeedId.low >>> 0, message.primaryFeedId.high >>> 0).toNumber() : message.primaryFeedId; - if (message.primaryFeedName != null && message.hasOwnProperty("primaryFeedName")) - object.primaryFeedName = message.primaryFeedName; return object; }; /** - * Converts this MerchantCenterFeedFilter to JSON. + * Converts this ModelFeaturesConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @instance * @returns {Object.} JSON object */ - MerchantCenterFeedFilter.prototype.toJSON = function toJSON() { + ModelFeaturesConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MerchantCenterFeedFilter + * Gets the default type url for ModelFeaturesConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter + * @memberof google.cloud.retail.v2alpha.Model.ModelFeaturesConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MerchantCenterFeedFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ModelFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.MerchantCenterAccountLink.MerchantCenterFeedFilter"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.ModelFeaturesConfig"; }; - return MerchantCenterFeedFilter; + return ModelFeaturesConfig; })(); /** - * State enum. - * @name google.cloud.retail.v2alpha.MerchantCenterAccountLink.State + * ServingState enum. + * @name google.cloud.retail.v2alpha.Model.ServingState * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value + * @property {number} SERVING_STATE_UNSPECIFIED=0 SERVING_STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value * @property {number} ACTIVE=2 ACTIVE value - * @property {number} FAILED=3 FAILED value + * @property {number} TUNED=3 TUNED value */ - MerchantCenterAccountLink.State = (function() { + Model.ServingState = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; + values[valuesById[0] = "SERVING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; values[valuesById[2] = "ACTIVE"] = 2; - values[valuesById[3] = "FAILED"] = 3; + values[valuesById[3] = "TUNED"] = 3; return values; })(); - return MerchantCenterAccountLink; + /** + * TrainingState enum. + * @name google.cloud.retail.v2alpha.Model.TrainingState + * @enum {number} + * @property {number} TRAINING_STATE_UNSPECIFIED=0 TRAINING_STATE_UNSPECIFIED value + * @property {number} PAUSED=1 PAUSED value + * @property {number} TRAINING=2 TRAINING value + */ + Model.TrainingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAINING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PAUSED"] = 1; + values[valuesById[2] = "TRAINING"] = 2; + return values; + })(); + + /** + * PeriodicTuningState enum. + * @name google.cloud.retail.v2alpha.Model.PeriodicTuningState + * @enum {number} + * @property {number} PERIODIC_TUNING_STATE_UNSPECIFIED=0 PERIODIC_TUNING_STATE_UNSPECIFIED value + * @property {number} PERIODIC_TUNING_DISABLED=1 PERIODIC_TUNING_DISABLED value + * @property {number} ALL_TUNING_DISABLED=3 ALL_TUNING_DISABLED value + * @property {number} PERIODIC_TUNING_ENABLED=2 PERIODIC_TUNING_ENABLED value + */ + Model.PeriodicTuningState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIODIC_TUNING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PERIODIC_TUNING_DISABLED"] = 1; + values[valuesById[3] = "ALL_TUNING_DISABLED"] = 3; + values[valuesById[2] = "PERIODIC_TUNING_ENABLED"] = 2; + return values; + })(); + + /** + * DataState enum. + * @name google.cloud.retail.v2alpha.Model.DataState + * @enum {number} + * @property {number} DATA_STATE_UNSPECIFIED=0 DATA_STATE_UNSPECIFIED value + * @property {number} DATA_OK=1 DATA_OK value + * @property {number} DATA_ERROR=2 DATA_ERROR value + */ + Model.DataState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATA_OK"] = 1; + values[valuesById[2] = "DATA_ERROR"] = 2; + return values; + })(); + + /** + * ContextProductsType enum. + * @name google.cloud.retail.v2alpha.Model.ContextProductsType + * @enum {number} + * @property {number} CONTEXT_PRODUCTS_TYPE_UNSPECIFIED=0 CONTEXT_PRODUCTS_TYPE_UNSPECIFIED value + * @property {number} SINGLE_CONTEXT_PRODUCT=1 SINGLE_CONTEXT_PRODUCT value + * @property {number} MULTIPLE_CONTEXT_PRODUCTS=2 MULTIPLE_CONTEXT_PRODUCTS value + */ + Model.ContextProductsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SINGLE_CONTEXT_PRODUCT"] = 1; + values[valuesById[2] = "MULTIPLE_CONTEXT_PRODUCTS"] = 2; + return values; + })(); + + return Model; })(); - v2alpha.CreateMerchantCenterAccountLinkMetadata = (function() { + v2alpha.ModelService = (function() { /** - * Properties of a CreateMerchantCenterAccountLinkMetadata. + * Constructs a new ModelService service. * @memberof google.cloud.retail.v2alpha - * @interface ICreateMerchantCenterAccountLinkMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] CreateMerchantCenterAccountLinkMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CreateMerchantCenterAccountLinkMetadata updateTime + * @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); + } + + (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService; /** - * Constructs a new CreateMerchantCenterAccountLinkMetadata. + * Creates new ModelService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.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); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|createModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.retail.v2alpha.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|getModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.GetModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|pauseModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef PauseModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Model} [response] Model + */ + + /** + * Calls PauseModel. + * @function pauseModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IPauseModelRequest} request PauseModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.PauseModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.pauseModel = function pauseModel(request, callback) { + return this.rpcCall(pauseModel, $root.google.cloud.retail.v2alpha.PauseModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); + }, "name", { value: "PauseModel" }); + + /** + * Calls PauseModel. + * @function pauseModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IPauseModelRequest} request PauseModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|resumeModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef ResumeModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Model} [response] Model + */ + + /** + * Calls ResumeModel. + * @function resumeModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IResumeModelRequest} request ResumeModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.ResumeModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.resumeModel = function resumeModel(request, callback) { + return this.rpcCall(resumeModel, $root.google.cloud.retail.v2alpha.ResumeModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); + }, "name", { value: "ResumeModel" }); + + /** + * Calls ResumeModel. + * @function resumeModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IResumeModelRequest} request ResumeModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|deleteModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.DeleteModelCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.retail.v2alpha.DeleteModelRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|listModels}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.ListModelsRequest, $root.google.cloud.retail.v2alpha.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|updateModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef UpdateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Model} [response] Model + */ + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.updateModel = function updateModel(request, callback) { + return this.rpcCall(updateModel, $root.google.cloud.retail.v2alpha.UpdateModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); + }, "name", { value: "UpdateModel" }); + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|tuneModel}. + * @memberof google.cloud.retail.v2alpha.ModelService + * @typedef TuneModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TuneModel. + * @function tuneModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.ITuneModelRequest} request TuneModelRequest message or plain object + * @param {google.cloud.retail.v2alpha.ModelService.TuneModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.tuneModel = function tuneModel(request, callback) { + return this.rpcCall(tuneModel, $root.google.cloud.retail.v2alpha.TuneModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TuneModel" }); + + /** + * Calls TuneModel. + * @function tuneModel + * @memberof google.cloud.retail.v2alpha.ModelService + * @instance + * @param {google.cloud.retail.v2alpha.ITuneModelRequest} request TuneModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ModelService; + })(); + + v2alpha.CreateModelRequest = (function() { + + /** + * Properties of a CreateModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateMerchantCenterAccountLinkMetadata. - * @implements ICreateMerchantCenterAccountLinkMetadata + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.retail.v2alpha.IModel|null} [model] CreateModelRequest model + * @property {boolean|null} [dryRun] CreateModelRequest dryRun + */ + + /** + * Constructs a new CreateModelRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICreateModelRequest=} [properties] Properties to set */ - function CreateMerchantCenterAccountLinkMetadata(properties) { + function CreateModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -79872,89 +91279,103 @@ } /** - * CreateMerchantCenterAccountLinkMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @instance */ - CreateMerchantCenterAccountLinkMetadata.prototype.createTime = null; + CreateModelRequest.prototype.parent = ""; /** - * CreateMerchantCenterAccountLinkMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * CreateModelRequest model. + * @member {google.cloud.retail.v2alpha.IModel|null|undefined} model + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @instance */ - CreateMerchantCenterAccountLinkMetadata.prototype.updateTime = null; + CreateModelRequest.prototype.model = null; /** - * Creates a new CreateMerchantCenterAccountLinkMetadata instance using the specified properties. + * CreateModelRequest dryRun. + * @member {boolean} dryRun + * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.dryRun = false; + + /** + * Creates a new CreateModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata instance + * @param {google.cloud.retail.v2alpha.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest instance */ - CreateMerchantCenterAccountLinkMetadata.create = function create(properties) { - return new CreateMerchantCenterAccountLinkMetadata(properties); + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); }; /** - * Encodes the specified CreateMerchantCenterAccountLinkMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateModelRequest} message CreateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMerchantCenterAccountLinkMetadata.encode = function encode(message, writer) { + CreateModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.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.retail.v2alpha.Model.encode(message.model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dryRun); return writer; }; /** - * Encodes the specified CreateMerchantCenterAccountLinkMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.verify|verify} messages. + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateModelRequest} message CreateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMerchantCenterAccountLinkMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer. + * Decodes a CreateModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata + * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMerchantCenterAccountLinkMetadata.decode = function decode(reader, length) { + 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.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.model = $root.google.cloud.retail.v2alpha.Model.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dryRun = reader.bool(); break; } default: @@ -79966,275 +91387,381 @@ }; /** - * Decodes a CreateMerchantCenterAccountLinkMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata + * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMerchantCenterAccountLinkMetadata.decodeDelimited = function decodeDelimited(reader) { + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMerchantCenterAccountLinkMetadata message. + * Verifies a CreateModelRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMerchantCenterAccountLinkMetadata.verify = function verify(message) { + CreateModelRequest.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.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + 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.retail.v2alpha.Model.verify(message.model); if (error) - return "updateTime." + error; + return "model." + error; } + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + if (typeof message.dryRun !== "boolean") + return "dryRun: boolean expected"; return null; }; /** - * Creates a CreateMerchantCenterAccountLinkMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} CreateMerchantCenterAccountLinkMetadata + * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest */ - CreateMerchantCenterAccountLinkMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata) + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateModelRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.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.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.retail.v2alpha.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.retail.v2alpha.Model.fromObject(object.model); } + if (object.dryRun != null) + message.dryRun = Boolean(object.dryRun); return message; }; /** - * Creates a plain object from a CreateMerchantCenterAccountLinkMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static - * @param {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata} message CreateMerchantCenterAccountLinkMetadata + * @param {google.cloud.retail.v2alpha.CreateModelRequest} message CreateModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMerchantCenterAccountLinkMetadata.toObject = function toObject(message, options) { + CreateModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.updateTime = null; + object.parent = ""; + object.model = null; + object.dryRun = false; } - 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.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.retail.v2alpha.Model.toObject(message.model, options); + if (message.dryRun != null && message.hasOwnProperty("dryRun")) + object.dryRun = message.dryRun; return object; }; /** - * Converts this CreateMerchantCenterAccountLinkMetadata to JSON. + * Converts this CreateModelRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @instance * @returns {Object.} JSON object */ - CreateMerchantCenterAccountLinkMetadata.prototype.toJSON = function toJSON() { + CreateModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateMerchantCenterAccountLinkMetadata + * Gets the default type url for CreateModelRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata + * @memberof google.cloud.retail.v2alpha.CreateModelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateMerchantCenterAccountLinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateModelRequest"; }; - return CreateMerchantCenterAccountLinkMetadata; + return CreateModelRequest; })(); - v2alpha.MerchantCenterAccountLinkService = (function() { + v2alpha.UpdateModelRequest = (function() { /** - * Constructs a new MerchantCenterAccountLinkService service. + * Properties of an UpdateModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a MerchantCenterAccountLinkService - * @extends $protobuf.rpc.Service + * @interface IUpdateModelRequest + * @property {google.cloud.retail.v2alpha.IModel|null} [model] UpdateModelRequest model + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask + */ + + /** + * Constructs a new UpdateModelRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an UpdateModelRequest. + * @implements IUpdateModelRequest * @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 + * @param {google.cloud.retail.v2alpha.IUpdateModelRequest=} [properties] Properties to set */ - function MerchantCenterAccountLinkService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + 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]]; } - (MerchantCenterAccountLinkService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MerchantCenterAccountLinkService; + /** + * UpdateModelRequest model. + * @member {google.cloud.retail.v2alpha.IModel|null|undefined} model + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.model = null; /** - * Creates new MerchantCenterAccountLinkService service using the specified rpc implementation. + * UpdateModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest * @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 {MerchantCenterAccountLinkService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.retail.v2alpha.IUpdateModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest instance */ - MerchantCenterAccountLinkService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + UpdateModelRequest.create = function create(properties) { + return new UpdateModelRequest(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|listMerchantCenterAccountLinks}. - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @typedef ListMerchantCenterAccountLinksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} [response] ListMerchantCenterAccountLinksResponse + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {google.cloud.retail.v2alpha.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.retail.v2alpha.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; + }; /** - * Calls ListMerchantCenterAccountLinks. - * @function listMerchantCenterAccountLinks - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @instance - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} request ListMerchantCenterAccountLinksRequest message or plain object - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.ListMerchantCenterAccountLinksCallback} callback Node-style callback called with the error, if any, and ListMerchantCenterAccountLinksResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(MerchantCenterAccountLinkService.prototype.listMerchantCenterAccountLinks = function listMerchantCenterAccountLinks(request, callback) { - return this.rpcCall(listMerchantCenterAccountLinks, $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest, $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse, request, callback); - }, "name", { value: "ListMerchantCenterAccountLinks" }); + UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListMerchantCenterAccountLinks. - * @function listMerchantCenterAccountLinks - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @instance - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} request ListMerchantCenterAccountLinksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.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.retail.v2alpha.UpdateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = $root.google.cloud.retail.v2alpha.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; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|createMerchantCenterAccountLink}. - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @typedef CreateMerchantCenterAccountLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.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()); + }; /** - * Calls CreateMerchantCenterAccountLink. - * @function createMerchantCenterAccountLink - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} request CreateMerchantCenterAccountLinkRequest message or plain object - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.CreateMerchantCenterAccountLinkCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Verifies an UpdateModelRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(MerchantCenterAccountLinkService.prototype.createMerchantCenterAccountLink = function createMerchantCenterAccountLink(request, callback) { - return this.rpcCall(createMerchantCenterAccountLink, $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateMerchantCenterAccountLink" }); + 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.retail.v2alpha.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; + }; /** - * Calls CreateMerchantCenterAccountLink. - * @function createMerchantCenterAccountLink - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} request CreateMerchantCenterAccountLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest */ + UpdateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateModelRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.UpdateModelRequest(); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateModelRequest.model: object expected"); + message.model = $root.google.cloud.retail.v2alpha.Model.fromObject(object.model); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.MerchantCenterAccountLinkService|deleteMerchantCenterAccountLink}. - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @typedef DeleteMerchantCenterAccountLinkCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @static + * @param {google.cloud.retail.v2alpha.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.retail.v2alpha.Model.toObject(message.model, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; /** - * Calls DeleteMerchantCenterAccountLink. - * @function deleteMerchantCenterAccountLink - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService + * Converts this UpdateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.UpdateModelRequest * @instance - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} request DeleteMerchantCenterAccountLinkRequest message or plain object - * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLinkService.DeleteMerchantCenterAccountLinkCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(MerchantCenterAccountLinkService.prototype.deleteMerchantCenterAccountLink = function deleteMerchantCenterAccountLink(request, callback) { - return this.rpcCall(deleteMerchantCenterAccountLink, $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteMerchantCenterAccountLink" }); + UpdateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls DeleteMerchantCenterAccountLink. - * @function deleteMerchantCenterAccountLink - * @memberof google.cloud.retail.v2alpha.MerchantCenterAccountLinkService - * @instance - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} request DeleteMerchantCenterAccountLinkRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for UpdateModelRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.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.retail.v2alpha.UpdateModelRequest"; + }; - return MerchantCenterAccountLinkService; + return UpdateModelRequest; })(); - v2alpha.ListMerchantCenterAccountLinksRequest = (function() { + v2alpha.GetModelRequest = (function() { /** - * Properties of a ListMerchantCenterAccountLinksRequest. + * Properties of a GetModelRequest. * @memberof google.cloud.retail.v2alpha - * @interface IListMerchantCenterAccountLinksRequest - * @property {string|null} [parent] ListMerchantCenterAccountLinksRequest parent + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name */ /** - * Constructs a new ListMerchantCenterAccountLinksRequest. + * Constructs a new GetModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListMerchantCenterAccountLinksRequest. - * @implements IListMerchantCenterAccountLinksRequest + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest * @constructor - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetModelRequest=} [properties] Properties to set */ - function ListMerchantCenterAccountLinksRequest(properties) { + function GetModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80242,75 +91769,75 @@ } /** - * ListMerchantCenterAccountLinksRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @instance */ - ListMerchantCenterAccountLinksRequest.prototype.parent = ""; + GetModelRequest.prototype.name = ""; /** - * Creates a new ListMerchantCenterAccountLinksRequest instance using the specified properties. + * Creates a new GetModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest instance + * @param {google.cloud.retail.v2alpha.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest instance */ - ListMerchantCenterAccountLinksRequest.create = function create(properties) { - return new ListMerchantCenterAccountLinksRequest(properties); + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); }; /** - * Encodes the specified ListMerchantCenterAccountLinksRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetModelRequest} message GetModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMerchantCenterAccountLinksRequest.encode = function encode(message, writer) { + GetModelRequest.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListMerchantCenterAccountLinksRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest.verify|verify} messages. + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetModelRequest} message GetModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMerchantCenterAccountLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer. + * Decodes a GetModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMerchantCenterAccountLinksRequest.decode = function decode(reader, length) { + 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.retail.v2alpha.ListMerchantCenterAccountLinksRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } default: @@ -80322,123 +91849,122 @@ }; /** - * Decodes a ListMerchantCenterAccountLinksRequest message from the specified reader or buffer, length delimited. + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMerchantCenterAccountLinksRequest.decodeDelimited = function decodeDelimited(reader) { + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMerchantCenterAccountLinksRequest message. + * Verifies a GetModelRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMerchantCenterAccountLinksRequest.verify = function verify(message) { + GetModelRequest.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListMerchantCenterAccountLinksRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} ListMerchantCenterAccountLinksRequest + * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest */ - ListMerchantCenterAccountLinksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest) + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetModelRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.retail.v2alpha.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListMerchantCenterAccountLinksRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static - * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest} message ListMerchantCenterAccountLinksRequest + * @param {google.cloud.retail.v2alpha.GetModelRequest} message GetModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMerchantCenterAccountLinksRequest.toObject = function toObject(message, options) { + GetModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListMerchantCenterAccountLinksRequest to JSON. + * Converts this GetModelRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @instance * @returns {Object.} JSON object */ - ListMerchantCenterAccountLinksRequest.prototype.toJSON = function toJSON() { + GetModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMerchantCenterAccountLinksRequest + * Gets the default type url for GetModelRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest + * @memberof google.cloud.retail.v2alpha.GetModelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMerchantCenterAccountLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetModelRequest"; }; - return ListMerchantCenterAccountLinksRequest; + return GetModelRequest; })(); - v2alpha.ListMerchantCenterAccountLinksResponse = (function() { + v2alpha.PauseModelRequest = (function() { /** - * Properties of a ListMerchantCenterAccountLinksResponse. + * Properties of a PauseModelRequest. * @memberof google.cloud.retail.v2alpha - * @interface IListMerchantCenterAccountLinksResponse - * @property {Array.|null} [merchantCenterAccountLinks] ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks + * @interface IPauseModelRequest + * @property {string|null} [name] PauseModelRequest name */ /** - * Constructs a new ListMerchantCenterAccountLinksResponse. + * Constructs a new PauseModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListMerchantCenterAccountLinksResponse. - * @implements IListMerchantCenterAccountLinksResponse + * @classdesc Represents a PauseModelRequest. + * @implements IPauseModelRequest * @constructor - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPauseModelRequest=} [properties] Properties to set */ - function ListMerchantCenterAccountLinksResponse(properties) { - this.merchantCenterAccountLinks = []; + function PauseModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80446,78 +91972,75 @@ } /** - * ListMerchantCenterAccountLinksResponse merchantCenterAccountLinks. - * @member {Array.} merchantCenterAccountLinks - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * PauseModelRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @instance */ - ListMerchantCenterAccountLinksResponse.prototype.merchantCenterAccountLinks = $util.emptyArray; + PauseModelRequest.prototype.name = ""; /** - * Creates a new ListMerchantCenterAccountLinksResponse instance using the specified properties. + * Creates a new PauseModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse instance + * @param {google.cloud.retail.v2alpha.IPauseModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest instance */ - ListMerchantCenterAccountLinksResponse.create = function create(properties) { - return new ListMerchantCenterAccountLinksResponse(properties); + PauseModelRequest.create = function create(properties) { + return new PauseModelRequest(properties); }; /** - * Encodes the specified ListMerchantCenterAccountLinksResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. + * Encodes the specified PauseModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPauseModelRequest} message PauseModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMerchantCenterAccountLinksResponse.encode = function encode(message, writer) { + PauseModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.merchantCenterAccountLinks != null && message.merchantCenterAccountLinks.length) - for (var i = 0; i < message.merchantCenterAccountLinks.length; ++i) - $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.encode(message.merchantCenterAccountLinks[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 ListMerchantCenterAccountLinksResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.verify|verify} messages. + * Encodes the specified PauseModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static - * @param {google.cloud.retail.v2alpha.IListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPauseModelRequest} message PauseModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMerchantCenterAccountLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { + PauseModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer. + * Decodes a PauseModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse + * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMerchantCenterAccountLinksResponse.decode = function decode(reader, length) { + PauseModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PauseModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.merchantCenterAccountLinks && message.merchantCenterAccountLinks.length)) - message.merchantCenterAccountLinks = []; - message.merchantCenterAccountLinks.push($root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -80529,140 +92052,122 @@ }; /** - * Decodes a ListMerchantCenterAccountLinksResponse message from the specified reader or buffer, length delimited. + * Decodes a PauseModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse + * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMerchantCenterAccountLinksResponse.decodeDelimited = function decodeDelimited(reader) { + PauseModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMerchantCenterAccountLinksResponse message. + * Verifies a PauseModelRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMerchantCenterAccountLinksResponse.verify = function verify(message) { + PauseModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.merchantCenterAccountLinks != null && message.hasOwnProperty("merchantCenterAccountLinks")) { - if (!Array.isArray(message.merchantCenterAccountLinks)) - return "merchantCenterAccountLinks: array expected"; - for (var i = 0; i < message.merchantCenterAccountLinks.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify(message.merchantCenterAccountLinks[i]); - if (error) - return "merchantCenterAccountLinks." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListMerchantCenterAccountLinksResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PauseModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} ListMerchantCenterAccountLinksResponse + * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest */ - ListMerchantCenterAccountLinksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse) + PauseModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PauseModelRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse(); - if (object.merchantCenterAccountLinks) { - if (!Array.isArray(object.merchantCenterAccountLinks)) - throw TypeError(".google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.merchantCenterAccountLinks: array expected"); - message.merchantCenterAccountLinks = []; - for (var i = 0; i < object.merchantCenterAccountLinks.length; ++i) { - if (typeof object.merchantCenterAccountLinks[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse.merchantCenterAccountLinks: object expected"); - message.merchantCenterAccountLinks[i] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.fromObject(object.merchantCenterAccountLinks[i]); - } - } + var message = new $root.google.cloud.retail.v2alpha.PauseModelRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListMerchantCenterAccountLinksResponse message. Also converts values to other types if specified. + * Creates a plain object from a PauseModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static - * @param {google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse} message ListMerchantCenterAccountLinksResponse + * @param {google.cloud.retail.v2alpha.PauseModelRequest} message PauseModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMerchantCenterAccountLinksResponse.toObject = function toObject(message, options) { + PauseModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.merchantCenterAccountLinks = []; - if (message.merchantCenterAccountLinks && message.merchantCenterAccountLinks.length) { - object.merchantCenterAccountLinks = []; - for (var j = 0; j < message.merchantCenterAccountLinks.length; ++j) - object.merchantCenterAccountLinks[j] = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.toObject(message.merchantCenterAccountLinks[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListMerchantCenterAccountLinksResponse to JSON. + * Converts this PauseModelRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @instance * @returns {Object.} JSON object */ - ListMerchantCenterAccountLinksResponse.prototype.toJSON = function toJSON() { + PauseModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMerchantCenterAccountLinksResponse + * Gets the default type url for PauseModelRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse + * @memberof google.cloud.retail.v2alpha.PauseModelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMerchantCenterAccountLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PauseModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListMerchantCenterAccountLinksResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PauseModelRequest"; }; - return ListMerchantCenterAccountLinksResponse; + return PauseModelRequest; })(); - v2alpha.CreateMerchantCenterAccountLinkRequest = (function() { + v2alpha.ResumeModelRequest = (function() { /** - * Properties of a CreateMerchantCenterAccountLinkRequest. + * Properties of a ResumeModelRequest. * @memberof google.cloud.retail.v2alpha - * @interface ICreateMerchantCenterAccountLinkRequest - * @property {string|null} [parent] CreateMerchantCenterAccountLinkRequest parent - * @property {google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null} [merchantCenterAccountLink] CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink + * @interface IResumeModelRequest + * @property {string|null} [name] ResumeModelRequest name */ /** - * Constructs a new CreateMerchantCenterAccountLinkRequest. + * Constructs a new ResumeModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateMerchantCenterAccountLinkRequest. - * @implements ICreateMerchantCenterAccountLinkRequest + * @classdesc Represents a ResumeModelRequest. + * @implements IResumeModelRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IResumeModelRequest=} [properties] Properties to set */ - function CreateMerchantCenterAccountLinkRequest(properties) { + function ResumeModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80670,89 +92175,75 @@ } /** - * CreateMerchantCenterAccountLinkRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest - * @instance - */ - CreateMerchantCenterAccountLinkRequest.prototype.parent = ""; - - /** - * CreateMerchantCenterAccountLinkRequest merchantCenterAccountLink. - * @member {google.cloud.retail.v2alpha.IMerchantCenterAccountLink|null|undefined} merchantCenterAccountLink - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * ResumeModelRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @instance */ - CreateMerchantCenterAccountLinkRequest.prototype.merchantCenterAccountLink = null; + ResumeModelRequest.prototype.name = ""; /** - * Creates a new CreateMerchantCenterAccountLinkRequest instance using the specified properties. + * Creates a new ResumeModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest instance + * @param {google.cloud.retail.v2alpha.IResumeModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest instance */ - CreateMerchantCenterAccountLinkRequest.create = function create(properties) { - return new CreateMerchantCenterAccountLinkRequest(properties); + ResumeModelRequest.create = function create(properties) { + return new ResumeModelRequest(properties); }; /** - * Encodes the specified CreateMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. + * Encodes the specified ResumeModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IResumeModelRequest} message ResumeModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMerchantCenterAccountLinkRequest.encode = function encode(message, writer) { + ResumeModelRequest.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.merchantCenterAccountLink != null && Object.hasOwnProperty.call(message, "merchantCenterAccountLink")) - $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.encode(message.merchantCenterAccountLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.verify|verify} messages. + * Encodes the specified ResumeModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IResumeModelRequest} message ResumeModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMerchantCenterAccountLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + ResumeModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer. + * Decodes a ResumeModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMerchantCenterAccountLinkRequest.decode = function decode(reader, length) { + ResumeModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ResumeModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -80764,136 +92255,124 @@ }; /** - * Decodes a CreateMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. + * Decodes a ResumeModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMerchantCenterAccountLinkRequest.decodeDelimited = function decodeDelimited(reader) { + ResumeModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMerchantCenterAccountLinkRequest message. + * Verifies a ResumeModelRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMerchantCenterAccountLinkRequest.verify = function verify(message) { + ResumeModelRequest.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.merchantCenterAccountLink != null && message.hasOwnProperty("merchantCenterAccountLink")) { - var error = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.verify(message.merchantCenterAccountLink); - if (error) - return "merchantCenterAccountLink." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ResumeModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} CreateMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest */ - CreateMerchantCenterAccountLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest) + ResumeModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ResumeModelRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.merchantCenterAccountLink != null) { - if (typeof object.merchantCenterAccountLink !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest.merchantCenterAccountLink: object expected"); - message.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.fromObject(object.merchantCenterAccountLink); - } + var message = new $root.google.cloud.retail.v2alpha.ResumeModelRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. + * Creates a plain object from a ResumeModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static - * @param {google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest} message CreateMerchantCenterAccountLinkRequest + * @param {google.cloud.retail.v2alpha.ResumeModelRequest} message ResumeModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMerchantCenterAccountLinkRequest.toObject = function toObject(message, options) { + ResumeModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.merchantCenterAccountLink = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.merchantCenterAccountLink != null && message.hasOwnProperty("merchantCenterAccountLink")) - object.merchantCenterAccountLink = $root.google.cloud.retail.v2alpha.MerchantCenterAccountLink.toObject(message.merchantCenterAccountLink, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateMerchantCenterAccountLinkRequest to JSON. + * Converts this ResumeModelRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @instance * @returns {Object.} JSON object */ - CreateMerchantCenterAccountLinkRequest.prototype.toJSON = function toJSON() { + ResumeModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateMerchantCenterAccountLinkRequest + * Gets the default type url for ResumeModelRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ResumeModelRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateMerchantCenterAccountLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResumeModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateMerchantCenterAccountLinkRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ResumeModelRequest"; }; - return CreateMerchantCenterAccountLinkRequest; + return ResumeModelRequest; })(); - v2alpha.DeleteMerchantCenterAccountLinkRequest = (function() { + v2alpha.ListModelsRequest = (function() { /** - * Properties of a DeleteMerchantCenterAccountLinkRequest. + * Properties of a ListModelsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IDeleteMerchantCenterAccountLinkRequest - * @property {string|null} [name] DeleteMerchantCenterAccountLinkRequest name + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken */ /** - * Constructs a new DeleteMerchantCenterAccountLinkRequest. + * Constructs a new ListModelsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a DeleteMerchantCenterAccountLinkRequest. - * @implements IDeleteMerchantCenterAccountLinkRequest + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListModelsRequest=} [properties] Properties to set */ - function DeleteMerchantCenterAccountLinkRequest(properties) { + function ListModelsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80901,75 +92380,103 @@ } /** - * DeleteMerchantCenterAccountLinkRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @instance */ - DeleteMerchantCenterAccountLinkRequest.prototype.name = ""; + ListModelsRequest.prototype.parent = ""; /** - * Creates a new DeleteMerchantCenterAccountLinkRequest instance using the specified properties. + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest instance + * @param {google.cloud.retail.v2alpha.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest instance */ - DeleteMerchantCenterAccountLinkRequest.create = function create(properties) { - return new DeleteMerchantCenterAccountLinkRequest(properties); + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); }; /** - * Encodes the specified DeleteMerchantCenterAccountLinkRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMerchantCenterAccountLinkRequest.encode = function encode(message, writer) { + ListModelsRequest.encode = function encode(message, writer) { 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 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 DeleteMerchantCenterAccountLinkRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest.verify|verify} messages. + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMerchantCenterAccountLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer. + * Decodes a ListModelsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMerchantCenterAccountLinkRequest.decode = function decode(reader, length) { + 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.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListModelsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -80981,137 +92488,139 @@ }; /** - * Decodes a DeleteMerchantCenterAccountLinkRequest message from the specified reader or buffer, length delimited. + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMerchantCenterAccountLinkRequest.decodeDelimited = function decodeDelimited(reader) { + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteMerchantCenterAccountLinkRequest message. + * Verifies a ListModelsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteMerchantCenterAccountLinkRequest.verify = function verify(message) { + ListModelsRequest.verify = function verify(message) { if (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.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 DeleteMerchantCenterAccountLinkRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} DeleteMerchantCenterAccountLinkRequest + * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest */ - DeleteMerchantCenterAccountLinkRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest) + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListModelsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2alpha.ListModelsRequest(); + 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 DeleteMerchantCenterAccountLinkRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static - * @param {google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest} message DeleteMerchantCenterAccountLinkRequest + * @param {google.cloud.retail.v2alpha.ListModelsRequest} message ListModelsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteMerchantCenterAccountLinkRequest.toObject = function toObject(message, options) { + ListModelsRequest.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 (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 DeleteMerchantCenterAccountLinkRequest to JSON. + * Converts this ListModelsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @instance * @returns {Object.} JSON object */ - DeleteMerchantCenterAccountLinkRequest.prototype.toJSON = function toJSON() { + ListModelsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteMerchantCenterAccountLinkRequest + * Gets the default type url for ListModelsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest + * @memberof google.cloud.retail.v2alpha.ListModelsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteMerchantCenterAccountLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteMerchantCenterAccountLinkRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListModelsRequest"; }; - return DeleteMerchantCenterAccountLinkRequest; + return ListModelsRequest; })(); - v2alpha.Model = (function() { + v2alpha.DeleteModelRequest = (function() { /** - * Properties of a Model. + * Properties of a DeleteModelRequest. * @memberof google.cloud.retail.v2alpha - * @interface IModel - * @property {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null} [pageOptimizationConfig] Model pageOptimizationConfig - * @property {string|null} [name] Model name - * @property {string|null} [displayName] Model displayName - * @property {google.cloud.retail.v2alpha.Model.TrainingState|null} [trainingState] Model trainingState - * @property {google.cloud.retail.v2alpha.Model.ServingState|null} [servingState] Model servingState - * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime - * @property {string|null} [type] Model type - * @property {string|null} [optimizationObjective] Model optimizationObjective - * @property {google.cloud.retail.v2alpha.Model.PeriodicTuningState|null} [periodicTuningState] Model periodicTuningState - * @property {google.protobuf.ITimestamp|null} [lastTuneTime] Model lastTuneTime - * @property {string|null} [tuningOperation] Model tuningOperation - * @property {google.cloud.retail.v2alpha.Model.DataState|null} [dataState] Model dataState - * @property {google.cloud.retail.v2alpha.RecommendationsFilteringOption|null} [filteringOption] Model filteringOption - * @property {Array.|null} [servingConfigLists] Model servingConfigLists + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name */ /** - * Constructs a new Model. + * Constructs a new DeleteModelRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a Model. - * @implements IModel + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest * @constructor - * @param {google.cloud.retail.v2alpha.IModel=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest=} [properties] Properties to set */ - function Model(properties) { - this.servingConfigLists = []; + function DeleteModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -81119,290 +92628,77 @@ } /** - * Model pageOptimizationConfig. - * @member {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig|null|undefined} pageOptimizationConfig - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.pageOptimizationConfig = null; - - /** - * Model name. + * DeleteModelRequest name. * @member {string} name - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.name = ""; - - /** - * Model displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.displayName = ""; - - /** - * Model trainingState. - * @member {google.cloud.retail.v2alpha.Model.TrainingState} trainingState - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.trainingState = 0; - - /** - * Model servingState. - * @member {google.cloud.retail.v2alpha.Model.ServingState} servingState - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.servingState = 0; - - /** - * Model createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.createTime = null; - - /** - * Model updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.updateTime = null; - - /** - * Model type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.type = ""; - - /** - * Model optimizationObjective. - * @member {string} optimizationObjective - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.optimizationObjective = ""; - - /** - * Model periodicTuningState. - * @member {google.cloud.retail.v2alpha.Model.PeriodicTuningState} periodicTuningState - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.periodicTuningState = 0; - - /** - * Model lastTuneTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastTuneTime - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.lastTuneTime = null; - - /** - * Model tuningOperation. - * @member {string} tuningOperation - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.tuningOperation = ""; - - /** - * Model dataState. - * @member {google.cloud.retail.v2alpha.Model.DataState} dataState - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.dataState = 0; - - /** - * Model filteringOption. - * @member {google.cloud.retail.v2alpha.RecommendationsFilteringOption} filteringOption - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.filteringOption = 0; - - /** - * Model servingConfigLists. - * @member {Array.} servingConfigLists - * @memberof google.cloud.retail.v2alpha.Model - * @instance - */ - Model.prototype.servingConfigLists = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Model trainingConfig. - * @member {"pageOptimizationConfig"|undefined} trainingConfig - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @instance */ - Object.defineProperty(Model.prototype, "trainingConfig", { - get: $util.oneOfGetter($oneOfFields = ["pageOptimizationConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteModelRequest.prototype.name = ""; /** - * Creates a new Model instance using the specified properties. + * Creates a new DeleteModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static - * @param {google.cloud.retail.v2alpha.IModel=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Model} Model instance + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest instance */ - Model.create = function create(properties) { - return new Model(properties); + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); }; /** - * Encodes the specified Model message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static - * @param {google.cloud.retail.v2alpha.IModel} message Model message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encode = function encode(message, 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); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.trainingState != null && Object.hasOwnProperty.call(message, "trainingState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingState); - if (message.servingState != null && Object.hasOwnProperty.call(message, "servingState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.servingState); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.type); - if (message.optimizationObjective != null && Object.hasOwnProperty.call(message, "optimizationObjective")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.optimizationObjective); - if (message.periodicTuningState != null && Object.hasOwnProperty.call(message, "periodicTuningState")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.periodicTuningState); - if (message.lastTuneTime != null && Object.hasOwnProperty.call(message, "lastTuneTime")) - $root.google.protobuf.Timestamp.encode(message.lastTuneTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.tuningOperation != null && Object.hasOwnProperty.call(message, "tuningOperation")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.tuningOperation); - if (message.dataState != null && Object.hasOwnProperty.call(message, "dataState")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.dataState); - if (message.pageOptimizationConfig != null && Object.hasOwnProperty.call(message, "pageOptimizationConfig")) - $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.encode(message.pageOptimizationConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.filteringOption != null && Object.hasOwnProperty.call(message, "filteringOption")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.filteringOption); - if (message.servingConfigLists != null && message.servingConfigLists.length) - for (var i = 0; i < message.servingConfigLists.length; ++i) - $root.google.cloud.retail.v2alpha.Model.ServingConfigList.encode(message.servingConfigLists[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; /** - * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.verify|verify} messages. + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static - * @param {google.cloud.retail.v2alpha.IModel} message Model message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encodeDelimited = function encodeDelimited(message, writer) { + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Model message from the specified reader or buffer. + * Decodes a DeleteModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Model} Model + * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest * @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) { + 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.retail.v2alpha.Model(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 17: { - message.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.decode(reader, reader.uint32()); - break; - } case 1: { message.name = reader.string(); break; } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.trainingState = reader.int32(); - break; - } - case 4: { - message.servingState = reader.int32(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.type = reader.string(); - break; - } - case 8: { - message.optimizationObjective = reader.string(); - break; - } - case 11: { - message.periodicTuningState = reader.int32(); - break; - } - case 12: { - message.lastTuneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.tuningOperation = reader.string(); - break; - } - case 16: { - message.dataState = reader.int32(); - break; - } - case 18: { - message.filteringOption = reader.int32(); - break; - } - case 19: { - if (!(message.servingConfigLists && message.servingConfigLists.length)) - message.servingConfigLists = []; - message.servingConfigLists.push($root.google.cloud.retail.v2alpha.Model.ServingConfigList.decode(reader, reader.uint32())); - break; - } default: reader.skipType(tag & 7); break; @@ -81412,1821 +92708,1231 @@ }; /** - * Decodes a Model message from the specified reader or buffer, length delimited. + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Model} Model + * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest * @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) { + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Model message. + * Verifies a DeleteModelRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @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) { + DeleteModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.pageOptimizationConfig != null && message.hasOwnProperty("pageOptimizationConfig")) { - properties.trainingConfig = 1; - { - var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify(message.pageOptimizationConfig); - if (error) - return "pageOptimizationConfig." + 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.trainingState != null && message.hasOwnProperty("trainingState")) - switch (message.trainingState) { - default: - return "trainingState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.servingState != null && message.hasOwnProperty("servingState")) - switch (message.servingState) { - default: - return "servingState: 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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) - if (!$util.isString(message.optimizationObjective)) - return "optimizationObjective: string expected"; - if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) - switch (message.periodicTuningState) { - default: - return "periodicTuningState: enum value expected"; - case 0: - case 1: - case 3: - case 2: - break; - } - if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastTuneTime); - if (error) - return "lastTuneTime." + error; - } - if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) - if (!$util.isString(message.tuningOperation)) - return "tuningOperation: string expected"; - if (message.dataState != null && message.hasOwnProperty("dataState")) - switch (message.dataState) { - default: - return "dataState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) - switch (message.filteringOption) { - default: - return "filteringOption: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.servingConfigLists != null && message.hasOwnProperty("servingConfigLists")) { - if (!Array.isArray(message.servingConfigLists)) - return "servingConfigLists: array expected"; - for (var i = 0; i < message.servingConfigLists.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.verify(message.servingConfigLists[i]); - if (error) - return "servingConfigLists." + error; - } - } return null; }; /** - * Creates a Model message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Model} Model + * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest */ - Model.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Model) + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.DeleteModelRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.Model(); - if (object.pageOptimizationConfig != null) { - if (typeof object.pageOptimizationConfig !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.pageOptimizationConfig: object expected"); - message.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.fromObject(object.pageOptimizationConfig); - } + var message = new $root.google.cloud.retail.v2alpha.DeleteModelRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.trainingState) { - default: - if (typeof object.trainingState === "number") { - message.trainingState = object.trainingState; - break; - } - break; - case "TRAINING_STATE_UNSPECIFIED": - case 0: - message.trainingState = 0; - break; - case "PAUSED": - case 1: - message.trainingState = 1; - break; - case "TRAINING": - case 2: - message.trainingState = 2; - break; - } - switch (object.servingState) { - default: - if (typeof object.servingState === "number") { - message.servingState = object.servingState; - break; - } - break; - case "SERVING_STATE_UNSPECIFIED": - case 0: - message.servingState = 0; - break; - case "INACTIVE": - case 1: - message.servingState = 1; - break; - case "ACTIVE": - case 2: - message.servingState = 2; - break; - case "TUNED": - case 3: - message.servingState = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.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.retail.v2alpha.Model.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.type != null) - message.type = String(object.type); - if (object.optimizationObjective != null) - message.optimizationObjective = String(object.optimizationObjective); - switch (object.periodicTuningState) { - default: - if (typeof object.periodicTuningState === "number") { - message.periodicTuningState = object.periodicTuningState; - break; - } - break; - case "PERIODIC_TUNING_STATE_UNSPECIFIED": - case 0: - message.periodicTuningState = 0; - break; - case "PERIODIC_TUNING_DISABLED": - case 1: - message.periodicTuningState = 1; - break; - case "ALL_TUNING_DISABLED": - case 3: - message.periodicTuningState = 3; - break; - case "PERIODIC_TUNING_ENABLED": - case 2: - message.periodicTuningState = 2; - break; - } - if (object.lastTuneTime != null) { - if (typeof object.lastTuneTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.lastTuneTime: object expected"); - message.lastTuneTime = $root.google.protobuf.Timestamp.fromObject(object.lastTuneTime); - } - if (object.tuningOperation != null) - message.tuningOperation = String(object.tuningOperation); - switch (object.dataState) { - default: - if (typeof object.dataState === "number") { - message.dataState = object.dataState; - break; - } - break; - case "DATA_STATE_UNSPECIFIED": - case 0: - message.dataState = 0; - break; - case "DATA_OK": - case 1: - message.dataState = 1; - break; - case "DATA_ERROR": - case 2: - message.dataState = 2; - break; - } - switch (object.filteringOption) { - default: - if (typeof object.filteringOption === "number") { - message.filteringOption = object.filteringOption; - break; - } - break; - case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": - case 0: - message.filteringOption = 0; - break; - case "RECOMMENDATIONS_FILTERING_DISABLED": - case 1: - message.filteringOption = 1; - break; - case "RECOMMENDATIONS_FILTERING_ENABLED": - case 3: - message.filteringOption = 3; - break; - } - if (object.servingConfigLists) { - if (!Array.isArray(object.servingConfigLists)) - throw TypeError(".google.cloud.retail.v2alpha.Model.servingConfigLists: array expected"); - message.servingConfigLists = []; - for (var i = 0; i < object.servingConfigLists.length; ++i) { - if (typeof object.servingConfigLists[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.servingConfigLists: object expected"); - message.servingConfigLists[i] = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.fromObject(object.servingConfigLists[i]); - } - } return message; }; /** - * Creates a plain object from a Model message. Also converts values to other types if specified. + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.Model + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest * @static - * @param {google.cloud.retail.v2alpha.Model} message Model + * @param {google.cloud.retail.v2alpha.DeleteModelRequest} message DeleteModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Model.toObject = function toObject(message, options) { + DeleteModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.servingConfigLists = []; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.displayName = ""; - object.trainingState = options.enums === String ? "TRAINING_STATE_UNSPECIFIED" : 0; - object.servingState = options.enums === String ? "SERVING_STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.type = ""; - object.optimizationObjective = ""; - object.periodicTuningState = options.enums === String ? "PERIODIC_TUNING_STATE_UNSPECIFIED" : 0; - object.lastTuneTime = null; - object.tuningOperation = ""; - object.dataState = options.enums === String ? "DATA_STATE_UNSPECIFIED" : 0; - object.filteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 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.trainingState != null && message.hasOwnProperty("trainingState")) - object.trainingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] === undefined ? message.trainingState : $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] : message.trainingState; - if (message.servingState != null && message.hasOwnProperty("servingState")) - object.servingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] === undefined ? message.servingState : $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] : message.servingState; - 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.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) - object.optimizationObjective = message.optimizationObjective; - if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) - object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] === undefined ? message.periodicTuningState : $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; - if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) - object.lastTuneTime = $root.google.protobuf.Timestamp.toObject(message.lastTuneTime, options); - if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) - object.tuningOperation = message.tuningOperation; - if (message.dataState != null && message.hasOwnProperty("dataState")) - object.dataState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] === undefined ? message.dataState : $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] : message.dataState; - if (message.pageOptimizationConfig != null && message.hasOwnProperty("pageOptimizationConfig")) { - object.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.toObject(message.pageOptimizationConfig, options); - if (options.oneofs) - object.trainingConfig = "pageOptimizationConfig"; - } - if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) - object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] === undefined ? message.filteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; - if (message.servingConfigLists && message.servingConfigLists.length) { - object.servingConfigLists = []; - for (var j = 0; j < message.servingConfigLists.length; ++j) - object.servingConfigLists[j] = $root.google.cloud.retail.v2alpha.Model.ServingConfigList.toObject(message.servingConfigLists[j], options); - } - return object; - }; - - /** - * Converts this Model to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.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.retail.v2alpha.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.retail.v2alpha.Model"; - }; - - Model.PageOptimizationConfig = (function() { - - /** - * Properties of a PageOptimizationConfig. - * @memberof google.cloud.retail.v2alpha.Model - * @interface IPageOptimizationConfig - * @property {string|null} [pageOptimizationEventType] PageOptimizationConfig pageOptimizationEventType - * @property {Array.|null} [panels] PageOptimizationConfig panels - * @property {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction|null} [restriction] PageOptimizationConfig restriction - */ - - /** - * Constructs a new PageOptimizationConfig. - * @memberof google.cloud.retail.v2alpha.Model - * @classdesc Represents a PageOptimizationConfig. - * @implements IPageOptimizationConfig - * @constructor - * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig=} [properties] Properties to set - */ - function PageOptimizationConfig(properties) { - this.panels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PageOptimizationConfig pageOptimizationEventType. - * @member {string} pageOptimizationEventType - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @instance - */ - PageOptimizationConfig.prototype.pageOptimizationEventType = ""; - - /** - * PageOptimizationConfig panels. - * @member {Array.} panels - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @instance - */ - PageOptimizationConfig.prototype.panels = $util.emptyArray; - - /** - * PageOptimizationConfig restriction. - * @member {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction} restriction - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @instance - */ - PageOptimizationConfig.prototype.restriction = 0; - - /** - * Creates a new PageOptimizationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig instance - */ - PageOptimizationConfig.create = function create(properties) { - return new PageOptimizationConfig(properties); - }; - - /** - * Encodes the specified PageOptimizationConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig} message PageOptimizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageOptimizationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageOptimizationEventType != null && Object.hasOwnProperty.call(message, "pageOptimizationEventType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pageOptimizationEventType); - if (message.panels != null && message.panels.length) - for (var i = 0; i < message.panels.length; ++i) - $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.encode(message.panels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.restriction != null && Object.hasOwnProperty.call(message, "restriction")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.restriction); - return writer; - }; - - /** - * Encodes the specified PageOptimizationConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {google.cloud.retail.v2alpha.Model.IPageOptimizationConfig} message PageOptimizationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PageOptimizationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PageOptimizationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageOptimizationConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pageOptimizationEventType = reader.string(); - break; - } - case 2: { - if (!(message.panels && message.panels.length)) - message.panels = []; - message.panels.push($root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.decode(reader, reader.uint32())); - break; - } - case 3: { - message.restriction = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PageOptimizationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PageOptimizationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PageOptimizationConfig message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PageOptimizationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageOptimizationEventType != null && message.hasOwnProperty("pageOptimizationEventType")) - if (!$util.isString(message.pageOptimizationEventType)) - return "pageOptimizationEventType: string expected"; - if (message.panels != null && message.hasOwnProperty("panels")) { - if (!Array.isArray(message.panels)) - return "panels: array expected"; - for (var i = 0; i < message.panels.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify(message.panels[i]); - if (error) - return "panels." + error; - } - } - if (message.restriction != null && message.hasOwnProperty("restriction")) - switch (message.restriction) { - default: - return "restriction: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a PageOptimizationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} PageOptimizationConfig - */ - PageOptimizationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig) - return object; - var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig(); - if (object.pageOptimizationEventType != null) - message.pageOptimizationEventType = String(object.pageOptimizationEventType); - if (object.panels) { - if (!Array.isArray(object.panels)) - throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.panels: array expected"); - message.panels = []; - for (var i = 0; i < object.panels.length; ++i) { - if (typeof object.panels[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.panels: object expected"); - message.panels[i] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.fromObject(object.panels[i]); - } - } - switch (object.restriction) { - default: - if (typeof object.restriction === "number") { - message.restriction = object.restriction; - break; - } - break; - case "RESTRICTION_UNSPECIFIED": - case 0: - message.restriction = 0; - break; - case "NO_RESTRICTION": - case 1: - message.restriction = 1; - break; - case "UNIQUE_SERVING_CONFIG_RESTRICTION": - case 2: - message.restriction = 2; - break; - case "UNIQUE_MODEL_RESTRICTION": - case 3: - message.restriction = 3; - break; - case "UNIQUE_MODEL_TYPE_RESTRICTION": - case 4: - message.restriction = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a PageOptimizationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig} message PageOptimizationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PageOptimizationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.panels = []; - if (options.defaults) { - object.pageOptimizationEventType = ""; - object.restriction = options.enums === String ? "RESTRICTION_UNSPECIFIED" : 0; - } - if (message.pageOptimizationEventType != null && message.hasOwnProperty("pageOptimizationEventType")) - object.pageOptimizationEventType = message.pageOptimizationEventType; - if (message.panels && message.panels.length) { - object.panels = []; - for (var j = 0; j < message.panels.length; ++j) - object.panels[j] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.toObject(message.panels[j], options); - } - if (message.restriction != null && message.hasOwnProperty("restriction")) - object.restriction = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] === undefined ? message.restriction : $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] : message.restriction; - return object; - }; - - /** - * Converts this PageOptimizationConfig to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @instance - * @returns {Object.} JSON object - */ - PageOptimizationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PageOptimizationConfig - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PageOptimizationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig"; - }; - - PageOptimizationConfig.Candidate = (function() { - - /** - * Properties of a Candidate. - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @interface ICandidate - * @property {string|null} [servingConfigId] Candidate servingConfigId - */ - - /** - * Constructs a new Candidate. - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @classdesc Represents a Candidate. - * @implements ICandidate - * @constructor - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate=} [properties] Properties to set - */ - function Candidate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Candidate servingConfigId. - * @member {string|null|undefined} servingConfigId - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @instance - */ - Candidate.prototype.servingConfigId = null; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Converts this DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Candidate candidate. - * @member {"servingConfigId"|undefined} candidate - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @instance - */ - Object.defineProperty(Candidate.prototype, "candidate", { - get: $util.oneOfGetter($oneOfFields = ["servingConfigId"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.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.retail.v2alpha.DeleteModelRequest"; + }; - /** - * Creates a new Candidate instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate instance - */ - Candidate.create = function create(properties) { - return new Candidate(properties); - }; + return DeleteModelRequest; + })(); - /** - * Encodes the specified Candidate message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate} message Candidate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Candidate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.servingConfigId != null && Object.hasOwnProperty.call(message, "servingConfigId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfigId); - return writer; - }; + v2alpha.ListModelsResponse = (function() { - /** - * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate} message Candidate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Candidate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.retail.v2alpha + * @interface IListModelsResponse + * @property {Array.|null} [models] ListModelsResponse models + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ - /** - * Decodes a Candidate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Candidate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.servingConfigId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.retail.v2alpha.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]]; + } - /** - * Decodes a Candidate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Candidate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ListModelsResponse models. + * @member {Array.} models + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.models = $util.emptyArray; - /** - * Verifies a Candidate message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Candidate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) { - properties.candidate = 1; - if (!$util.isString(message.servingConfigId)) - return "servingConfigId: string expected"; - } - return null; - }; + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; - /** - * Creates a Candidate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} Candidate - */ - Candidate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate) - return object; - var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate(); - if (object.servingConfigId != null) - message.servingConfigId = String(object.servingConfigId); - return message; - }; + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {google.cloud.retail.v2alpha.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; - /** - * Creates a plain object from a Candidate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate} message Candidate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Candidate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.servingConfigId != null && message.hasOwnProperty("servingConfigId")) { - object.servingConfigId = message.servingConfigId; - if (options.oneofs) - object.candidate = "servingConfigId"; - } - return object; - }; + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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; + }; - /** - * Converts this Candidate to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @instance - * @returns {Object.} JSON object - */ - Candidate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {google.cloud.retail.v2alpha.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(); + }; - /** - * Gets the default type url for Candidate - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Candidate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.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.retail.v2alpha.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.cloud.retail.v2alpha.Model.decode(reader, reader.uint32())); + break; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate"; - }; - - return Candidate; - })(); - - PageOptimizationConfig.Panel = (function() { + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a Panel. - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @interface IPanel - * @property {string|null} [displayName] Panel displayName - * @property {Array.|null} [candidates] Panel candidates - * @property {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null} [defaultCandidate] Panel defaultCandidate - */ + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.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()); + }; - /** - * Constructs a new Panel. - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig - * @classdesc Represents a Panel. - * @implements IPanel - * @constructor - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel=} [properties] Properties to set - */ - function Panel(properties) { - this.candidates = []; - if (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 ListModelsResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.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; + }; - /** - * Panel displayName. - * @member {string} displayName - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @instance - */ - Panel.prototype.displayName = ""; + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListModelsResponse) + return object; + var message = new $root.google.cloud.retail.v2alpha.ListModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".google.cloud.retail.v2alpha.ListModelsResponse.models: array expected"); + message.models = []; + for (var i = 0; i < object.models.length; ++i) { + if (typeof object.models[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListModelsResponse.models: object expected"); + message.models[i] = $root.google.cloud.retail.v2alpha.Model.fromObject(object.models[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Panel candidates. - * @member {Array.} candidates - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @instance - */ - Panel.prototype.candidates = $util.emptyArray; + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @static + * @param {google.cloud.retail.v2alpha.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.cloud.retail.v2alpha.Model.toObject(message.models[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Panel defaultCandidate. - * @member {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.ICandidate|null|undefined} defaultCandidate - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @instance - */ - Panel.prototype.defaultCandidate = null; + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new Panel instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel instance - */ - Panel.create = function create(properties) { - return new Panel(properties); - }; + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.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.retail.v2alpha.ListModelsResponse"; + }; - /** - * Encodes the specified Panel message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel} message Panel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Panel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.candidates != null && message.candidates.length) - for (var i = 0; i < message.candidates.length; ++i) - $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.encode(message.candidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.defaultCandidate != null && Object.hasOwnProperty.call(message, "defaultCandidate")) - $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.encode(message.defaultCandidate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + return ListModelsResponse; + })(); - /** - * Encodes the specified Panel message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.IPanel} message Panel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Panel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2alpha.TuneModelRequest = (function() { - /** - * Decodes a Panel message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Panel.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - if (!(message.candidates && message.candidates.length)) - message.candidates = []; - message.candidates.push($root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.decode(reader, reader.uint32())); - break; - } - case 3: { - message.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a TuneModelRequest. + * @memberof google.cloud.retail.v2alpha + * @interface ITuneModelRequest + * @property {string|null} [name] TuneModelRequest name + */ - /** - * Decodes a Panel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Panel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new TuneModelRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a TuneModelRequest. + * @implements ITuneModelRequest + * @constructor + * @param {google.cloud.retail.v2alpha.ITuneModelRequest=} [properties] Properties to set + */ + function TuneModelRequest(properties) { + if (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 Panel message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Panel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.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.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify(message.candidates[i]); - if (error) - return "candidates." + error; - } - } - if (message.defaultCandidate != null && message.hasOwnProperty("defaultCandidate")) { - var error = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.verify(message.defaultCandidate); - if (error) - return "defaultCandidate." + error; - } - return null; - }; + /** + * TuneModelRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @instance + */ + TuneModelRequest.prototype.name = ""; - /** - * Creates a Panel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} Panel - */ - Panel.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel) - return object; - var message = new $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.candidates) { - if (!Array.isArray(object.candidates)) - throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.candidates: array expected"); - message.candidates = []; - for (var i = 0; i < object.candidates.length; ++i) { - if (typeof object.candidates[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.candidates: object expected"); - message.candidates[i] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.fromObject(object.candidates[i]); - } - } - if (object.defaultCandidate != null) { - if (typeof object.defaultCandidate !== "object") - throw TypeError(".google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.defaultCandidate: object expected"); - message.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.fromObject(object.defaultCandidate); - } - return message; - }; + /** + * Creates a new TuneModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest instance + */ + TuneModelRequest.create = function create(properties) { + return new TuneModelRequest(properties); + }; - /** - * Creates a plain object from a Panel message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel} message Panel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Panel.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.candidates = []; - if (options.defaults) { - object.displayName = ""; - object.defaultCandidate = null; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.candidates && message.candidates.length) { - object.candidates = []; - for (var j = 0; j < message.candidates.length; ++j) - object.candidates[j] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.toObject(message.candidates[j], options); - } - if (message.defaultCandidate != null && message.hasOwnProperty("defaultCandidate")) - object.defaultCandidate = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Candidate.toObject(message.defaultCandidate, options); - return object; - }; + /** + * Encodes the specified TuneModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelRequest} message TuneModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuneModelRequest.encode = function encode(message, writer) { + 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; + }; - /** - * Converts this Panel to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @instance - * @returns {Object.} JSON object - */ - Panel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified TuneModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelRequest} message TuneModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuneModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Gets the default type url for Panel - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Panel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes a TuneModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuneModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel"; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return Panel; - })(); + /** + * Decodes a TuneModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuneModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Restriction enum. - * @name google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction - * @enum {number} - * @property {number} RESTRICTION_UNSPECIFIED=0 RESTRICTION_UNSPECIFIED value - * @property {number} NO_RESTRICTION=1 NO_RESTRICTION value - * @property {number} UNIQUE_SERVING_CONFIG_RESTRICTION=2 UNIQUE_SERVING_CONFIG_RESTRICTION value - * @property {number} UNIQUE_MODEL_RESTRICTION=3 UNIQUE_MODEL_RESTRICTION value - * @property {number} UNIQUE_MODEL_TYPE_RESTRICTION=4 UNIQUE_MODEL_TYPE_RESTRICTION value - */ - PageOptimizationConfig.Restriction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESTRICTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "NO_RESTRICTION"] = 1; - values[valuesById[2] = "UNIQUE_SERVING_CONFIG_RESTRICTION"] = 2; - values[valuesById[3] = "UNIQUE_MODEL_RESTRICTION"] = 3; - values[valuesById[4] = "UNIQUE_MODEL_TYPE_RESTRICTION"] = 4; - return values; - })(); + /** + * Verifies a TuneModelRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuneModelRequest.verify = function verify(message) { + if (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; + }; - return PageOptimizationConfig; - })(); + /** + * Creates a TuneModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + */ + TuneModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.TuneModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - Model.ServingConfigList = (function() { + /** + * Creates a plain object from a TuneModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {google.cloud.retail.v2alpha.TuneModelRequest} message TuneModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuneModelRequest.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; + }; - /** - * Properties of a ServingConfigList. - * @memberof google.cloud.retail.v2alpha.Model - * @interface IServingConfigList - * @property {Array.|null} [servingConfigIds] ServingConfigList servingConfigIds - */ + /** + * Converts this TuneModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @instance + * @returns {Object.} JSON object + */ + TuneModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new ServingConfigList. - * @memberof google.cloud.retail.v2alpha.Model - * @classdesc Represents a ServingConfigList. - * @implements IServingConfigList - * @constructor - * @param {google.cloud.retail.v2alpha.Model.IServingConfigList=} [properties] Properties to set - */ - function ServingConfigList(properties) { - this.servingConfigIds = []; - if (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 TuneModelRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuneModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelRequest"; + }; - /** - * ServingConfigList servingConfigIds. - * @member {Array.} servingConfigIds - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @instance - */ - ServingConfigList.prototype.servingConfigIds = $util.emptyArray; - - /** - * Creates a new ServingConfigList instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {google.cloud.retail.v2alpha.Model.IServingConfigList=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList instance - */ - ServingConfigList.create = function create(properties) { - return new ServingConfigList(properties); - }; - - /** - * Encodes the specified ServingConfigList message. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {google.cloud.retail.v2alpha.Model.IServingConfigList} message ServingConfigList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServingConfigList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.servingConfigIds != null && message.servingConfigIds.length) - for (var i = 0; i < message.servingConfigIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfigIds[i]); - return writer; - }; - - /** - * Encodes the specified ServingConfigList message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Model.ServingConfigList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {google.cloud.retail.v2alpha.Model.IServingConfigList} message ServingConfigList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServingConfigList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return TuneModelRequest; + })(); - /** - * Decodes a ServingConfigList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServingConfigList.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Model.ServingConfigList(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.servingConfigIds && message.servingConfigIds.length)) - message.servingConfigIds = []; - message.servingConfigIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2alpha.CreateModelMetadata = (function() { - /** - * Decodes a ServingConfigList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServingConfigList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a CreateModelMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface ICreateModelMetadata + * @property {string|null} [model] CreateModelMetadata model + */ - /** - * Verifies a ServingConfigList message. - * @function verify - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServingConfigList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.servingConfigIds != null && message.hasOwnProperty("servingConfigIds")) { - if (!Array.isArray(message.servingConfigIds)) - return "servingConfigIds: array expected"; - for (var i = 0; i < message.servingConfigIds.length; ++i) - if (!$util.isString(message.servingConfigIds[i])) - return "servingConfigIds: string[] expected"; - } - return null; - }; + /** + * Constructs a new CreateModelMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a CreateModelMetadata. + * @implements ICreateModelMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.ICreateModelMetadata=} [properties] Properties to set + */ + function CreateModelMetadata(properties) { + if (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 ServingConfigList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.Model.ServingConfigList} ServingConfigList - */ - ServingConfigList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.Model.ServingConfigList) - return object; - var message = new $root.google.cloud.retail.v2alpha.Model.ServingConfigList(); - if (object.servingConfigIds) { - if (!Array.isArray(object.servingConfigIds)) - throw TypeError(".google.cloud.retail.v2alpha.Model.ServingConfigList.servingConfigIds: array expected"); - message.servingConfigIds = []; - for (var i = 0; i < object.servingConfigIds.length; ++i) - message.servingConfigIds[i] = String(object.servingConfigIds[i]); - } - return message; - }; + /** + * CreateModelMetadata model. + * @member {string} model + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @instance + */ + CreateModelMetadata.prototype.model = ""; - /** - * Creates a plain object from a ServingConfigList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {google.cloud.retail.v2alpha.Model.ServingConfigList} message ServingConfigList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServingConfigList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.servingConfigIds = []; - if (message.servingConfigIds && message.servingConfigIds.length) { - object.servingConfigIds = []; - for (var j = 0; j < message.servingConfigIds.length; ++j) - object.servingConfigIds[j] = message.servingConfigIds[j]; - } - return object; - }; + /** + * Creates a new CreateModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.ICreateModelMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata instance + */ + CreateModelMetadata.create = function create(properties) { + return new CreateModelMetadata(properties); + }; - /** - * Converts this ServingConfigList to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @instance - * @returns {Object.} JSON object - */ - ServingConfigList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified CreateModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.ICreateModelMetadata} message CreateModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelMetadata.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); + return writer; + }; - /** - * Gets the default type url for ServingConfigList - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.Model.ServingConfigList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServingConfigList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Encodes the specified CreateModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.ICreateModelMetadata} message CreateModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.Model.ServingConfigList"; - }; + } + return message; + }; - return ServingConfigList; - })(); + /** + * Decodes a CreateModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ServingState enum. - * @name google.cloud.retail.v2alpha.Model.ServingState - * @enum {number} - * @property {number} SERVING_STATE_UNSPECIFIED=0 SERVING_STATE_UNSPECIFIED value - * @property {number} INACTIVE=1 INACTIVE value - * @property {number} ACTIVE=2 ACTIVE value - * @property {number} TUNED=3 TUNED value + * Verifies a CreateModelMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Model.ServingState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SERVING_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INACTIVE"] = 1; - values[valuesById[2] = "ACTIVE"] = 2; - values[valuesById[3] = "TUNED"] = 3; - return values; - })(); + CreateModelMetadata.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"; + return null; + }; /** - * TrainingState enum. - * @name google.cloud.retail.v2alpha.Model.TrainingState - * @enum {number} - * @property {number} TRAINING_STATE_UNSPECIFIED=0 TRAINING_STATE_UNSPECIFIED value - * @property {number} PAUSED=1 PAUSED value - * @property {number} TRAINING=2 TRAINING value + * Creates a CreateModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata */ - Model.TrainingState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAINING_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PAUSED"] = 1; - values[valuesById[2] = "TRAINING"] = 2; - return values; - })(); + CreateModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateModelMetadata) + return object; + var message = new $root.google.cloud.retail.v2alpha.CreateModelMetadata(); + if (object.model != null) + message.model = String(object.model); + return message; + }; /** - * PeriodicTuningState enum. - * @name google.cloud.retail.v2alpha.Model.PeriodicTuningState - * @enum {number} - * @property {number} PERIODIC_TUNING_STATE_UNSPECIFIED=0 PERIODIC_TUNING_STATE_UNSPECIFIED value - * @property {number} PERIODIC_TUNING_DISABLED=1 PERIODIC_TUNING_DISABLED value - * @property {number} ALL_TUNING_DISABLED=3 ALL_TUNING_DISABLED value - * @property {number} PERIODIC_TUNING_ENABLED=2 PERIODIC_TUNING_ENABLED value + * Creates a plain object from a CreateModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.CreateModelMetadata} message CreateModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Model.PeriodicTuningState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PERIODIC_TUNING_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PERIODIC_TUNING_DISABLED"] = 1; - values[valuesById[3] = "ALL_TUNING_DISABLED"] = 3; - values[valuesById[2] = "PERIODIC_TUNING_ENABLED"] = 2; - return values; - })(); + CreateModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; /** - * DataState enum. - * @name google.cloud.retail.v2alpha.Model.DataState - * @enum {number} - * @property {number} DATA_STATE_UNSPECIFIED=0 DATA_STATE_UNSPECIFIED value - * @property {number} DATA_OK=1 DATA_OK value - * @property {number} DATA_ERROR=2 DATA_ERROR value + * Converts this CreateModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @instance + * @returns {Object.} JSON object */ - Model.DataState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATA_OK"] = 1; - values[valuesById[2] = "DATA_ERROR"] = 2; - return values; - })(); + CreateModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Model; + /** + * Gets the default type url for CreateModelMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateModelMetadata"; + }; + + return CreateModelMetadata; })(); - v2alpha.ModelService = (function() { + v2alpha.TuneModelMetadata = (function() { /** - * Constructs a new ModelService service. + * Properties of a TuneModelMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ModelService - * @extends $protobuf.rpc.Service + * @interface ITuneModelMetadata + * @property {string|null} [model] TuneModelMetadata model + */ + + /** + * Constructs a new TuneModelMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a TuneModelMetadata. + * @implements ITuneModelMetadata * @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 + * @param {google.cloud.retail.v2alpha.ITuneModelMetadata=} [properties] Properties to set */ - function ModelService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function TuneModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService; + /** + * TuneModelMetadata model. + * @member {string} model + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @instance + */ + TuneModelMetadata.prototype.model = ""; /** - * Creates new ModelService service using the specified rpc implementation. + * Creates a new TuneModelMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ModelService + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata * @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. + * @param {google.cloud.retail.v2alpha.ITuneModelMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata instance */ - ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + TuneModelMetadata.create = function create(properties) { + return new TuneModelMetadata(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|createModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef CreateModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified TuneModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelMetadata} message TuneModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + TuneModelMetadata.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); + return writer; + }; /** - * Calls CreateModel. - * @function createModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateModelRequest} request CreateModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified TuneModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelMetadata} message TuneModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ModelService.prototype.createModel = function createModel(request, callback) { - return this.rpcCall(createModel, $root.google.cloud.retail.v2alpha.CreateModelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateModel" }); + TuneModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateModel. - * @function createModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateModelRequest} request CreateModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a TuneModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + TuneModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|getModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef GetModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Model} [response] Model + * Decodes a TuneModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + TuneModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetModel. - * @function getModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IGetModelRequest} request GetModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 + * Verifies a TuneModelMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) { - return this.rpcCall(getModel, $root.google.cloud.retail.v2alpha.GetModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); - }, "name", { value: "GetModel" }); + TuneModelMetadata.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"; + return null; + }; /** - * Calls GetModel. - * @function getModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IGetModelRequest} request GetModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a TuneModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata */ + TuneModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelMetadata) + return object; + var message = new $root.google.cloud.retail.v2alpha.TuneModelMetadata(); + if (object.model != null) + message.model = String(object.model); + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|pauseModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef PauseModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Model} [response] Model + * Creates a plain object from a TuneModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {google.cloud.retail.v2alpha.TuneModelMetadata} message TuneModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + TuneModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; /** - * Calls PauseModel. - * @function pauseModel - * @memberof google.cloud.retail.v2alpha.ModelService + * Converts this TuneModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata * @instance - * @param {google.cloud.retail.v2alpha.IPauseModelRequest} request PauseModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.PauseModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ModelService.prototype.pauseModel = function pauseModel(request, callback) { - return this.rpcCall(pauseModel, $root.google.cloud.retail.v2alpha.PauseModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); - }, "name", { value: "PauseModel" }); + TuneModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls PauseModel. - * @function pauseModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IPauseModelRequest} request PauseModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for TuneModelMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + TuneModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelMetadata"; + }; + + return TuneModelMetadata; + })(); + + v2alpha.TuneModelResponse = (function() { /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|resumeModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef ResumeModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Model} [response] Model + * Properties of a TuneModelResponse. + * @memberof google.cloud.retail.v2alpha + * @interface ITuneModelResponse */ /** - * Calls ResumeModel. - * @function resumeModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IResumeModelRequest} request ResumeModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.ResumeModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 + * Constructs a new TuneModelResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a TuneModelResponse. + * @implements ITuneModelResponse + * @constructor + * @param {google.cloud.retail.v2alpha.ITuneModelResponse=} [properties] Properties to set */ - Object.defineProperty(ModelService.prototype.resumeModel = function resumeModel(request, callback) { - return this.rpcCall(resumeModel, $root.google.cloud.retail.v2alpha.ResumeModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); - }, "name", { value: "ResumeModel" }); + function TuneModelResponse(properties) { + if (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 ResumeModel. - * @function resumeModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IResumeModelRequest} request ResumeModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new TuneModelResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse instance */ + TuneModelResponse.create = function create(properties) { + return new TuneModelResponse(properties); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|deleteModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef DeleteModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Encodes the specified TuneModelResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelResponse} message TuneModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + TuneModelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls DeleteModel. - * @function deleteModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} request DeleteModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.DeleteModelCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified TuneModelResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {google.cloud.retail.v2alpha.ITuneModelResponse} message TuneModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ModelService.prototype.deleteModel = function deleteModel(request, callback) { - return this.rpcCall(deleteModel, $root.google.cloud.retail.v2alpha.DeleteModelRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteModel" }); + TuneModelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls DeleteModel. - * @function deleteModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} request DeleteModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a TuneModelResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + TuneModelResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|listModels}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef ListModelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListModelsResponse} [response] ListModelsResponse + * Decodes a TuneModelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + TuneModelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListModels. - * @function listModels - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IListModelsRequest} request ListModelsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse - * @returns {undefined} - * @variation 1 + * Verifies a TuneModelResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) { - return this.rpcCall(listModels, $root.google.cloud.retail.v2alpha.ListModelsRequest, $root.google.cloud.retail.v2alpha.ListModelsResponse, request, callback); - }, "name", { value: "ListModels" }); + TuneModelResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * Calls ListModels. - * @function listModels - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IListModelsRequest} request ListModelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a TuneModelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse */ + TuneModelResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelResponse) + return object; + return new $root.google.cloud.retail.v2alpha.TuneModelResponse(); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|updateModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef UpdateModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Model} [response] Model + * Creates a plain object from a TuneModelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {google.cloud.retail.v2alpha.TuneModelResponse} message TuneModelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + TuneModelResponse.toObject = function toObject() { + return {}; + }; /** - * Calls UpdateModel. - * @function updateModel - * @memberof google.cloud.retail.v2alpha.ModelService + * Converts this TuneModelResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.TuneModelResponse * @instance - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} request UpdateModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ModelService.prototype.updateModel = function updateModel(request, callback) { - return this.rpcCall(updateModel, $root.google.cloud.retail.v2alpha.UpdateModelRequest, $root.google.cloud.retail.v2alpha.Model, request, callback); - }, "name", { value: "UpdateModel" }); + TuneModelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateModel. - * @function updateModel - * @memberof google.cloud.retail.v2alpha.ModelService - * @instance - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} request UpdateModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for TuneModelResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuneModelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelResponse"; + }; + + return TuneModelResponse; + })(); + + v2alpha.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.retail.v2alpha + * @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; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ModelService|tuneModel}. - * @memberof google.cloud.retail.v2alpha.ModelService - * @typedef TuneModelCallback + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.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.retail.v2alpha.PredictionService|predict}. + * @memberof google.cloud.retail.v2alpha.PredictionService + * @typedef PredictCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @param {google.cloud.retail.v2alpha.PredictResponse} [response] PredictResponse */ /** - * Calls TuneModel. - * @function tuneModel - * @memberof google.cloud.retail.v2alpha.ModelService + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2alpha.PredictionService * @instance - * @param {google.cloud.retail.v2alpha.ITuneModelRequest} request TuneModelRequest message or plain object - * @param {google.cloud.retail.v2alpha.ModelService.TuneModelCallback} callback Node-style callback called with the error, if any, and Operation + * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.retail.v2alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(ModelService.prototype.tuneModel = function tuneModel(request, callback) { - return this.rpcCall(tuneModel, $root.google.cloud.retail.v2alpha.TuneModelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TuneModel" }); + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.retail.v2alpha.PredictRequest, $root.google.cloud.retail.v2alpha.PredictResponse, request, callback); + }, "name", { value: "Predict" }); /** - * Calls TuneModel. - * @function tuneModel - * @memberof google.cloud.retail.v2alpha.ModelService + * Calls Predict. + * @function predict + * @memberof google.cloud.retail.v2alpha.PredictionService * @instance - * @param {google.cloud.retail.v2alpha.ITuneModelRequest} request TuneModelRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return ModelService; + return PredictionService; })(); - v2alpha.CreateModelRequest = (function() { + v2alpha.PredictRequest = (function() { /** - * Properties of a CreateModelRequest. + * Properties of a PredictRequest. * @memberof google.cloud.retail.v2alpha - * @interface ICreateModelRequest - * @property {string|null} [parent] CreateModelRequest parent - * @property {google.cloud.retail.v2alpha.IModel|null} [model] CreateModelRequest model - * @property {boolean|null} [dryRun] CreateModelRequest dryRun + * @interface IPredictRequest + * @property {string|null} [placement] PredictRequest placement + * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] PredictRequest userEvent + * @property {number|null} [pageSize] PredictRequest pageSize + * @property {string|null} [pageToken] PredictRequest pageToken + * @property {string|null} [filter] PredictRequest filter + * @property {boolean|null} [validateOnly] PredictRequest validateOnly + * @property {Object.|null} [params] PredictRequest params + * @property {Object.|null} [labels] PredictRequest labels */ /** - * Constructs a new CreateModelRequest. + * Constructs a new PredictRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateModelRequest. - * @implements ICreateModelRequest + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICreateModelRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set */ - function CreateModelRequest(properties) { + function PredictRequest(properties) { + this.params = {}; + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -83234,103 +93940,215 @@ } /** - * CreateModelRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * PredictRequest placement. + * @member {string} placement + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - CreateModelRequest.prototype.parent = ""; + PredictRequest.prototype.placement = ""; /** - * CreateModelRequest model. - * @member {google.cloud.retail.v2alpha.IModel|null|undefined} model - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * PredictRequest userEvent. + * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - CreateModelRequest.prototype.model = null; + PredictRequest.prototype.userEvent = null; /** - * CreateModelRequest dryRun. - * @member {boolean} dryRun - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * PredictRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance */ - CreateModelRequest.prototype.dryRun = false; + PredictRequest.prototype.pageSize = 0; /** - * Creates a new CreateModelRequest instance using the specified properties. + * PredictRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.pageToken = ""; + + /** + * PredictRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.filter = ""; + + /** + * PredictRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.validateOnly = false; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * PredictRequest labels. + * @member {Object.} labels + * @memberof google.cloud.retail.v2alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest instance + * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest instance */ - CreateModelRequest.create = function create(properties) { - return new CreateModelRequest(properties); + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); }; /** - * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelRequest.verify|verify} messages. + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelRequest.encode = function encode(message, writer) { + PredictRequest.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.retail.v2alpha.Model.encode(message.model, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dryRun); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); + if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) + $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().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 8, wireType 2 =*/66).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 CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelRequest.verify|verify} messages. + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateModelRequest message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest * @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) { + 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.retail.v2alpha.CreateModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictRequest(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.placement = reader.string(); break; } case 2: { - message.model = $root.google.cloud.retail.v2alpha.Model.decode(reader, reader.uint32()); + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); break; } case 3: { - message.dryRun = reader.bool(); + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.validateOnly = reader.bool(); + break; + } + case 7: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + case 8: { + 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: @@ -83342,145 +94160,223 @@ }; /** - * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest * @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) { + PredictRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateModelRequest message. + * Verifies a PredictRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @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) { + PredictRequest.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.retail.v2alpha.Model.verify(message.model); + if (message.placement != null && message.hasOwnProperty("placement")) + if (!$util.isString(message.placement)) + return "placement: string expected"; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) { + var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); if (error) - return "model." + error; + return "userEvent." + error; + } + 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.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean 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) { + var error = $root.google.protobuf.Value.verify(message.params[key[i]]); + if (error) + return "params." + 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.dryRun != null && message.hasOwnProperty("dryRun")) - if (typeof message.dryRun !== "boolean") - return "dryRun: boolean expected"; return null; }; /** - * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateModelRequest} CreateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest */ - CreateModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateModelRequest) + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateModelRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.model != null) { - if (typeof object.model !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateModelRequest.model: object expected"); - message.model = $root.google.cloud.retail.v2alpha.Model.fromObject(object.model); + var message = new $root.google.cloud.retail.v2alpha.PredictRequest(); + if (object.placement != null) + message.placement = String(object.placement); + if (object.userEvent != null) { + if (typeof object.userEvent !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.userEvent: object expected"); + message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); + } + 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.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { + if (typeof object.params[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); + message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.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.dryRun != null) - message.dryRun = Boolean(object.dryRun); return message; }; /** - * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static - * @param {google.cloud.retail.v2alpha.CreateModelRequest} message CreateModelRequest + * @param {google.cloud.retail.v2alpha.PredictRequest} message PredictRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateModelRequest.toObject = function toObject(message, options) { + PredictRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) { + object.params = {}; + object.labels = {}; + } if (options.defaults) { - object.parent = ""; - object.model = null; - object.dryRun = false; + object.placement = ""; + object.userEvent = null; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.validateOnly = false; + } + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = message.placement; + if (message.userEvent != null && message.hasOwnProperty("userEvent")) + object.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvent, options); + 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.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + 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]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); + } + 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.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.model != null && message.hasOwnProperty("model")) - object.model = $root.google.cloud.retail.v2alpha.Model.toObject(message.model, options); - if (message.dryRun != null && message.hasOwnProperty("dryRun")) - object.dryRun = message.dryRun; return object; }; /** - * Converts this CreateModelRequest to JSON. + * Converts this PredictRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @instance * @returns {Object.} JSON object */ - CreateModelRequest.prototype.toJSON = function toJSON() { + PredictRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateModelRequest + * Gets the default type url for PredictRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateModelRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictRequest"; }; - return CreateModelRequest; + return PredictRequest; })(); - v2alpha.UpdateModelRequest = (function() { + v2alpha.PredictResponse = (function() { /** - * Properties of an UpdateModelRequest. + * Properties of a PredictResponse. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateModelRequest - * @property {google.cloud.retail.v2alpha.IModel|null} [model] UpdateModelRequest model - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask + * @interface IPredictResponse + * @property {Array.|null} [results] PredictResponse results + * @property {string|null} [attributionToken] PredictResponse attributionToken + * @property {Array.|null} [missingIds] PredictResponse missingIds + * @property {boolean|null} [validateOnly] PredictResponse validateOnly */ /** - * Constructs a new UpdateModelRequest. + * Constructs a new PredictResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateModelRequest. - * @implements IUpdateModelRequest + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set */ - function UpdateModelRequest(properties) { + function PredictResponse(properties) { + this.results = []; + this.missingIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -83488,89 +94384,123 @@ } /** - * UpdateModelRequest model. - * @member {google.cloud.retail.v2alpha.IModel|null|undefined} model - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * PredictResponse results. + * @member {Array.} results + * @memberof google.cloud.retail.v2alpha.PredictResponse * @instance */ - UpdateModelRequest.prototype.model = null; + PredictResponse.prototype.results = $util.emptyArray; /** - * UpdateModelRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * PredictResponse attributionToken. + * @member {string} attributionToken + * @memberof google.cloud.retail.v2alpha.PredictResponse * @instance */ - UpdateModelRequest.prototype.updateMask = null; + PredictResponse.prototype.attributionToken = ""; /** - * Creates a new UpdateModelRequest instance using the specified properties. + * PredictResponse missingIds. + * @member {Array.} missingIds + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @instance + */ + PredictResponse.prototype.missingIds = $util.emptyArray; + + /** + * PredictResponse validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @instance + */ + PredictResponse.prototype.validateOnly = false; + + /** + * Creates a new PredictResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest instance + * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse instance */ - UpdateModelRequest.create = function create(properties) { - return new UpdateModelRequest(properties); + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); }; /** - * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateModelRequest.encode = function encode(message, writer) { + PredictResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - $root.google.cloud.retail.v2alpha.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(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); + if (message.missingIds != null && message.missingIds.length) + for (var i = 0; i < message.missingIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateModelRequest.verify|verify} messages. + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateModelRequest message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse * @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) { + 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.retail.v2alpha.UpdateModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.model = $root.google.cloud.retail.v2alpha.Model.decode(reader, reader.uint32()); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.decode(reader, reader.uint32())); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.attributionToken = reader.string(); + break; + } + case 3: { + if (!(message.missingIds && message.missingIds.length)) + message.missingIds = []; + message.missingIds.push(reader.string()); + break; + } + case 4: { + message.validateOnly = reader.bool(); break; } default: @@ -83582,752 +94512,880 @@ }; /** - * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse * @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) { + PredictResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateModelRequest message. + * Verifies a PredictResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @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) { + PredictResponse.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.retail.v2alpha.Model.verify(message.model); - if (error) - return "model." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify(message.results[i]); + if (error) + return "results." + error; + } } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + if (!$util.isString(message.attributionToken)) + return "attributionToken: string expected"; + if (message.missingIds != null && message.hasOwnProperty("missingIds")) { + if (!Array.isArray(message.missingIds)) + return "missingIds: array expected"; + for (var i = 0; i < message.missingIds.length; ++i) + if (!$util.isString(message.missingIds[i])) + return "missingIds: string[] expected"; } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse */ - UpdateModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateModelRequest) + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateModelRequest(); - if (object.model != null) { - if (typeof object.model !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateModelRequest.model: object expected"); - message.model = $root.google.cloud.retail.v2alpha.Model.fromObject(object.model); + var message = new $root.google.cloud.retail.v2alpha.PredictResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: object expected"); + message.results[i] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.fromObject(object.results[i]); + } } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateModelRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.attributionToken != null) + message.attributionToken = String(object.attributionToken); + if (object.missingIds) { + if (!Array.isArray(object.missingIds)) + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.missingIds: array expected"); + message.missingIds = []; + for (var i = 0; i < object.missingIds.length; ++i) + message.missingIds[i] = String(object.missingIds[i]); } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static - * @param {google.cloud.retail.v2alpha.UpdateModelRequest} message UpdateModelRequest + * @param {google.cloud.retail.v2alpha.PredictResponse} message PredictResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateModelRequest.toObject = function toObject(message, options) { + PredictResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.results = []; + object.missingIds = []; + } if (options.defaults) { - object.model = null; - object.updateMask = null; + object.attributionToken = ""; + object.validateOnly = false; } - if (message.model != null && message.hasOwnProperty("model")) - object.model = $root.google.cloud.retail.v2alpha.Model.toObject(message.model, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.toObject(message.results[j], options); + } + if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) + object.attributionToken = message.attributionToken; + if (message.missingIds && message.missingIds.length) { + object.missingIds = []; + for (var j = 0; j < message.missingIds.length; ++j) + object.missingIds[j] = message.missingIds[j]; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this UpdateModelRequest to JSON. + * Converts this PredictResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @instance * @returns {Object.} JSON object */ - UpdateModelRequest.prototype.toJSON = function toJSON() { + PredictResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateModelRequest + * Gets the default type url for PredictResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateModelRequest + * @memberof google.cloud.retail.v2alpha.PredictResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateModelRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictResponse"; }; - return UpdateModelRequest; - })(); + PredictResponse.PredictionResult = (function() { - v2alpha.GetModelRequest = (function() { + /** + * Properties of a PredictionResult. + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @interface IPredictionResult + * @property {string|null} [id] PredictionResult id + * @property {Object.|null} [metadata] PredictionResult metadata + */ - /** - * Properties of a GetModelRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IGetModelRequest - * @property {string|null} [name] GetModelRequest name - */ + /** + * Constructs a new PredictionResult. + * @memberof google.cloud.retail.v2alpha.PredictResponse + * @classdesc Represents a PredictionResult. + * @implements IPredictionResult + * @constructor + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set + */ + function PredictionResult(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]]; + } + + /** + * PredictionResult id. + * @member {string} id + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.id = ""; + + /** + * PredictionResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + */ + PredictionResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictionResult instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult instance + */ + PredictionResult.create = function create(properties) { + return new PredictionResult(properties); + }; + + /** + * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.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.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]); + $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictionResult message. + * @function verify + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictionResult.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.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) { + var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); + if (error) + return "metadata." + error; + } + } + return null; + }; + + /** + * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult + */ + PredictionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) + return object; + var message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(); + if (object.id != null) + message.id = String(object.id); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { + if (typeof object.metadata[keys[i]] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); + message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} message PredictionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + 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]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PredictionResult to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @instance + * @returns {Object.} JSON object + */ + PredictionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictionResult + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictResponse.PredictionResult"; + }; + + return PredictionResult; + })(); + + return PredictResponse; + })(); + + v2alpha.ProductService = (function() { /** - * Constructs a new GetModelRequest. + * Constructs a new ProductService service. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetModelRequest. - * @implements IGetModelRequest + * @classdesc Represents a ProductService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.retail.v2alpha.IGetModelRequest=} [properties] Properties to set + * @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 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]]; + function ProductService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * GetModelRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @instance - */ - GetModelRequest.prototype.name = ""; + (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; /** - * Creates a new GetModelRequest instance using the specified properties. + * Creates new ProductService service using the specified rpc implementation. * @function create - * @memberof google.cloud.retail.v2alpha.GetModelRequest + * @memberof google.cloud.retail.v2alpha.ProductService * @static - * @param {google.cloud.retail.v2alpha.IGetModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest instance + * @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 {ProductService} RPC service. Useful where requests and/or responses are streamed. */ - GetModelRequest.create = function create(properties) { - return new GetModelRequest(properties); + ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetModelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IGetModelRequest} message GetModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|createProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef CreateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product */ - 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.retail.v2alpha.GetModelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IGetModelRequest} message GetModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { + return this.rpcCall(createProduct, $root.google.cloud.retail.v2alpha.CreateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "CreateProduct" }); /** - * Decodes a GetModelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateProduct. + * @function createProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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.retail.v2alpha.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.retail.v2alpha.GetModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|getProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef GetProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product */ - 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.retail.v2alpha.GetModelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - 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; - }; + Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { + return this.rpcCall(getProduct, $root.google.cloud.retail.v2alpha.GetProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "GetProduct" }); /** - * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetModelRequest} GetModelRequest + * Calls GetProduct. + * @function getProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetModelRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.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.retail.v2alpha.GetModelRequest - * @static - * @param {google.cloud.retail.v2alpha.GetModelRequest} message GetModelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|listProducts}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListProductsResponse} [response] ListProductsResponse */ - 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.retail.v2alpha.GetModelRequest + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2alpha.ProductService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 */ - GetModelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.retail.v2alpha.ListProductsRequest, $root.google.cloud.retail.v2alpha.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); /** - * Gets the default type url for GetModelRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetModelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetModelRequest"; - }; - - return GetModelRequest; - })(); - - v2alpha.PauseModelRequest = (function() { /** - * Properties of a PauseModelRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IPauseModelRequest - * @property {string|null} [name] PauseModelRequest name + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|updateProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef UpdateProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Product} [response] Product */ /** - * Constructs a new PauseModelRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PauseModelRequest. - * @implements IPauseModelRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IPauseModelRequest=} [properties] Properties to set + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product + * @returns {undefined} + * @variation 1 */ - function PauseModelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { + return this.rpcCall(updateProduct, $root.google.cloud.retail.v2alpha.UpdateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); + }, "name", { value: "UpdateProduct" }); /** - * PauseModelRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.PauseModelRequest + * Calls UpdateProduct. + * @function updateProduct + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PauseModelRequest.prototype.name = ""; /** - * Creates a new PauseModelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IPauseModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest instance + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|deleteProduct}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef DeleteProductCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - PauseModelRequest.create = function create(properties) { - return new PauseModelRequest(properties); - }; /** - * Encodes the specified PauseModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IPauseModelRequest} message PauseModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - PauseModelRequest.encode = function encode(message, writer) { - 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; - }; + Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { + return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2alpha.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteProduct" }); /** - * Encodes the specified PauseModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PauseModelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IPauseModelRequest} message PauseModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteProduct. + * @function deleteProduct + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PauseModelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a PauseModelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|purgeProducts}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef PurgeProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PauseModelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PauseModelRequest(); - 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 PauseModelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.PurgeProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PauseModelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ProductService.prototype.purgeProducts = function purgeProducts(request, callback) { + return this.rpcCall(purgeProducts, $root.google.cloud.retail.v2alpha.PurgeProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeProducts" }); /** - * Verifies a PauseModelRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PauseModelRequest.verify = function verify(message) { - if (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 PauseModelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PauseModelRequest} PauseModelRequest + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|importProducts}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef ImportProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PauseModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PauseModelRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.PauseModelRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a PauseModelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {google.cloud.retail.v2alpha.PauseModelRequest} message PauseModelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PauseModelRequest.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; - }; + Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { + return this.rpcCall(importProducts, $root.google.cloud.retail.v2alpha.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProducts" }); /** - * Converts this PauseModelRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.PauseModelRequest + * Calls ImportProducts. + * @function importProducts + * @memberof google.cloud.retail.v2alpha.ProductService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PauseModelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for PauseModelRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PauseModelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|setInventory}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef SetInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PauseModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PauseModelRequest"; - }; - - return PauseModelRequest; - })(); - v2alpha.ResumeModelRequest = (function() { + /** + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { + return this.rpcCall(setInventory, $root.google.cloud.retail.v2alpha.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SetInventory" }); /** - * Properties of a ResumeModelRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IResumeModelRequest - * @property {string|null} [name] ResumeModelRequest name + * Calls SetInventory. + * @function setInventory + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ResumeModelRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ResumeModelRequest. - * @implements IResumeModelRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IResumeModelRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addFulfillmentPlaces}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef AddFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function ResumeModelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ResumeModelRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService * @instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ResumeModelRequest.prototype.name = ""; + Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { + return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddFulfillmentPlaces" }); /** - * Creates a new ResumeModelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IResumeModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest instance + * Calls AddFulfillmentPlaces. + * @function addFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ResumeModelRequest.create = function create(properties) { - return new ResumeModelRequest(properties); - }; /** - * Encodes the specified ResumeModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IResumeModelRequest} message ResumeModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeFulfillmentPlaces}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef RemoveFulfillmentPlacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ResumeModelRequest.encode = function encode(message, writer) { - 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 ResumeModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ResumeModelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {google.cloud.retail.v2alpha.IResumeModelRequest} message ResumeModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ResumeModelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { + return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveFulfillmentPlaces" }); /** - * Decodes a ResumeModelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls RemoveFulfillmentPlaces. + * @function removeFulfillmentPlaces + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ResumeModelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ResumeModelRequest(); - 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 ResumeModelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addLocalInventories}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef AddLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ResumeModelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ResumeModelRequest message. - * @function verify - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ResumeModelRequest.verify = function verify(message) { - if (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; - }; + Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { + return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddLocalInventories" }); /** - * Creates a ResumeModelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ResumeModelRequest} ResumeModelRequest + * Calls AddLocalInventories. + * @function addLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ResumeModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ResumeModelRequest) - return object; - var message = new $root.google.cloud.retail.v2alpha.ResumeModelRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a ResumeModelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {google.cloud.retail.v2alpha.ResumeModelRequest} message ResumeModelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeLocalInventories}. + * @memberof google.cloud.retail.v2alpha.ProductService + * @typedef RemoveLocalInventoriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ResumeModelRequest.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 ResumeModelRequest to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ResumeModelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { + return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveLocalInventories" }); /** - * Gets the default type url for ResumeModelRequest - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ResumeModelRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls RemoveLocalInventories. + * @function removeLocalInventories + * @memberof google.cloud.retail.v2alpha.ProductService + * @instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ResumeModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ResumeModelRequest"; - }; - return ResumeModelRequest; + return ProductService; })(); - v2alpha.ListModelsRequest = (function() { + v2alpha.CreateProductRequest = (function() { /** - * Properties of a ListModelsRequest. + * Properties of a CreateProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IListModelsRequest - * @property {string|null} [parent] ListModelsRequest parent - * @property {number|null} [pageSize] ListModelsRequest pageSize - * @property {string|null} [pageToken] ListModelsRequest pageToken + * @interface ICreateProductRequest + * @property {string|null} [parent] CreateProductRequest parent + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] CreateProductRequest product + * @property {string|null} [productId] CreateProductRequest productId */ /** - * Constructs a new ListModelsRequest. + * Constructs a new CreateProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListModelsRequest. - * @implements IListModelsRequest + * @classdesc Represents a CreateProductRequest. + * @implements ICreateProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IListModelsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set */ - function ListModelsRequest(properties) { + function CreateProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -84335,90 +95393,90 @@ } /** - * ListModelsRequest parent. + * CreateProductRequest parent. * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @instance */ - ListModelsRequest.prototype.parent = ""; + CreateProductRequest.prototype.parent = ""; /** - * ListModelsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * CreateProductRequest product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @instance */ - ListModelsRequest.prototype.pageSize = 0; + CreateProductRequest.prototype.product = null; /** - * ListModelsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * CreateProductRequest productId. + * @member {string} productId + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @instance */ - ListModelsRequest.prototype.pageToken = ""; + CreateProductRequest.prototype.productId = ""; /** - * Creates a new ListModelsRequest instance using the specified properties. + * Creates a new CreateProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest instance + * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest instance */ - ListModelsRequest.create = function create(properties) { - return new ListModelsRequest(properties); + CreateProductRequest.create = function create(properties) { + return new CreateProductRequest(properties); }; /** - * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. + * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsRequest.encode = function encode(message, writer) { + CreateProductRequest.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.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); return writer; }; /** - * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsRequest.verify|verify} messages. + * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelsRequest message from the specified reader or buffer. + * Decodes a CreateProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest * @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) { + CreateProductRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListModelsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -84427,11 +95485,11 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.productId = reader.string(); break; } default: @@ -84443,139 +95501,144 @@ }; /** - * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest * @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) { + CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelsRequest message. + * Verifies a CreateProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @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) { + CreateProductRequest.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.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; return null; }; /** - * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest */ - ListModelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListModelsRequest) + CreateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.CreateProductRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ListModelsRequest(); + var message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); 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.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.CreateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); + } + if (object.productId != null) + message.productId = String(object.productId); return message; }; /** - * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static - * @param {google.cloud.retail.v2alpha.ListModelsRequest} message ListModelsRequest + * @param {google.cloud.retail.v2alpha.CreateProductRequest} message CreateProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelsRequest.toObject = function toObject(message, options) { + CreateProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.product = null; + object.productId = ""; } 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.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; return object; }; /** - * Converts this ListModelsRequest to JSON. + * Converts this CreateProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @instance * @returns {Object.} JSON object */ - ListModelsRequest.prototype.toJSON = function toJSON() { + CreateProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListModelsRequest + * Gets the default type url for CreateProductRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListModelsRequest + * @memberof google.cloud.retail.v2alpha.CreateProductRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListModelsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateProductRequest"; }; - return ListModelsRequest; + return CreateProductRequest; })(); - v2alpha.DeleteModelRequest = (function() { + v2alpha.GetProductRequest = (function() { /** - * Properties of a DeleteModelRequest. + * Properties of a GetProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IDeleteModelRequest - * @property {string|null} [name] DeleteModelRequest name + * @interface IGetProductRequest + * @property {string|null} [name] GetProductRequest name */ /** - * Constructs a new DeleteModelRequest. + * Constructs a new GetProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a DeleteModelRequest. - * @implements IDeleteModelRequest + * @classdesc Represents a GetProductRequest. + * @implements IGetProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set */ - function DeleteModelRequest(properties) { + function GetProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -84583,35 +95646,35 @@ } /** - * DeleteModelRequest name. + * GetProductRequest name. * @member {string} name - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @instance */ - DeleteModelRequest.prototype.name = ""; + GetProductRequest.prototype.name = ""; /** - * Creates a new DeleteModelRequest instance using the specified properties. + * Creates a new GetProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest instance + * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest instance */ - DeleteModelRequest.create = function create(properties) { - return new DeleteModelRequest(properties); + GetProductRequest.create = function create(properties) { + return new GetProductRequest(properties); }; /** - * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. + * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encode = function encode(message, writer) { + GetProductRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -84620,33 +95683,33 @@ }; /** - * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteModelRequest.verify|verify} messages. + * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer. + * Decodes a GetProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest * @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) { + GetProductRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -84663,30 +95726,30 @@ }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest * @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) { + GetProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteModelRequest message. + * Verifies a GetProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @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) { + GetProductRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -84696,32 +95759,32 @@ }; /** - * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest */ - DeleteModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.DeleteModelRequest) + GetProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetProductRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.DeleteModelRequest(); + var message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); 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. + * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static - * @param {google.cloud.retail.v2alpha.DeleteModelRequest} message DeleteModelRequest + * @param {google.cloud.retail.v2alpha.GetProductRequest} message GetProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteModelRequest.toObject = function toObject(message, options) { + GetProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -84733,54 +95796,54 @@ }; /** - * Converts this DeleteModelRequest to JSON. + * Converts this GetProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @instance * @returns {Object.} JSON object */ - DeleteModelRequest.prototype.toJSON = function toJSON() { + GetProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteModelRequest + * Gets the default type url for GetProductRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.DeleteModelRequest + * @memberof google.cloud.retail.v2alpha.GetProductRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteModelRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetProductRequest"; }; - return DeleteModelRequest; + return GetProductRequest; })(); - v2alpha.ListModelsResponse = (function() { + v2alpha.UpdateProductRequest = (function() { /** - * Properties of a ListModelsResponse. + * Properties of an UpdateProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface IListModelsResponse - * @property {Array.|null} [models] ListModelsResponse models - * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + * @interface IUpdateProductRequest + * @property {google.cloud.retail.v2alpha.IProduct|null} [product] UpdateProductRequest product + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask + * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing */ /** - * Constructs a new ListModelsResponse. + * Constructs a new UpdateProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListModelsResponse. - * @implements IListModelsResponse + * @classdesc Represents an UpdateProductRequest. + * @implements IUpdateProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.IListModelsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set */ - function ListModelsResponse(properties) { - this.models = []; + function UpdateProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -84788,92 +95851,103 @@ } /** - * ListModelsResponse models. - * @member {Array.} models - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * UpdateProductRequest product. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance */ - ListModelsResponse.prototype.models = $util.emptyArray; + UpdateProductRequest.prototype.product = null; /** - * ListModelsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * UpdateProductRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance */ - ListModelsResponse.prototype.nextPageToken = ""; + UpdateProductRequest.prototype.updateMask = null; /** - * Creates a new ListModelsResponse instance using the specified properties. + * UpdateProductRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @instance + */ + UpdateProductRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse instance + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest instance */ - ListModelsResponse.create = function create(properties) { - return new ListModelsResponse(properties); + UpdateProductRequest.create = function create(properties) { + return new UpdateProductRequest(properties); }; /** - * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsResponse.encode = function encode(message, writer) { + UpdateProductRequest.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.cloud.retail.v2alpha.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); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.retail.v2alpha.Product.encode(message.product, 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 ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListModelsResponse.verify|verify} messages. + * Encodes the specified UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelsResponse message from the specified reader or buffer. + * Decodes an UpdateProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest * @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) { + UpdateProductRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListModelsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); 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.cloud.retail.v2alpha.Model.decode(reader, reader.uint32())); + message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); break; } case 2: { - message.nextPageToken = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); break; } default: @@ -84885,148 +95959,150 @@ }; /** - * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest * @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) { + UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelsResponse message. + * Verifies an UpdateProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @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) { + UpdateProductRequest.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.cloud.retail.v2alpha.Model.verify(message.models[i]); - if (error) - return "models." + error; - } + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); + if (error) + return "product." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + 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 a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest */ - ListModelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListModelsResponse) + UpdateProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateProductRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ListModelsResponse(); - if (object.models) { - if (!Array.isArray(object.models)) - throw TypeError(".google.cloud.retail.v2alpha.ListModelsResponse.models: array expected"); - message.models = []; - for (var i = 0; i < object.models.length; ++i) { - if (typeof object.models[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListModelsResponse.models: object expected"); - message.models[i] = $root.google.cloud.retail.v2alpha.Model.fromObject(object.models[i]); - } + var message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.product: object expected"); + message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.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 a ListModelsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static - * @param {google.cloud.retail.v2alpha.ListModelsResponse} message ListModelsResponse + * @param {google.cloud.retail.v2alpha.UpdateProductRequest} message UpdateProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelsResponse.toObject = function toObject(message, options) { + UpdateProductRequest.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.cloud.retail.v2alpha.Model.toObject(message.models[j], options); + if (options.defaults) { + object.product = null; + object.updateMask = null; + object.allowMissing = false; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, 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 ListModelsResponse to JSON. + * Converts this UpdateProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @instance * @returns {Object.} JSON object */ - ListModelsResponse.prototype.toJSON = function toJSON() { + UpdateProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListModelsResponse + * Gets the default type url for UpdateProductRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListModelsResponse + * @memberof google.cloud.retail.v2alpha.UpdateProductRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListModelsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateProductRequest"; }; - return ListModelsResponse; + return UpdateProductRequest; })(); - v2alpha.TuneModelRequest = (function() { + v2alpha.DeleteProductRequest = (function() { /** - * Properties of a TuneModelRequest. + * Properties of a DeleteProductRequest. * @memberof google.cloud.retail.v2alpha - * @interface ITuneModelRequest - * @property {string|null} [name] TuneModelRequest name + * @interface IDeleteProductRequest + * @property {string|null} [name] DeleteProductRequest name + * @property {boolean|null} [force] DeleteProductRequest force */ /** - * Constructs a new TuneModelRequest. + * Constructs a new DeleteProductRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a TuneModelRequest. - * @implements ITuneModelRequest + * @classdesc Represents a DeleteProductRequest. + * @implements IDeleteProductRequest * @constructor - * @param {google.cloud.retail.v2alpha.ITuneModelRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set */ - function TuneModelRequest(properties) { + function DeleteProductRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85034,70 +96110,80 @@ } /** - * TuneModelRequest name. + * DeleteProductRequest name. * @member {string} name - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @instance */ - TuneModelRequest.prototype.name = ""; + DeleteProductRequest.prototype.name = ""; /** - * Creates a new TuneModelRequest instance using the specified properties. + * DeleteProductRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @instance + */ + DeleteProductRequest.prototype.force = false; + + /** + * Creates a new DeleteProductRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest instance + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest instance */ - TuneModelRequest.create = function create(properties) { - return new TuneModelRequest(properties); + DeleteProductRequest.create = function create(properties) { + return new DeleteProductRequest(properties); }; /** - * Encodes the specified TuneModelRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelRequest} message TuneModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelRequest.encode = function encode(message, writer) { + DeleteProductRequest.encode = function encode(message, writer) { 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 4, wireType 0 =*/32).bool(message.force); return writer; }; /** - * Encodes the specified TuneModelRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelRequest.verify|verify} messages. + * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelRequest} message TuneModelRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TuneModelRequest message from the specified reader or buffer. + * Decodes a DeleteProductRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelRequest.decode = function decode(reader, length) { + DeleteProductRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -85105,6 +96191,10 @@ message.name = reader.string(); break; } + case 4: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -85114,122 +96204,136 @@ }; /** - * Decodes a TuneModelRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TuneModelRequest message. + * Verifies a DeleteProductRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TuneModelRequest.verify = function verify(message) { + DeleteProductRequest.verify = function verify(message) { if (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 TuneModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteProductRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.TuneModelRequest} TuneModelRequest + * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest */ - TuneModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelRequest) + DeleteProductRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.DeleteProductRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.TuneModelRequest(); + var message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); 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 TuneModelRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static - * @param {google.cloud.retail.v2alpha.TuneModelRequest} message TuneModelRequest + * @param {google.cloud.retail.v2alpha.DeleteProductRequest} message DeleteProductRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TuneModelRequest.toObject = function toObject(message, options) { + DeleteProductRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + 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 TuneModelRequest to JSON. + * Converts this DeleteProductRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @instance * @returns {Object.} JSON object */ - TuneModelRequest.prototype.toJSON = function toJSON() { + DeleteProductRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TuneModelRequest + * Gets the default type url for DeleteProductRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.TuneModelRequest + * @memberof google.cloud.retail.v2alpha.DeleteProductRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TuneModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteProductRequest"; }; - return TuneModelRequest; + return DeleteProductRequest; })(); - v2alpha.CreateModelMetadata = (function() { + v2alpha.ListProductsRequest = (function() { /** - * Properties of a CreateModelMetadata. + * Properties of a ListProductsRequest. * @memberof google.cloud.retail.v2alpha - * @interface ICreateModelMetadata - * @property {string|null} [model] CreateModelMetadata model + * @interface IListProductsRequest + * @property {string|null} [parent] ListProductsRequest parent + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + * @property {string|null} [filter] ListProductsRequest filter + * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask + * @property {boolean|null} [requireTotalSize] ListProductsRequest requireTotalSize */ /** - * Constructs a new CreateModelMetadata. + * Constructs a new ListProductsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateModelMetadata. - * @implements ICreateModelMetadata + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest * @constructor - * @param {google.cloud.retail.v2alpha.ICreateModelMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set */ - function CreateModelMetadata(properties) { + function ListProductsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85237,75 +96341,145 @@ } /** - * CreateModelMetadata model. - * @member {string} model - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * ListProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @instance */ - CreateModelMetadata.prototype.model = ""; + ListProductsRequest.prototype.parent = ""; /** - * Creates a new CreateModelMetadata instance using the specified properties. + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * ListProductsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.filter = ""; + + /** + * ListProductsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.readMask = null; + + /** + * ListProductsRequest requireTotalSize. + * @member {boolean} requireTotalSize + * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.requireTotalSize = false; + + /** + * Creates a new ListProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata instance + * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest instance */ - CreateModelMetadata.create = function create(properties) { - return new CreateModelMetadata(properties); + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); }; /** - * Encodes the specified CreateModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelMetadata} message CreateModelMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelMetadata.encode = function encode(message, writer) { + ListProductsRequest.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.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requireTotalSize); return writer; }; /** - * Encodes the specified CreateModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateModelMetadata.verify|verify} messages. + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.ICreateModelMetadata} message CreateModelMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateModelMetadata message from the specified reader or buffer. + * Decodes a ListProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateModelMetadata.decode = function decode(reader, length) { + ListProductsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateModelMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.model = reader.string(); + 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.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 6: { + message.requireTotalSize = reader.bool(); break; } default: @@ -85317,122 +96491,171 @@ }; /** - * Decodes a CreateModelMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateModelMetadata.decodeDelimited = function decodeDelimited(reader) { + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateModelMetadata message. + * Verifies a ListProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateModelMetadata.verify = function verify(message) { + ListProductsRequest.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.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.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + if (typeof message.requireTotalSize !== "boolean") + return "requireTotalSize: boolean expected"; return null; }; /** - * Creates a CreateModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateModelMetadata} CreateModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest */ - CreateModelMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateModelMetadata) + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateModelMetadata(); - if (object.model != null) - message.model = String(object.model); + var message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); + 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.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListProductsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.requireTotalSize != null) + message.requireTotalSize = Boolean(object.requireTotalSize); return message; }; /** - * Creates a plain object from a CreateModelMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static - * @param {google.cloud.retail.v2alpha.CreateModelMetadata} message CreateModelMetadata + * @param {google.cloud.retail.v2alpha.ListProductsRequest} message ListProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateModelMetadata.toObject = function toObject(message, options) { + ListProductsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.model = ""; - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.readMask = null; + object.requireTotalSize = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) + object.requireTotalSize = message.requireTotalSize; return object; }; /** - * Converts this CreateModelMetadata to JSON. + * Converts this ListProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @instance * @returns {Object.} JSON object */ - CreateModelMetadata.prototype.toJSON = function toJSON() { + ListProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateModelMetadata + * Gets the default type url for ListProductsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateModelMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListProductsRequest"; }; - return CreateModelMetadata; + return ListProductsRequest; })(); - v2alpha.TuneModelMetadata = (function() { + v2alpha.ListProductsResponse = (function() { /** - * Properties of a TuneModelMetadata. + * Properties of a ListProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface ITuneModelMetadata - * @property {string|null} [model] TuneModelMetadata model + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + * @property {number|null} [totalSize] ListProductsResponse totalSize */ /** - * Constructs a new TuneModelMetadata. + * Constructs a new ListProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a TuneModelMetadata. - * @implements ITuneModelMetadata + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.ITuneModelMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set */ - function TuneModelMetadata(properties) { + function ListProductsResponse(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85440,75 +96663,106 @@ } /** - * TuneModelMetadata model. - * @member {string} model - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance */ - TuneModelMetadata.prototype.model = ""; + ListProductsResponse.prototype.products = $util.emptyArray; /** - * Creates a new TuneModelMetadata instance using the specified properties. + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.nextPageToken = ""; + + /** + * ListProductsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ITuneModelMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata instance + * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse instance */ - TuneModelMetadata.create = function create(properties) { - return new TuneModelMetadata(properties); + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); }; /** - * Encodes the specified TuneModelMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ITuneModelMetadata} message TuneModelMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelMetadata.encode = function encode(message, writer) { + ListProductsResponse.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.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.retail.v2alpha.Product.encode(message.products[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.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified TuneModelMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelMetadata.verify|verify} messages. + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.ITuneModelMetadata} message TuneModelMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TuneModelMetadata message from the specified reader or buffer. + * Decodes a ListProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelMetadata.decode = function decode(reader, length) { + ListProductsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.model = reader.string(); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); break; } default: @@ -85520,121 +96774,160 @@ }; /** - * Decodes a TuneModelMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelMetadata.decodeDelimited = function decodeDelimited(reader) { + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TuneModelMetadata message. + * Verifies a ListProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TuneModelMetadata.verify = function verify(message) { + ListProductsResponse.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.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a TuneModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.TuneModelMetadata} TuneModelMetadata + * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse */ - TuneModelMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelMetadata) + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.TuneModelMetadata(); - if (object.model != null) - message.model = String(object.model); + var message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a TuneModelMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static - * @param {google.cloud.retail.v2alpha.TuneModelMetadata} message TuneModelMetadata + * @param {google.cloud.retail.v2alpha.ListProductsResponse} message ListProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TuneModelMetadata.toObject = function toObject(message, options) { + ListProductsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.model = ""; - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this TuneModelMetadata to JSON. + * Converts this ListProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @instance * @returns {Object.} JSON object */ - TuneModelMetadata.prototype.toJSON = function toJSON() { + ListProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TuneModelMetadata + * Gets the default type url for ListProductsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.TuneModelMetadata + * @memberof google.cloud.retail.v2alpha.ListProductsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TuneModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListProductsResponse"; }; - return TuneModelMetadata; + return ListProductsResponse; })(); - v2alpha.TuneModelResponse = (function() { + v2alpha.SetInventoryRequest = (function() { /** - * Properties of a TuneModelResponse. + * Properties of a SetInventoryRequest. * @memberof google.cloud.retail.v2alpha - * @interface ITuneModelResponse + * @interface ISetInventoryRequest + * @property {google.cloud.retail.v2alpha.IProduct|null} [inventory] SetInventoryRequest inventory + * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask + * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime + * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing */ /** - * Constructs a new TuneModelResponse. + * Constructs a new SetInventoryRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a TuneModelResponse. - * @implements ITuneModelResponse + * @classdesc Represents a SetInventoryRequest. + * @implements ISetInventoryRequest * @constructor - * @param {google.cloud.retail.v2alpha.ITuneModelResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set */ - function TuneModelResponse(properties) { + function SetInventoryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85642,63 +96935,119 @@ } /** - * Creates a new TuneModelResponse instance using the specified properties. + * SetInventoryRequest inventory. + * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} inventory + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.inventory = null; + + /** + * SetInventoryRequest setMask. + * @member {google.protobuf.IFieldMask|null|undefined} setMask + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setMask = null; + + /** + * SetInventoryRequest setTime. + * @member {google.protobuf.ITimestamp|null|undefined} setTime + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.setTime = null; + + /** + * SetInventoryRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @instance + */ + SetInventoryRequest.prototype.allowMissing = false; + + /** + * Creates a new SetInventoryRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse instance + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest instance */ - TuneModelResponse.create = function create(properties) { - return new TuneModelResponse(properties); + SetInventoryRequest.create = function create(properties) { + return new SetInventoryRequest(properties); }; /** - * Encodes the specified TuneModelResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelResponse} message TuneModelResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelResponse.encode = function encode(message, writer) { + SetInventoryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) + $root.google.cloud.retail.v2alpha.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) + $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) + $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); return writer; }; /** - * Encodes the specified TuneModelResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.TuneModelResponse.verify|verify} messages. + * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.ITuneModelResponse} message TuneModelResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TuneModelResponse.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TuneModelResponse message from the specified reader or buffer. + * Decodes a SetInventoryRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelResponse.decode = function decode(reader, length) { + SetInventoryRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.TuneModelResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.inventory = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); + break; + } + case 2: { + message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -85708,404 +97057,400 @@ }; /** - * Decodes a TuneModelResponse message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TuneModelResponse.decodeDelimited = function decodeDelimited(reader) { + SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TuneModelResponse message. + * Verifies a SetInventoryRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TuneModelResponse.verify = function verify(message) { + SetInventoryRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.inventory != null && message.hasOwnProperty("inventory")) { + var error = $root.google.cloud.retail.v2alpha.Product.verify(message.inventory); + if (error) + return "inventory." + error; + } + if (message.setMask != null && message.hasOwnProperty("setMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.setMask); + if (error) + return "setMask." + error; + } + if (message.setTime != null && message.hasOwnProperty("setTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.setTime); + if (error) + return "setTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a TuneModelResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.TuneModelResponse} TuneModelResponse + * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest */ - TuneModelResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.TuneModelResponse) + SetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryRequest) return object; - return new $root.google.cloud.retail.v2alpha.TuneModelResponse(); + var message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); + if (object.inventory != null) { + if (typeof object.inventory !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.inventory: object expected"); + message.inventory = $root.google.cloud.retail.v2alpha.Product.fromObject(object.inventory); + } + if (object.setMask != null) { + if (typeof object.setMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setMask: object expected"); + message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); + } + if (object.setTime != null) { + if (typeof object.setTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setTime: object expected"); + message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; }; /** - * Creates a plain object from a TuneModelResponse message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static - * @param {google.cloud.retail.v2alpha.TuneModelResponse} message TuneModelResponse + * @param {google.cloud.retail.v2alpha.SetInventoryRequest} message SetInventoryRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TuneModelResponse.toObject = function toObject() { - return {}; + SetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inventory = null; + object.setMask = null; + object.setTime = null; + object.allowMissing = false; + } + if (message.inventory != null && message.hasOwnProperty("inventory")) + object.inventory = $root.google.cloud.retail.v2alpha.Product.toObject(message.inventory, options); + if (message.setMask != null && message.hasOwnProperty("setMask")) + object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); + if (message.setTime != null && message.hasOwnProperty("setTime")) + object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; }; /** - * Converts this TuneModelResponse to JSON. + * Converts this SetInventoryRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @instance * @returns {Object.} JSON object */ - TuneModelResponse.prototype.toJSON = function toJSON() { + SetInventoryRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TuneModelResponse + * Gets the default type url for SetInventoryRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.TuneModelResponse + * @memberof google.cloud.retail.v2alpha.SetInventoryRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TuneModelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.TuneModelResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryRequest"; }; - return TuneModelResponse; + return SetInventoryRequest; })(); - v2alpha.PredictionService = (function() { + v2alpha.SetInventoryMetadata = (function() { /** - * Constructs a new PredictionService service. + * Properties of a SetInventoryMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictionService - * @extends $protobuf.rpc.Service + * @interface ISetInventoryMetadata + */ + + /** + * Constructs a new SetInventoryMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SetInventoryMetadata. + * @implements ISetInventoryMetadata * @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 + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set */ - function PredictionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function SetInventoryMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; - /** - * Creates new PredictionService service using the specified rpc implementation. + * Creates a new SetInventoryMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PredictionService + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @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. + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata instance */ - PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + SetInventoryMetadata.create = function create(properties) { + return new SetInventoryMetadata(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.PredictionService|predict}. - * @memberof google.cloud.retail.v2alpha.PredictionService - * @typedef PredictCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.PredictResponse} [response] PredictResponse - */ - - /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2alpha.PredictionService - * @instance - * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object - * @param {google.cloud.retail.v2alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { - return this.rpcCall(predict, $root.google.cloud.retail.v2alpha.PredictRequest, $root.google.cloud.retail.v2alpha.PredictResponse, request, callback); - }, "name", { value: "Predict" }); + SetInventoryMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls Predict. - * @function predict - * @memberof google.cloud.retail.v2alpha.PredictionService - * @instance - * @param {google.cloud.retail.v2alpha.IPredictRequest} request PredictRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - - return PredictionService; - })(); - - v2alpha.PredictRequest = (function() { + SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Properties of a PredictRequest. - * @memberof google.cloud.retail.v2alpha - * @interface IPredictRequest - * @property {string|null} [placement] PredictRequest placement - * @property {google.cloud.retail.v2alpha.IUserEvent|null} [userEvent] PredictRequest userEvent - * @property {number|null} [pageSize] PredictRequest pageSize - * @property {string|null} [pageToken] PredictRequest pageToken - * @property {string|null} [filter] PredictRequest filter - * @property {boolean|null} [validateOnly] PredictRequest validateOnly - * @property {Object.|null} [params] PredictRequest params - * @property {Object.|null} [labels] PredictRequest labels + * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + SetInventoryMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Constructs a new PredictRequest. - * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictRequest. - * @implements IPredictRequest - * @constructor - * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set + * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function PredictRequest(properties) { - this.params = {}; - 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]]; - } + SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * PredictRequest placement. - * @member {string} placement - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Verifies a SetInventoryMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictRequest.prototype.placement = ""; + SetInventoryMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * PredictRequest userEvent. - * @member {google.cloud.retail.v2alpha.IUserEvent|null|undefined} userEvent - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata */ - PredictRequest.prototype.userEvent = null; + SetInventoryMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryMetadata) + return object; + return new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); + }; /** - * PredictRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {google.cloud.retail.v2alpha.SetInventoryMetadata} message SetInventoryMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - PredictRequest.prototype.pageSize = 0; + SetInventoryMetadata.toObject = function toObject() { + return {}; + }; /** - * PredictRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.PredictRequest + * Converts this SetInventoryMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata * @instance + * @returns {Object.} JSON object */ - PredictRequest.prototype.pageToken = ""; + SetInventoryMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * PredictRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Gets the default type url for SetInventoryMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - PredictRequest.prototype.filter = ""; + SetInventoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryMetadata"; + }; - /** - * PredictRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance - */ - PredictRequest.prototype.validateOnly = false; + return SetInventoryMetadata; + })(); + + v2alpha.SetInventoryResponse = (function() { /** - * PredictRequest params. - * @member {Object.} params - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Properties of a SetInventoryResponse. + * @memberof google.cloud.retail.v2alpha + * @interface ISetInventoryResponse */ - PredictRequest.prototype.params = $util.emptyObject; /** - * PredictRequest labels. - * @member {Object.} labels - * @memberof google.cloud.retail.v2alpha.PredictRequest - * @instance + * Constructs a new SetInventoryResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a SetInventoryResponse. + * @implements ISetInventoryResponse + * @constructor + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set */ - PredictRequest.prototype.labels = $util.emptyObject; + function SetInventoryResponse(properties) { + if (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 PredictRequest instance using the specified properties. + * Creates a new SetInventoryResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest instance + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse instance */ - PredictRequest.create = function create(properties) { - return new PredictRequest(properties); + SetInventoryResponse.create = function create(properties) { + return new SetInventoryResponse(properties); }; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encode = function encode(message, writer) { + SetInventoryResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.placement); - if (message.userEvent != null && Object.hasOwnProperty.call(message, "userEvent")) - $root.google.cloud.retail.v2alpha.UserEvent.encode(message.userEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); - 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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.params[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().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 8, wireType 2 =*/66).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 PredictRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictRequest.verify|verify} messages. + * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes a SetInventoryResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse * @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) { + SetInventoryResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictRequest(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.placement = reader.string(); - break; - } - case 2: { - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.decode(reader, reader.uint32()); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - case 6: { - message.validateOnly = reader.bool(); - break; - } - case 7: { - if (message.params === $util.emptyObject) - message.params = {}; - 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.params[key] = value; - break; - } - case 8: { - 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; @@ -86115,223 +97460,114 @@ }; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse * @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) { + SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictRequest message. + * Verifies a SetInventoryResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @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) { + SetInventoryResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.placement != null && message.hasOwnProperty("placement")) - if (!$util.isString(message.placement)) - return "placement: string expected"; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) { - var error = $root.google.cloud.retail.v2alpha.UserEvent.verify(message.userEvent); - if (error) - return "userEvent." + error; - } - 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.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean 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) { - var error = $root.google.protobuf.Value.verify(message.params[key[i]]); - if (error) - return "params." + 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"; - } return null; }; /** - * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictRequest} PredictRequest + * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse */ - PredictRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictRequest) + SetInventoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.PredictRequest(); - if (object.placement != null) - message.placement = String(object.placement); - if (object.userEvent != null) { - if (typeof object.userEvent !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.userEvent: object expected"); - message.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.fromObject(object.userEvent); - } - 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.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) { - if (typeof object.params[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.params: object expected"); - message.params[keys[i]] = $root.google.protobuf.Value.fromObject(object.params[keys[i]]); - } - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictRequest.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; + return new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); }; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static - * @param {google.cloud.retail.v2alpha.PredictRequest} message PredictRequest + * @param {google.cloud.retail.v2alpha.SetInventoryResponse} message SetInventoryResponse * @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 = {}; - object.labels = {}; - } - if (options.defaults) { - object.placement = ""; - object.userEvent = null; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.validateOnly = false; - } - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = message.placement; - if (message.userEvent != null && message.hasOwnProperty("userEvent")) - object.userEvent = $root.google.cloud.retail.v2alpha.UserEvent.toObject(message.userEvent, options); - 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.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - 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]] = $root.google.protobuf.Value.toObject(message.params[keys2[j]], options); - } - 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; + SetInventoryResponse.toObject = function toObject() { + return {}; }; /** - * Converts this PredictRequest to JSON. + * Converts this SetInventoryResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @instance * @returns {Object.} JSON object */ - PredictRequest.prototype.toJSON = function toJSON() { + SetInventoryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PredictRequest + * Gets the default type url for SetInventoryResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PredictRequest + * @memberof google.cloud.retail.v2alpha.SetInventoryResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SetInventoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryResponse"; }; - return PredictRequest; + return SetInventoryResponse; })(); - v2alpha.PredictResponse = (function() { + v2alpha.AddFulfillmentPlacesRequest = (function() { /** - * Properties of a PredictResponse. + * Properties of an AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPredictResponse - * @property {Array.|null} [results] PredictResponse results - * @property {string|null} [attributionToken] PredictResponse attributionToken - * @property {Array.|null} [missingIds] PredictResponse missingIds - * @property {boolean|null} [validateOnly] PredictResponse validateOnly + * @interface IAddFulfillmentPlacesRequest + * @property {string|null} [product] AddFulfillmentPlacesRequest product + * @property {string|null} [type] AddFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime + * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new PredictResponse. + * Constructs a new AddFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PredictResponse. - * @implements IPredictResponse + * @classdesc Represents an AddFulfillmentPlacesRequest. + * @implements IAddFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set */ - function PredictResponse(properties) { - this.results = []; - this.missingIds = []; + function AddFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86339,123 +97575,134 @@ } /** - * PredictResponse results. - * @member {Array.} results - * @memberof google.cloud.retail.v2alpha.PredictResponse + * AddFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PredictResponse.prototype.results = $util.emptyArray; + AddFulfillmentPlacesRequest.prototype.product = ""; /** - * PredictResponse attributionToken. - * @member {string} attributionToken - * @memberof google.cloud.retail.v2alpha.PredictResponse + * AddFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PredictResponse.prototype.attributionToken = ""; + AddFulfillmentPlacesRequest.prototype.type = ""; /** - * PredictResponse missingIds. - * @member {Array.} missingIds - * @memberof google.cloud.retail.v2alpha.PredictResponse + * AddFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PredictResponse.prototype.missingIds = $util.emptyArray; + AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * PredictResponse validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.retail.v2alpha.PredictResponse + * AddFulfillmentPlacesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance */ - PredictResponse.prototype.validateOnly = false; + AddFulfillmentPlacesRequest.prototype.addTime = null; /** - * Creates a new PredictResponse instance using the specified properties. + * AddFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @instance + */ + AddFulfillmentPlacesRequest.prototype.allowMissing = false; + + /** + * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse instance + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance */ - PredictResponse.create = function create(properties) { - return new PredictResponse(properties); + AddFulfillmentPlacesRequest.create = function create(properties) { + return new AddFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encode = function encode(message, writer) { + AddFulfillmentPlacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.results != null && message.results.length) - for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attributionToken != null && Object.hasOwnProperty.call(message, "attributionToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.attributionToken); - if (message.missingIds != null && message.missingIds.length) - for (var i = 0; i < message.missingIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.missingIds[i]); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.verify|verify} messages. + * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @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) { + AddFulfillmentPlacesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.decode(reader, reader.uint32())); + message.product = reader.string(); break; } case 2: { - message.attributionToken = reader.string(); + message.type = reader.string(); break; } case 3: { - if (!(message.missingIds && message.missingIds.length)) - message.missingIds = []; - message.missingIds.push(reader.string()); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; } case 4: { - message.validateOnly = reader.bool(); + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.allowMissing = reader.bool(); break; } default: @@ -86467,880 +97714,1025 @@ }; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest * @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) { + AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictResponse message. + * Verifies an AddFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @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) { + AddFulfillmentPlacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (var i = 0; i < message.results.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify(message.results[i]); - if (error) - return "results." + error; - } + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - if (!$util.isString(message.attributionToken)) - return "attributionToken: string expected"; - if (message.missingIds != null && message.hasOwnProperty("missingIds")) { - if (!Array.isArray(message.missingIds)) - return "missingIds: array expected"; - for (var i = 0; i < message.missingIds.length; ++i) - if (!$util.isString(message.missingIds[i])) - return "missingIds: string[] expected"; + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); + if (error) + return "addTime." + error; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictResponse} PredictResponse + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest */ - PredictResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse) + AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PredictResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: array expected"); - message.results = []; - for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.results: object expected"); - message.results[i] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.fromObject(object.results[i]); - } + var message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.attributionToken != null) - message.attributionToken = String(object.attributionToken); - if (object.missingIds) { - if (!Array.isArray(object.missingIds)) - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.missingIds: array expected"); - message.missingIds = []; - for (var i = 0; i < object.missingIds.length; ++i) - message.missingIds[i] = String(object.missingIds[i]); + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.PredictResponse} message PredictResponse + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictResponse.toObject = function toObject(message, options) { + AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.results = []; - object.missingIds = []; - } + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.attributionToken = ""; - object.validateOnly = false; - } - if (message.results && message.results.length) { - object.results = []; - for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult.toObject(message.results[j], options); + object.product = ""; + object.type = ""; + object.addTime = null; + object.allowMissing = false; } - if (message.attributionToken != null && message.hasOwnProperty("attributionToken")) - object.attributionToken = message.attributionToken; - if (message.missingIds && message.missingIds.length) { - object.missingIds = []; - for (var j = 0; j < message.missingIds.length; ++j) - object.missingIds[j] = message.missingIds[j]; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this PredictResponse to JSON. + * Converts this AddFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - PredictResponse.prototype.toJSON = function toJSON() { + AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PredictResponse + * Gets the default type url for AddFulfillmentPlacesRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PredictResponse + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddFulfillmentPlacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest"; }; - PredictResponse.PredictionResult = (function() { - - /** - * Properties of a PredictionResult. - * @memberof google.cloud.retail.v2alpha.PredictResponse - * @interface IPredictionResult - * @property {string|null} [id] PredictionResult id - * @property {Object.|null} [metadata] PredictionResult metadata - */ + return AddFulfillmentPlacesRequest; + })(); - /** - * Constructs a new PredictionResult. - * @memberof google.cloud.retail.v2alpha.PredictResponse - * @classdesc Represents a PredictionResult. - * @implements IPredictionResult - * @constructor - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set - */ - function PredictionResult(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]]; - } + v2alpha.AddFulfillmentPlacesMetadata = (function() { - /** - * PredictionResult id. - * @member {string} id - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.id = ""; + /** + * Properties of an AddFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IAddFulfillmentPlacesMetadata + */ - /** - * PredictionResult metadata. - * @member {Object.} metadata - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - */ - PredictionResult.prototype.metadata = $util.emptyObject; + /** + * Constructs a new AddFulfillmentPlacesMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddFulfillmentPlacesMetadata. + * @implements IAddFulfillmentPlacesMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + */ + function AddFulfillmentPlacesMetadata(properties) { + if (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 PredictionResult instance using the specified properties. - * @function create - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult instance - */ - PredictionResult.create = function create(properties) { - return new PredictionResult(properties); - }; + /** + * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance + */ + AddFulfillmentPlacesMetadata.create = function create(properties) { + return new AddFulfillmentPlacesMetadata(properties); + }; - /** - * Encodes the specified PredictionResult message. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.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.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]); - $root.google.protobuf.Value.encode(message.metadata[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; + /** + * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified PredictionResult message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PredictResponse.PredictionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.IPredictionResult} message PredictionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PredictionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a PredictionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.metadata[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddFulfillmentPlacesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a PredictionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PredictionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a PredictionResult message. - * @function verify - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PredictionResult.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.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) { - var error = $root.google.protobuf.Value.verify(message.metadata[key[i]]); - if (error) - return "metadata." + error; - } - } - return null; - }; + /** + * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a PredictionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} PredictionResult - */ - PredictionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult) - return object; - var message = new $root.google.cloud.retail.v2alpha.PredictResponse.PredictionResult(); - if (object.id != null) - message.id = String(object.id); - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { - if (typeof object.metadata[keys[i]] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PredictResponse.PredictionResult.metadata: object expected"); - message.metadata[keys[i]] = $root.google.protobuf.Value.fromObject(object.metadata[keys[i]]); - } - } - return message; - }; + /** + * Verifies an AddFulfillmentPlacesMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddFulfillmentPlacesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a plain object from a PredictionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {google.cloud.retail.v2alpha.PredictResponse.PredictionResult} message PredictionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PredictionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - 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]] = $root.google.protobuf.Value.toObject(message.metadata[keys2[j]], options); - } + /** + * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + */ + AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) return object; - }; + return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); + }; - /** - * Converts this PredictionResult to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @instance - * @returns {Object.} JSON object - */ - PredictionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; + }; - /** - * Gets the default type url for PredictionResult - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PredictResponse.PredictionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PredictionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PredictResponse.PredictionResult"; - }; + /** + * Converts this AddFulfillmentPlacesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @instance + * @returns {Object.} JSON object + */ + AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PredictionResult; - })(); + /** + * Gets the default type url for AddFulfillmentPlacesMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddFulfillmentPlacesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata"; + }; - return PredictResponse; + return AddFulfillmentPlacesMetadata; })(); - v2alpha.ProductService = (function() { + v2alpha.AddFulfillmentPlacesResponse = (function() { /** - * Constructs a new ProductService service. + * Properties of an AddFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ProductService - * @extends $protobuf.rpc.Service + * @interface IAddFulfillmentPlacesResponse + */ + + /** + * Constructs a new AddFulfillmentPlacesResponse. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddFulfillmentPlacesResponse. + * @implements IAddFulfillmentPlacesResponse * @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 + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set */ - function ProductService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function AddFulfillmentPlacesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (ProductService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProductService; - /** - * Creates new ProductService service using the specified rpc implementation. + * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ProductService + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse * @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 {ProductService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance */ - ProductService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + AddFulfillmentPlacesResponse.create = function create(properties) { + return new AddFulfillmentPlacesResponse(properties); }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|createProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef CreateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AddFulfillmentPlacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.CreateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 + * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ProductService.prototype.createProduct = function createProduct(request, callback) { - return this.rpcCall(createProduct, $root.google.cloud.retail.v2alpha.CreateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "CreateProduct" }); + AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateProduct. - * @function createProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} request CreateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AddFulfillmentPlacesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|getProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef GetProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.GetProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 + * Verifies an AddFulfillmentPlacesResponse message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ProductService.prototype.getProduct = function getProduct(request, callback) { - return this.rpcCall(getProduct, $root.google.cloud.retail.v2alpha.GetProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "GetProduct" }); + AddFulfillmentPlacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * Calls GetProduct. - * @function getProduct - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IGetProductRequest} request GetProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse */ + AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + return object; + return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|listProducts}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef ListProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.ListProductsResponse} [response] ListProductsResponse + * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + AddFulfillmentPlacesResponse.toObject = function toObject() { + return {}; + }; /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2alpha.ProductService + * Converts this AddFulfillmentPlacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse * @instance - * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ProductService.prototype.listProducts = function listProducts(request, callback) { - return this.rpcCall(listProducts, $root.google.cloud.retail.v2alpha.ListProductsRequest, $root.google.cloud.retail.v2alpha.ListProductsResponse, request, callback); - }, "name", { value: "ListProducts" }); + AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ListProducts. - * @function listProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IListProductsRequest} request ListProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for AddFulfillmentPlacesResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AddFulfillmentPlacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse"; + }; + + return AddFulfillmentPlacesResponse; + })(); + + v2alpha.AddLocalInventoriesRequest = (function() { /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|updateProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef UpdateProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.retail.v2alpha.Product} [response] Product + * Properties of an AddLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @interface IAddLocalInventoriesRequest + * @property {string|null} [product] AddLocalInventoriesRequest product + * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories + * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask + * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime + * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing */ /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2alpha.ProductService + * Constructs a new AddLocalInventoriesRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddLocalInventoriesRequest. + * @implements IAddLocalInventoriesRequest + * @constructor + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set + */ + function AddLocalInventoriesRequest(properties) { + this.localInventories = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.UpdateProductCallback} callback Node-style callback called with the error, if any, and Product - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ProductService.prototype.updateProduct = function updateProduct(request, callback) { - return this.rpcCall(updateProduct, $root.google.cloud.retail.v2alpha.UpdateProductRequest, $root.google.cloud.retail.v2alpha.Product, request, callback); - }, "name", { value: "UpdateProduct" }); + AddLocalInventoriesRequest.prototype.product = ""; /** - * Calls UpdateProduct. - * @function updateProduct - * @memberof google.cloud.retail.v2alpha.ProductService + * AddLocalInventoriesRequest localInventories. + * @member {Array.} localInventories + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} request UpdateProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|deleteProduct}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef DeleteProductCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * AddLocalInventoriesRequest addMask. + * @member {google.protobuf.IFieldMask|null|undefined} addMask + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @instance */ + AddLocalInventoriesRequest.prototype.addMask = null; /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2alpha.ProductService + * AddLocalInventoriesRequest addTime. + * @member {google.protobuf.ITimestamp|null|undefined} addTime + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.DeleteProductCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ProductService.prototype.deleteProduct = function deleteProduct(request, callback) { - return this.rpcCall(deleteProduct, $root.google.cloud.retail.v2alpha.DeleteProductRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteProduct" }); + AddLocalInventoriesRequest.prototype.addTime = null; /** - * Calls DeleteProduct. - * @function deleteProduct - * @memberof google.cloud.retail.v2alpha.ProductService + * AddLocalInventoriesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} request DeleteProductRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AddLocalInventoriesRequest.prototype.allowMissing = false; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|purgeProducts}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef PurgeProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new AddLocalInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance */ + AddLocalInventoriesRequest.create = function create(properties) { + return new AddLocalInventoriesRequest(properties); + }; /** - * Calls PurgeProducts. - * @function purgeProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} request PurgeProductsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.PurgeProductsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ProductService.prototype.purgeProducts = function purgeProducts(request, callback) { - return this.rpcCall(purgeProducts, $root.google.cloud.retail.v2alpha.PurgeProductsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PurgeProducts" }); + AddLocalInventoriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.localInventories != null && message.localInventories.length) + for (var i = 0; i < message.localInventories.length; ++i) + $root.google.cloud.retail.v2alpha.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) + $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) + $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); + return writer; + }; /** - * Calls PurgeProducts. - * @function purgeProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} request PurgeProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|importProducts}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef ImportProductsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AddLocalInventoriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.product = reader.string(); + break; + } + case 2: { + if (!(message.localInventories && message.localInventories.length)) + message.localInventories = []; + message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); + break; + } + case 4: { + message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 5: { + message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.ImportProductsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ProductService.prototype.importProducts = function importProducts(request, callback) { - return this.rpcCall(importProducts, $root.google.cloud.retail.v2alpha.ImportProductsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportProducts" }); + AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ImportProducts. - * @function importProducts - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IImportProductsRequest} request ImportProductsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AddLocalInventoriesRequest message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AddLocalInventoriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.localInventories != null && message.hasOwnProperty("localInventories")) { + if (!Array.isArray(message.localInventories)) + return "localInventories: array expected"; + for (var i = 0; i < message.localInventories.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.LocalInventory.verify(message.localInventories[i]); + if (error) + return "localInventories." + error; + } + } + if (message.addMask != null && message.hasOwnProperty("addMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.addMask); + if (error) + return "addMask." + error; + } + if (message.addTime != null && message.hasOwnProperty("addTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.addTime); + if (error) + return "addTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|setInventory}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef SetInventoryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest */ + AddLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + return object; + var message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.localInventories) { + if (!Array.isArray(object.localInventories)) + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.localInventories: array expected"); + message.localInventories = []; + for (var i = 0; i < object.localInventories.length; ++i) { + if (typeof object.localInventories[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.localInventories: object expected"); + message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); + } + } + if (object.addMask != null) { + if (typeof object.addMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addMask: object expected"); + message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); + } + if (object.addTime != null) { + if (typeof object.addTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addTime: object expected"); + message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.SetInventoryCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} message AddLocalInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ProductService.prototype.setInventory = function setInventory(request, callback) { - return this.rpcCall(setInventory, $root.google.cloud.retail.v2alpha.SetInventoryRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SetInventory" }); + AddLocalInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.localInventories = []; + if (options.defaults) { + object.product = ""; + object.addMask = null; + object.addTime = null; + object.allowMissing = false; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.localInventories && message.localInventories.length) { + object.localInventories = []; + for (var j = 0; j < message.localInventories.length; ++j) + object.localInventories[j] = $root.google.cloud.retail.v2alpha.LocalInventory.toObject(message.localInventories[j], options); + } + if (message.addMask != null && message.hasOwnProperty("addMask")) + object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); + if (message.addTime != null && message.hasOwnProperty("addTime")) + object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; /** - * Calls SetInventory. - * @function setInventory - * @memberof google.cloud.retail.v2alpha.ProductService + * Converts this AddLocalInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest * @instance - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} request SetInventoryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addFulfillmentPlaces}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef AddFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for AddLocalInventoriesRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + AddLocalInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesRequest"; + }; + + return AddLocalInventoriesRequest; + })(); + + v2alpha.AddLocalInventoriesMetadata = (function() { /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Properties of an AddLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @interface IAddLocalInventoriesMetadata */ - Object.defineProperty(ProductService.prototype.addFulfillmentPlaces = function addFulfillmentPlaces(request, callback) { - return this.rpcCall(addFulfillmentPlaces, $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "AddFulfillmentPlaces" }); /** - * Calls AddFulfillmentPlaces. - * @function addFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} request AddFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Constructs a new AddLocalInventoriesMetadata. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents an AddLocalInventoriesMetadata. + * @implements IAddLocalInventoriesMetadata + * @constructor + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set */ + function AddLocalInventoriesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeFulfillmentPlaces}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef RemoveFulfillmentPlacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance */ + AddLocalInventoriesMetadata.create = function create(properties) { + return new AddLocalInventoriesMetadata(properties); + }; /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlacesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ProductService.prototype.removeFulfillmentPlaces = function removeFulfillmentPlaces(request, callback) { - return this.rpcCall(removeFulfillmentPlaces, $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RemoveFulfillmentPlaces" }); + AddLocalInventoriesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls RemoveFulfillmentPlaces. - * @function removeFulfillmentPlaces - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} request RemoveFulfillmentPlacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|addLocalInventories}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef AddLocalInventoriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AddLocalInventoriesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls AddLocalInventories. - * @function addLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.AddLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ProductService.prototype.addLocalInventories = function addLocalInventories(request, callback) { - return this.rpcCall(addLocalInventories, $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "AddLocalInventories" }); + AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls AddLocalInventories. - * @function addLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} request AddLocalInventoriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AddLocalInventoriesMetadata message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AddLocalInventoriesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.retail.v2alpha.ProductService|removeLocalInventories}. - * @memberof google.cloud.retail.v2alpha.ProductService - * @typedef RemoveLocalInventoriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata */ + AddLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + return object; + return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + }; /** - * Calls RemoveLocalInventories. - * @function removeLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService - * @instance - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object - * @param {google.cloud.retail.v2alpha.ProductService.RemoveLocalInventoriesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ProductService.prototype.removeLocalInventories = function removeLocalInventories(request, callback) { - return this.rpcCall(removeLocalInventories, $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RemoveLocalInventories" }); + AddLocalInventoriesMetadata.toObject = function toObject() { + return {}; + }; /** - * Calls RemoveLocalInventories. - * @function removeLocalInventories - * @memberof google.cloud.retail.v2alpha.ProductService + * Converts this AddLocalInventoriesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata * @instance - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} request RemoveLocalInventoriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ProductService; + /** + * Gets the default type url for AddLocalInventoriesMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddLocalInventoriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesMetadata"; + }; + + return AddLocalInventoriesMetadata; })(); - v2alpha.CreateProductRequest = (function() { + v2alpha.AddLocalInventoriesResponse = (function() { /** - * Properties of a CreateProductRequest. + * Properties of an AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2alpha - * @interface ICreateProductRequest - * @property {string|null} [parent] CreateProductRequest parent - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] CreateProductRequest product - * @property {string|null} [productId] CreateProductRequest productId + * @interface IAddLocalInventoriesResponse */ /** - * Constructs a new CreateProductRequest. + * Constructs a new AddLocalInventoriesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a CreateProductRequest. - * @implements ICreateProductRequest + * @classdesc Represents an AddLocalInventoriesResponse. + * @implements IAddLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set */ - function CreateProductRequest(properties) { + function AddLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87348,105 +98740,63 @@ } /** - * CreateProductRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.CreateProductRequest - * @instance - */ - CreateProductRequest.prototype.parent = ""; - - /** - * CreateProductRequest product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.CreateProductRequest - * @instance - */ - CreateProductRequest.prototype.product = null; - - /** - * CreateProductRequest productId. - * @member {string} productId - * @memberof google.cloud.retail.v2alpha.CreateProductRequest - * @instance - */ - CreateProductRequest.prototype.productId = ""; - - /** - * Creates a new CreateProductRequest instance using the specified properties. + * Creates a new AddLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest instance + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance */ - CreateProductRequest.create = function create(properties) { - return new CreateProductRequest(properties); + AddLocalInventoriesResponse.create = function create(properties) { + return new AddLocalInventoriesResponse(properties); }; /** - * Encodes the specified CreateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encode = function encode(message, writer) { + AddLocalInventoriesResponse.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.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.productId); return writer; }; /** - * Encodes the specified CreateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.CreateProductRequest.verify|verify} messages. + * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.ICreateProductRequest} message CreateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decode = function decode(reader, length) { + AddLocalInventoriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.product = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); - break; - } - case 3: { - message.productId = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -87456,144 +98806,113 @@ }; /** - * Decodes a CreateProductRequest message from the specified reader or buffer, length delimited. + * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateProductRequest.decodeDelimited = function decodeDelimited(reader) { + AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateProductRequest message. + * Verifies an AddLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateProductRequest.verify = function verify(message) { + AddLocalInventoriesResponse.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.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + error; - } - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; return null; }; /** - * Creates a CreateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.CreateProductRequest} CreateProductRequest + * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse */ - CreateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.CreateProductRequest) + AddLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.CreateProductRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.CreateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); - } - if (object.productId != null) - message.productId = String(object.productId); - return message; + return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); }; /** - * Creates a plain object from a CreateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.CreateProductRequest} message CreateProductRequest + * @param {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} message AddLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateProductRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.product = null; - object.productId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, options); - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; - return object; + AddLocalInventoriesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this CreateProductRequest to JSON. + * Converts this AddLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - CreateProductRequest.prototype.toJSON = function toJSON() { + AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateProductRequest + * Gets the default type url for AddLocalInventoriesResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.CreateProductRequest + * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddLocalInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.CreateProductRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesResponse"; }; - return CreateProductRequest; + return AddLocalInventoriesResponse; })(); - v2alpha.GetProductRequest = (function() { + v2alpha.RemoveLocalInventoriesRequest = (function() { /** - * Properties of a GetProductRequest. + * Properties of a RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2alpha - * @interface IGetProductRequest - * @property {string|null} [name] GetProductRequest name + * @interface IRemoveLocalInventoriesRequest + * @property {string|null} [product] RemoveLocalInventoriesRequest product + * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing */ /** - * Constructs a new GetProductRequest. + * Constructs a new RemoveLocalInventoriesRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a GetProductRequest. - * @implements IGetProductRequest + * @classdesc Represents a RemoveLocalInventoriesRequest. + * @implements IRemoveLocalInventoriesRequest * @constructor - * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set */ - function GetProductRequest(properties) { + function RemoveLocalInventoriesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87601,75 +98920,120 @@ } /** - * GetProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * RemoveLocalInventoriesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @instance */ - GetProductRequest.prototype.name = ""; + RemoveLocalInventoriesRequest.prototype.product = ""; /** - * Creates a new GetProductRequest instance using the specified properties. + * RemoveLocalInventoriesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; + + /** + * RemoveLocalInventoriesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.removeTime = null; + + /** + * RemoveLocalInventoriesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @instance + */ + RemoveLocalInventoriesRequest.prototype.allowMissing = false; + + /** + * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance */ - GetProductRequest.create = function create(properties) { - return new GetProductRequest(properties); + RemoveLocalInventoriesRequest.create = function create(properties) { + return new RemoveLocalInventoriesRequest(properties); }; /** - * Encodes the specified GetProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProductRequest.encode = function encode(message, writer) { + RemoveLocalInventoriesRequest.encode = function encode(message, writer) { 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.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.IGetProductRequest} message GetProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decode = function decode(reader, length) { + RemoveLocalInventoriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.product = reader.string(); + break; + } + case 2: { + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); + break; + } + case 5: { + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); break; } default: @@ -87681,124 +99045,164 @@ }; /** - * Decodes a GetProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetProductRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetProductRequest message. + * Verifies a RemoveLocalInventoriesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetProductRequest.verify = function verify(message) { + RemoveLocalInventoriesRequest.verify = function verify(message) { if (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.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); + if (error) + return "removeTime." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a GetProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.GetProductRequest} GetProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest */ - GetProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.GetProductRequest) + RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.GetProductRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); + } + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a GetProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static - * @param {google.cloud.retail.v2alpha.GetProductRequest} message GetProductRequest + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetProductRequest.toObject = function toObject(message, options) { + RemoveLocalInventoriesRequest.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 (options.arrays || options.defaults) + object.placeIds = []; + if (options.defaults) { + object.product = ""; + object.allowMissing = false; + object.removeTime = null; + } + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); return object; }; /** - * Converts this GetProductRequest to JSON. + * Converts this RemoveLocalInventoriesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @instance * @returns {Object.} JSON object */ - GetProductRequest.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetProductRequest + * Gets the default type url for RemoveLocalInventoriesRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.GetProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveLocalInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetProductRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest"; }; - return GetProductRequest; + return RemoveLocalInventoriesRequest; })(); - v2alpha.UpdateProductRequest = (function() { + v2alpha.RemoveLocalInventoriesMetadata = (function() { /** - * Properties of an UpdateProductRequest. + * Properties of a RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IUpdateProductRequest - * @property {google.cloud.retail.v2alpha.IProduct|null} [product] UpdateProductRequest product - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProductRequest updateMask - * @property {boolean|null} [allowMissing] UpdateProductRequest allowMissing + * @interface IRemoveLocalInventoriesMetadata */ /** - * Constructs a new UpdateProductRequest. + * Constructs a new RemoveLocalInventoriesMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an UpdateProductRequest. - * @implements IUpdateProductRequest + * @classdesc Represents a RemoveLocalInventoriesMetadata. + * @implements IRemoveLocalInventoriesMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set */ - function UpdateProductRequest(properties) { + function RemoveLocalInventoriesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87806,105 +99210,63 @@ } /** - * UpdateProductRequest product. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} product - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest - * @instance - */ - UpdateProductRequest.prototype.product = null; - - /** - * UpdateProductRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest - * @instance - */ - UpdateProductRequest.prototype.updateMask = null; - - /** - * UpdateProductRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest - * @instance - */ - UpdateProductRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateProductRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance */ - UpdateProductRequest.create = function create(properties) { - return new UpdateProductRequest(properties); + RemoveLocalInventoriesMetadata.create = function create(properties) { + return new RemoveLocalInventoriesMetadata(properties); }; /** - * Encodes the specified UpdateProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encode = function encode(message, writer) { + RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.google.cloud.retail.v2alpha.Product.encode(message.product, 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 UpdateProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2alpha.IUpdateProductRequest} message UpdateProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decode = function decode(reader, length) { + RemoveLocalInventoriesMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.product = $root.google.cloud.retail.v2alpha.Product.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; @@ -87914,150 +99276,108 @@ }; /** - * Decodes an UpdateProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateProductRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateProductRequest message. + * Verifies a RemoveLocalInventoriesMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateProductRequest.verify = function verify(message) { + RemoveLocalInventoriesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.product); - if (error) - return "product." + 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 UpdateProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.UpdateProductRequest} UpdateProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata */ - UpdateProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.UpdateProductRequest) + RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.UpdateProductRequest(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.product: object expected"); - message.product = $root.google.cloud.retail.v2alpha.Product.fromObject(object.product); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.UpdateProductRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; + return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); }; /** - * Creates a plain object from an UpdateProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static - * @param {google.cloud.retail.v2alpha.UpdateProductRequest} message UpdateProductRequest + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateProductRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.product = null; - object.updateMask = null; - object.allowMissing = false; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.google.cloud.retail.v2alpha.Product.toObject(message.product, 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; + RemoveLocalInventoriesMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this UpdateProductRequest to JSON. + * Converts this RemoveLocalInventoriesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @instance * @returns {Object.} JSON object */ - UpdateProductRequest.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateProductRequest + * Gets the default type url for RemoveLocalInventoriesMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.UpdateProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveLocalInventoriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateProductRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata"; }; - return UpdateProductRequest; + return RemoveLocalInventoriesMetadata; })(); - v2alpha.DeleteProductRequest = (function() { + v2alpha.RemoveLocalInventoriesResponse = (function() { /** - * Properties of a DeleteProductRequest. + * Properties of a RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2alpha - * @interface IDeleteProductRequest - * @property {string|null} [name] DeleteProductRequest name - * @property {boolean|null} [force] DeleteProductRequest force + * @interface IRemoveLocalInventoriesResponse */ /** - * Constructs a new DeleteProductRequest. + * Constructs a new RemoveLocalInventoriesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a DeleteProductRequest. - * @implements IDeleteProductRequest + * @classdesc Represents a RemoveLocalInventoriesResponse. + * @implements IRemoveLocalInventoriesResponse * @constructor - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set */ - function DeleteProductRequest(properties) { + function RemoveLocalInventoriesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88065,91 +99385,63 @@ } /** - * DeleteProductRequest name. - * @member {string} name - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @instance - */ - DeleteProductRequest.prototype.name = ""; - - /** - * DeleteProductRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest - * @instance - */ - DeleteProductRequest.prototype.force = false; - - /** - * Creates a new DeleteProductRequest instance using the specified properties. + * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance */ - DeleteProductRequest.create = function create(properties) { - return new DeleteProductRequest(properties); + RemoveLocalInventoriesResponse.create = function create(properties) { + return new RemoveLocalInventoriesResponse(properties); }; /** - * Encodes the specified DeleteProductRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteProductRequest.encode = function encode(message, writer) { + RemoveLocalInventoriesResponse.encode = function encode(message, writer) { 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 4, wireType 0 =*/32).bool(message.force); return writer; }; /** - * Encodes the specified DeleteProductRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.DeleteProductRequest.verify|verify} messages. + * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.IDeleteProductRequest} message DeleteProductRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteProductRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteProductRequest.decode = function decode(reader, length) { + RemoveLocalInventoriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 4: { - message.force = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -88159,136 +99451,114 @@ }; /** - * Decodes a DeleteProductRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteProductRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteProductRequest message. + * Verifies a RemoveLocalInventoriesResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteProductRequest.verify = function verify(message) { + RemoveLocalInventoriesResponse.verify = function verify(message) { if (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 DeleteProductRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.DeleteProductRequest} DeleteProductRequest + * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse */ - DeleteProductRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.DeleteProductRequest) + RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.DeleteProductRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - return message; + return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); }; /** - * Creates a plain object from a DeleteProductRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static - * @param {google.cloud.retail.v2alpha.DeleteProductRequest} message DeleteProductRequest + * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteProductRequest.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; + RemoveLocalInventoriesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this DeleteProductRequest to JSON. + * Converts this RemoveLocalInventoriesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @instance * @returns {Object.} JSON object */ - DeleteProductRequest.prototype.toJSON = function toJSON() { + RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteProductRequest + * Gets the default type url for RemoveLocalInventoriesResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.DeleteProductRequest + * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteProductRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveLocalInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.DeleteProductRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse"; }; - return DeleteProductRequest; + return RemoveLocalInventoriesResponse; })(); - v2alpha.ListProductsRequest = (function() { + v2alpha.RemoveFulfillmentPlacesRequest = (function() { /** - * Properties of a ListProductsRequest. + * Properties of a RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @interface IListProductsRequest - * @property {string|null} [parent] ListProductsRequest parent - * @property {number|null} [pageSize] ListProductsRequest pageSize - * @property {string|null} [pageToken] ListProductsRequest pageToken - * @property {string|null} [filter] ListProductsRequest filter - * @property {google.protobuf.IFieldMask|null} [readMask] ListProductsRequest readMask - * @property {boolean|null} [requireTotalSize] ListProductsRequest requireTotalSize + * @interface IRemoveFulfillmentPlacesRequest + * @property {string|null} [product] RemoveFulfillmentPlacesRequest product + * @property {string|null} [type] RemoveFulfillmentPlacesRequest type + * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds + * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime + * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing */ /** - * Constructs a new ListProductsRequest. + * Constructs a new RemoveFulfillmentPlacesRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListProductsRequest. - * @implements IListProductsRequest + * @classdesc Represents a RemoveFulfillmentPlacesRequest. + * @implements IRemoveFulfillmentPlacesRequest * @constructor - * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set */ - function ListProductsRequest(properties) { + function RemoveFulfillmentPlacesRequest(properties) { + this.placeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88296,145 +99566,134 @@ } /** - * ListProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.ListProductsRequest - * @instance - */ - ListProductsRequest.prototype.parent = ""; - - /** - * ListProductsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * RemoveFulfillmentPlacesRequest product. + * @member {string} product + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - ListProductsRequest.prototype.pageSize = 0; + RemoveFulfillmentPlacesRequest.prototype.product = ""; /** - * ListProductsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * RemoveFulfillmentPlacesRequest type. + * @member {string} type + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - ListProductsRequest.prototype.pageToken = ""; + RemoveFulfillmentPlacesRequest.prototype.type = ""; /** - * ListProductsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * RemoveFulfillmentPlacesRequest placeIds. + * @member {Array.} placeIds + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - ListProductsRequest.prototype.filter = ""; + RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; /** - * ListProductsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * RemoveFulfillmentPlacesRequest removeTime. + * @member {google.protobuf.ITimestamp|null|undefined} removeTime + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - ListProductsRequest.prototype.readMask = null; + RemoveFulfillmentPlacesRequest.prototype.removeTime = null; /** - * ListProductsRequest requireTotalSize. - * @member {boolean} requireTotalSize - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * RemoveFulfillmentPlacesRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance */ - ListProductsRequest.prototype.requireTotalSize = false; + RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; /** - * Creates a new ListProductsRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance */ - ListProductsRequest.create = function create(properties) { - return new ListProductsRequest(properties); + RemoveFulfillmentPlacesRequest.create = function create(properties) { + return new RemoveFulfillmentPlacesRequest(properties); }; /** - * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encode = function encode(message, writer) { + RemoveFulfillmentPlacesRequest.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.requireTotalSize != null && Object.hasOwnProperty.call(message, "requireTotalSize")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requireTotalSize); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.placeIds != null && message.placeIds.length) + for (var i = 0; i < message.placeIds.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); + if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) + $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); return writer; }; /** - * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decode = function decode(reader, length) { + RemoveFulfillmentPlacesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.product = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.type = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + if (!(message.placeIds && message.placeIds.length)) + message.placeIds = []; + message.placeIds.push(reader.string()); break; } case 4: { - message.filter = reader.string(); + message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 5: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 6: { - message.requireTotalSize = reader.bool(); + message.allowMissing = reader.bool(); break; } default: @@ -88446,171 +99705,172 @@ }; /** - * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsRequest message. + * Verifies a RemoveFulfillmentPlacesRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsRequest.verify = function verify(message) { + RemoveFulfillmentPlacesRequest.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.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.placeIds != null && message.hasOwnProperty("placeIds")) { + if (!Array.isArray(message.placeIds)) + return "placeIds: array expected"; + for (var i = 0; i < message.placeIds.length; ++i) + if (!$util.isString(message.placeIds[i])) + return "placeIds: string[] expected"; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.removeTime); if (error) - return "readMask." + error; + return "removeTime." + error; } - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - if (typeof message.requireTotalSize !== "boolean") - return "requireTotalSize: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; return null; }; /** - * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListProductsRequest} ListProductsRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest */ - ListProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsRequest) + RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.ListProductsRequest(); - 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.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListProductsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + var message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); + if (object.product != null) + message.product = String(object.product); + if (object.type != null) + message.type = String(object.type); + if (object.placeIds) { + if (!Array.isArray(object.placeIds)) + throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.placeIds: array expected"); + message.placeIds = []; + for (var i = 0; i < object.placeIds.length; ++i) + message.placeIds[i] = String(object.placeIds[i]); } - if (object.requireTotalSize != null) - message.requireTotalSize = Boolean(object.requireTotalSize); + if (object.removeTime != null) { + if (typeof object.removeTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.removeTime: object expected"); + message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static - * @param {google.cloud.retail.v2alpha.ListProductsRequest} message ListProductsRequest + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsRequest.toObject = function toObject(message, options) { + RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.placeIds = []; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.readMask = null; - object.requireTotalSize = false; + object.product = ""; + object.type = ""; + object.removeTime = null; + object.allowMissing = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - if (message.requireTotalSize != null && message.hasOwnProperty("requireTotalSize")) - object.requireTotalSize = message.requireTotalSize; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.placeIds && message.placeIds.length) { + object.placeIds = []; + for (var j = 0; j < message.placeIds.length; ++j) + object.placeIds[j] = message.placeIds[j]; + } + if (message.removeTime != null && message.hasOwnProperty("removeTime")) + object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; return object; }; /** - * Converts this ListProductsRequest to JSON. + * Converts this RemoveFulfillmentPlacesRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @instance * @returns {Object.} JSON object */ - ListProductsRequest.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListProductsRequest + * Gets the default type url for RemoveFulfillmentPlacesRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListProductsRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveFulfillmentPlacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListProductsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest"; }; - return ListProductsRequest; + return RemoveFulfillmentPlacesRequest; })(); - v2alpha.ListProductsResponse = (function() { + v2alpha.RemoveFulfillmentPlacesMetadata = (function() { /** - * Properties of a ListProductsResponse. + * Properties of a RemoveFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IListProductsResponse - * @property {Array.|null} [products] ListProductsResponse products - * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken - * @property {number|null} [totalSize] ListProductsResponse totalSize + * @interface IRemoveFulfillmentPlacesMetadata */ /** - * Constructs a new ListProductsResponse. + * Constructs a new RemoveFulfillmentPlacesMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a ListProductsResponse. - * @implements IListProductsResponse + * @classdesc Represents a RemoveFulfillmentPlacesMetadata. + * @implements IRemoveFulfillmentPlacesMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set */ - function ListProductsResponse(properties) { - this.products = []; + function RemoveFulfillmentPlacesMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88618,108 +99878,63 @@ } /** - * ListProductsResponse products. - * @member {Array.} products - * @memberof google.cloud.retail.v2alpha.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.products = $util.emptyArray; - - /** - * ListProductsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.retail.v2alpha.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.nextPageToken = ""; - - /** - * ListProductsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.retail.v2alpha.ListProductsResponse - * @instance - */ - ListProductsResponse.prototype.totalSize = 0; - - /** - * Creates a new ListProductsResponse instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance */ - ListProductsResponse.create = function create(properties) { - return new ListProductsResponse(properties); + RemoveFulfillmentPlacesMetadata.create = function create(properties) { + return new RemoveFulfillmentPlacesMetadata(properties); }; /** - * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encode = function encode(message, writer) { + RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.google.cloud.retail.v2alpha.Product.encode(message.products[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.totalSize != null && Object.hasOwnProperty.call(message, "totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListProductsResponse.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decode = function decode(reader, length) { + RemoveFulfillmentPlacesMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -88729,160 +99944,108 @@ }; /** - * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListProductsResponse message. + * Verifies a RemoveFulfillmentPlacesMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListProductsResponse.verify = function verify(message) { + RemoveFulfillmentPlacesMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.products[i]); - if (error) - return "products." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.ListProductsResponse} ListProductsResponse + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata */ - ListProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.ListProductsResponse) + RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) return object; - var message = new $root.google.cloud.retail.v2alpha.ListProductsResponse(); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.ListProductsResponse.products: object expected"); - message.products[i] = $root.google.cloud.retail.v2alpha.Product.fromObject(object.products[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; + return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); }; /** - * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static - * @param {google.cloud.retail.v2alpha.ListProductsResponse} message ListProductsResponse + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListProductsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.products = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.google.cloud.retail.v2alpha.Product.toObject(message.products[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; + RemoveFulfillmentPlacesMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this ListProductsResponse to JSON. + * Converts this RemoveFulfillmentPlacesMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @instance * @returns {Object.} JSON object */ - ListProductsResponse.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListProductsResponse + * Gets the default type url for RemoveFulfillmentPlacesMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.ListProductsResponse + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveFulfillmentPlacesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListProductsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata"; }; - return ListProductsResponse; + return RemoveFulfillmentPlacesMetadata; })(); - v2alpha.SetInventoryRequest = (function() { + v2alpha.RemoveFulfillmentPlacesResponse = (function() { /** - * Properties of a SetInventoryRequest. + * Properties of a RemoveFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryRequest - * @property {google.cloud.retail.v2alpha.IProduct|null} [inventory] SetInventoryRequest inventory - * @property {google.protobuf.IFieldMask|null} [setMask] SetInventoryRequest setMask - * @property {google.protobuf.ITimestamp|null} [setTime] SetInventoryRequest setTime - * @property {boolean|null} [allowMissing] SetInventoryRequest allowMissing + * @interface IRemoveFulfillmentPlacesResponse */ /** - * Constructs a new SetInventoryRequest. + * Constructs a new RemoveFulfillmentPlacesResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryRequest. - * @implements ISetInventoryRequest + * @classdesc Represents a RemoveFulfillmentPlacesResponse. + * @implements IRemoveFulfillmentPlacesResponse * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set */ - function SetInventoryRequest(properties) { + function RemoveFulfillmentPlacesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88890,119 +100053,63 @@ } /** - * SetInventoryRequest inventory. - * @member {google.cloud.retail.v2alpha.IProduct|null|undefined} inventory - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.inventory = null; - - /** - * SetInventoryRequest setMask. - * @member {google.protobuf.IFieldMask|null|undefined} setMask - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.setMask = null; - - /** - * SetInventoryRequest setTime. - * @member {google.protobuf.ITimestamp|null|undefined} setTime - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.setTime = null; - - /** - * SetInventoryRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest - * @instance - */ - SetInventoryRequest.prototype.allowMissing = false; - - /** - * Creates a new SetInventoryRequest instance using the specified properties. + * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest instance + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance */ - SetInventoryRequest.create = function create(properties) { - return new SetInventoryRequest(properties); + RemoveFulfillmentPlacesResponse.create = function create(properties) { + return new RemoveFulfillmentPlacesResponse(properties); }; /** - * Encodes the specified SetInventoryRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encode = function encode(message, writer) { + RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inventory != null && Object.hasOwnProperty.call(message, "inventory")) - $root.google.cloud.retail.v2alpha.Product.encode(message.inventory, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.setMask != null && Object.hasOwnProperty.call(message, "setMask")) - $root.google.protobuf.FieldMask.encode(message.setMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.setTime != null && Object.hasOwnProperty.call(message, "setTime")) - $root.google.protobuf.Timestamp.encode(message.setTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); return writer; }; /** - * Encodes the specified SetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryRequest.verify|verify} messages. + * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryRequest} message SetInventoryRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decode = function decode(reader, length) { + RemoveFulfillmentPlacesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.inventory = $root.google.cloud.retail.v2alpha.Product.decode(reader, reader.uint32()); - break; - } - case 2: { - message.setMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.setTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -89012,161 +100119,108 @@ }; /** - * Decodes a SetInventoryRequest message from the specified reader or buffer, length delimited. + * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryRequest message. + * Verifies a RemoveFulfillmentPlacesResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryRequest.verify = function verify(message) { + RemoveFulfillmentPlacesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inventory != null && message.hasOwnProperty("inventory")) { - var error = $root.google.cloud.retail.v2alpha.Product.verify(message.inventory); - if (error) - return "inventory." + error; - } - if (message.setMask != null && message.hasOwnProperty("setMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.setMask); - if (error) - return "setMask." + error; - } - if (message.setTime != null && message.hasOwnProperty("setTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.setTime); - if (error) - return "setTime." + error; - } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates a SetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryRequest} SetInventoryRequest + * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse */ - SetInventoryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryRequest) + RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.SetInventoryRequest(); - if (object.inventory != null) { - if (typeof object.inventory !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.inventory: object expected"); - message.inventory = $root.google.cloud.retail.v2alpha.Product.fromObject(object.inventory); - } - if (object.setMask != null) { - if (typeof object.setMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setMask: object expected"); - message.setMask = $root.google.protobuf.FieldMask.fromObject(object.setMask); - } - if (object.setTime != null) { - if (typeof object.setTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.SetInventoryRequest.setTime: object expected"); - message.setTime = $root.google.protobuf.Timestamp.fromObject(object.setTime); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; + return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); }; /** - * Creates a plain object from a SetInventoryRequest message. Also converts values to other types if specified. + * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static - * @param {google.cloud.retail.v2alpha.SetInventoryRequest} message SetInventoryRequest + * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inventory = null; - object.setMask = null; - object.setTime = null; - object.allowMissing = false; - } - if (message.inventory != null && message.hasOwnProperty("inventory")) - object.inventory = $root.google.cloud.retail.v2alpha.Product.toObject(message.inventory, options); - if (message.setMask != null && message.hasOwnProperty("setMask")) - object.setMask = $root.google.protobuf.FieldMask.toObject(message.setMask, options); - if (message.setTime != null && message.hasOwnProperty("setTime")) - object.setTime = $root.google.protobuf.Timestamp.toObject(message.setTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; + RemoveFulfillmentPlacesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this SetInventoryRequest to JSON. + * Converts this RemoveFulfillmentPlacesResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @instance * @returns {Object.} JSON object */ - SetInventoryRequest.prototype.toJSON = function toJSON() { + RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetInventoryRequest + * Gets the default type url for RemoveFulfillmentPlacesResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SetInventoryRequest + * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RemoveFulfillmentPlacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse"; }; - return SetInventoryRequest; + return RemoveFulfillmentPlacesResponse; })(); - v2alpha.SetInventoryMetadata = (function() { + v2alpha.PurgeMetadata = (function() { /** - * Properties of a SetInventoryMetadata. + * Properties of a PurgeMetadata. * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryMetadata + * @interface IPurgeMetadata */ /** - * Constructs a new SetInventoryMetadata. + * Constructs a new PurgeMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryMetadata. - * @implements ISetInventoryMetadata + * @classdesc Represents a PurgeMetadata. + * @implements IPurgeMetadata * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set */ - function SetInventoryMetadata(properties) { + function PurgeMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89174,60 +100228,60 @@ } /** - * Creates a new SetInventoryMetadata instance using the specified properties. + * Creates a new PurgeMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata instance + * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata instance */ - SetInventoryMetadata.create = function create(properties) { - return new SetInventoryMetadata(properties); + PurgeMetadata.create = function create(properties) { + return new PurgeMetadata(properties); }; /** - * Encodes the specified SetInventoryMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encode = function encode(message, writer) { + PurgeMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified SetInventoryMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryMetadata.verify|verify} messages. + * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryMetadata} message SetInventoryMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryMetadata.encodeDelimited = function encodeDelimited(message, writer) { + PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer. + * Decodes a PurgeMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decode = function decode(reader, length) { + PurgeMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -89240,108 +100294,112 @@ }; /** - * Decodes a SetInventoryMetadata message from the specified reader or buffer, length delimited. + * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryMetadata.decodeDelimited = function decodeDelimited(reader) { + PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryMetadata message. + * Verifies a PurgeMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryMetadata.verify = function verify(message) { + PurgeMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a SetInventoryMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryMetadata} SetInventoryMetadata + * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata */ - SetInventoryMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryMetadata) + PurgeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeMetadata) return object; - return new $root.google.cloud.retail.v2alpha.SetInventoryMetadata(); + return new $root.google.cloud.retail.v2alpha.PurgeMetadata(); }; /** - * Creates a plain object from a SetInventoryMetadata message. Also converts values to other types if specified. + * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static - * @param {google.cloud.retail.v2alpha.SetInventoryMetadata} message SetInventoryMetadata + * @param {google.cloud.retail.v2alpha.PurgeMetadata} message PurgeMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryMetadata.toObject = function toObject() { + PurgeMetadata.toObject = function toObject() { return {}; }; /** - * Converts this SetInventoryMetadata to JSON. + * Converts this PurgeMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @instance * @returns {Object.} JSON object */ - SetInventoryMetadata.prototype.toJSON = function toJSON() { + PurgeMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetInventoryMetadata + * Gets the default type url for PurgeMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SetInventoryMetadata + * @memberof google.cloud.retail.v2alpha.PurgeMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetInventoryMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeMetadata"; }; - return SetInventoryMetadata; + return PurgeMetadata; })(); - v2alpha.SetInventoryResponse = (function() { + v2alpha.PurgeProductsMetadata = (function() { /** - * Properties of a SetInventoryResponse. + * Properties of a PurgeProductsMetadata. * @memberof google.cloud.retail.v2alpha - * @interface ISetInventoryResponse + * @interface IPurgeProductsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] PurgeProductsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PurgeProductsMetadata updateTime + * @property {number|Long|null} [successCount] PurgeProductsMetadata successCount + * @property {number|Long|null} [failureCount] PurgeProductsMetadata failureCount */ /** - * Constructs a new SetInventoryResponse. + * Constructs a new PurgeProductsMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a SetInventoryResponse. - * @implements ISetInventoryResponse + * @classdesc Represents a PurgeProductsMetadata. + * @implements IPurgeProductsMetadata * @constructor - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata=} [properties] Properties to set */ - function SetInventoryResponse(properties) { + function PurgeProductsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89349,63 +100407,119 @@ } /** - * Creates a new SetInventoryResponse instance using the specified properties. + * PurgeProductsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.createTime = null; + + /** + * PurgeProductsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.updateTime = null; + + /** + * PurgeProductsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PurgeProductsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse instance + * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata instance */ - SetInventoryResponse.create = function create(properties) { - return new SetInventoryResponse(properties); + PurgeProductsMetadata.create = function create(properties) { + return new PurgeProductsMetadata(properties); }; /** - * Encodes the specified SetInventoryResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryResponse.encode = function encode(message, writer) { + PurgeProductsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); return writer; }; /** - * Encodes the specified SetInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.SetInventoryResponse.verify|verify} messages. + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static - * @param {google.cloud.retail.v2alpha.ISetInventoryResponse} message SetInventoryResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + PurgeProductsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer. + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryResponse.decode = function decode(reader, length) { + PurgeProductsMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsMetadata(); 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -89415,114 +100529,187 @@ }; /** - * Decodes a SetInventoryResponse message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetInventoryResponse.decodeDelimited = function decodeDelimited(reader) { + PurgeProductsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetInventoryResponse message. + * Verifies a PurgeProductsMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetInventoryResponse.verify = function verify(message) { + PurgeProductsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; return null; }; /** - * Creates a SetInventoryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.SetInventoryResponse} SetInventoryResponse + * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata */ - SetInventoryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.SetInventoryResponse) + PurgeProductsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsMetadata) return object; - return new $root.google.cloud.retail.v2alpha.SetInventoryResponse(); + var message = new $root.google.cloud.retail.v2alpha.PurgeProductsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2alpha.PurgeProductsMetadata.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.retail.v2alpha.PurgeProductsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; }; /** - * Creates a plain object from a SetInventoryResponse message. Also converts values to other types if specified. + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static - * @param {google.cloud.retail.v2alpha.SetInventoryResponse} message SetInventoryResponse + * @param {google.cloud.retail.v2alpha.PurgeProductsMetadata} message PurgeProductsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetInventoryResponse.toObject = function toObject() { - return {}; + PurgeProductsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; }; /** - * Converts this SetInventoryResponse to JSON. + * Converts this PurgeProductsMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @instance * @returns {Object.} JSON object */ - SetInventoryResponse.prototype.toJSON = function toJSON() { + PurgeProductsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetInventoryResponse + * Gets the default type url for PurgeProductsMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.SetInventoryResponse + * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetInventoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeProductsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.SetInventoryResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsMetadata"; }; - return SetInventoryResponse; + return PurgeProductsMetadata; })(); - v2alpha.AddFulfillmentPlacesRequest = (function() { + v2alpha.PurgeProductsRequest = (function() { /** - * Properties of an AddFulfillmentPlacesRequest. + * Properties of a PurgeProductsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesRequest - * @property {string|null} [product] AddFulfillmentPlacesRequest product - * @property {string|null} [type] AddFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] AddFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [addTime] AddFulfillmentPlacesRequest addTime - * @property {boolean|null} [allowMissing] AddFulfillmentPlacesRequest allowMissing + * @interface IPurgeProductsRequest + * @property {string|null} [parent] PurgeProductsRequest parent + * @property {string|null} [filter] PurgeProductsRequest filter + * @property {boolean|null} [force] PurgeProductsRequest force */ /** - * Constructs a new AddFulfillmentPlacesRequest. + * Constructs a new PurgeProductsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesRequest. - * @implements IAddFulfillmentPlacesRequest + * @classdesc Represents a PurgeProductsRequest. + * @implements IPurgeProductsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest=} [properties] Properties to set */ - function AddFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function PurgeProductsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89530,134 +100717,103 @@ } /** - * AddFulfillmentPlacesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest - * @instance - */ - AddFulfillmentPlacesRequest.prototype.product = ""; - - /** - * AddFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest - * @instance - */ - AddFulfillmentPlacesRequest.prototype.type = ""; - - /** - * AddFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PurgeProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; + PurgeProductsRequest.prototype.parent = ""; /** - * AddFulfillmentPlacesRequest addTime. - * @member {google.protobuf.ITimestamp|null|undefined} addTime - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PurgeProductsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.addTime = null; + PurgeProductsRequest.prototype.filter = ""; /** - * AddFulfillmentPlacesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * PurgeProductsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @instance */ - AddFulfillmentPlacesRequest.prototype.allowMissing = false; + PurgeProductsRequest.prototype.force = false; /** - * Creates a new AddFulfillmentPlacesRequest instance using the specified properties. + * Creates a new PurgeProductsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest instance */ - AddFulfillmentPlacesRequest.create = function create(properties) { - return new AddFulfillmentPlacesRequest(properties); + PurgeProductsRequest.create = function create(properties) { + return new PurgeProductsRequest(properties); }; /** - * Encodes the specified AddFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encode = function encode(message, writer) { + PurgeProductsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) - $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + 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 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + PurgeProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes a PurgeProductsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decode = function decode(reader, length) { + PurgeProductsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.product = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.type = reader.string(); + message.filter = reader.string(); break; } case 3: { - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - } - case 4: { - message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.allowMissing = reader.bool(); + message.force = reader.bool(); break; } default: @@ -89669,172 +100825,141 @@ }; /** - * Decodes an AddFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + PurgeProductsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesRequest message. + * Verifies a PurgeProductsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesRequest.verify = function verify(message) { + PurgeProductsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - if (message.addTime != null && message.hasOwnProperty("addTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.addTime); - if (error) - return "addTime." + error; - } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean 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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates an AddFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} AddFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest */ - AddFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest) + PurgeProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } - if (object.addTime != null) { - if (typeof object.addTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest.addTime: object expected"); - message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + var message = new $root.google.cloud.retail.v2alpha.PurgeProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from an AddFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest} message AddFulfillmentPlacesRequest + * @param {google.cloud.retail.v2alpha.PurgeProductsRequest} message PurgeProductsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesRequest.toObject = function toObject(message, options) { + PurgeProductsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; if (options.defaults) { - object.product = ""; - object.type = ""; - object.addTime = null; - object.allowMissing = false; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + object.parent = ""; + object.filter = ""; + object.force = false; } - if (message.addTime != null && message.hasOwnProperty("addTime")) - object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this AddFulfillmentPlacesRequest to JSON. + * Converts this PurgeProductsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + PurgeProductsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddFulfillmentPlacesRequest + * Gets the default type url for PurgeProductsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddFulfillmentPlacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsRequest"; }; - return AddFulfillmentPlacesRequest; + return PurgeProductsRequest; })(); - v2alpha.AddFulfillmentPlacesMetadata = (function() { + v2alpha.PurgeProductsResponse = (function() { /** - * Properties of an AddFulfillmentPlacesMetadata. + * Properties of a PurgeProductsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesMetadata + * @interface IPurgeProductsResponse + * @property {number|Long|null} [purgeCount] PurgeProductsResponse purgeCount + * @property {Array.|null} [purgeSample] PurgeProductsResponse purgeSample */ /** - * Constructs a new AddFulfillmentPlacesMetadata. + * Constructs a new PurgeProductsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesMetadata. - * @implements IAddFulfillmentPlacesMetadata + * @classdesc Represents a PurgeProductsResponse. + * @implements IPurgeProductsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse=} [properties] Properties to set */ - function AddFulfillmentPlacesMetadata(properties) { + function PurgeProductsResponse(properties) { + this.purgeSample = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89842,63 +100967,94 @@ } /** - * Creates a new AddFulfillmentPlacesMetadata instance using the specified properties. + * PurgeProductsResponse purgeCount. + * @member {number|Long} purgeCount + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsResponse purgeSample. + * @member {Array.} purgeSample + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeSample = $util.emptyArray; + + /** + * Creates a new PurgeProductsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse instance */ - AddFulfillmentPlacesMetadata.create = function create(properties) { - return new AddFulfillmentPlacesMetadata(properties); + PurgeProductsResponse.create = function create(properties) { + return new PurgeProductsResponse(properties); }; /** - * Encodes the specified AddFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesMetadata.encode = function encode(message, writer) { + PurgeProductsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.purgeCount != null && Object.hasOwnProperty.call(message, "purgeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgeCount); + if (message.purgeSample != null && message.purgeSample.length) + for (var i = 0; i < message.purgeSample.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.purgeSample[i]); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + PurgeProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes a PurgeProductsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesMetadata.decode = function decode(reader, length) { + PurgeProductsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.purgeCount = reader.int64(); + break; + } + case 2: { + if (!(message.purgeSample && message.purgeSample.length)) + message.purgeSample = []; + message.purgeSample.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -89908,108 +101064,159 @@ }; /** - * Decodes an AddFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + PurgeProductsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesMetadata message. + * Verifies a PurgeProductsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesMetadata.verify = function verify(message) { + PurgeProductsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (!$util.isInteger(message.purgeCount) && !(message.purgeCount && $util.isInteger(message.purgeCount.low) && $util.isInteger(message.purgeCount.high))) + return "purgeCount: integer|Long expected"; + if (message.purgeSample != null && message.hasOwnProperty("purgeSample")) { + if (!Array.isArray(message.purgeSample)) + return "purgeSample: array expected"; + for (var i = 0; i < message.purgeSample.length; ++i) + if (!$util.isString(message.purgeSample[i])) + return "purgeSample: string[] expected"; + } return null; }; /** - * Creates an AddFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} AddFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse */ - AddFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata) + PurgeProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsResponse) return object; - return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.PurgeProductsResponse(); + if (object.purgeCount != null) + if ($util.Long) + (message.purgeCount = $util.Long.fromValue(object.purgeCount)).unsigned = false; + else if (typeof object.purgeCount === "string") + message.purgeCount = parseInt(object.purgeCount, 10); + else if (typeof object.purgeCount === "number") + message.purgeCount = object.purgeCount; + else if (typeof object.purgeCount === "object") + message.purgeCount = new $util.LongBits(object.purgeCount.low >>> 0, object.purgeCount.high >>> 0).toNumber(); + if (object.purgeSample) { + if (!Array.isArray(object.purgeSample)) + throw TypeError(".google.cloud.retail.v2alpha.PurgeProductsResponse.purgeSample: array expected"); + message.purgeSample = []; + for (var i = 0; i < object.purgeSample.length; ++i) + message.purgeSample[i] = String(object.purgeSample[i]); + } + return message; }; /** - * Creates a plain object from an AddFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata} message AddFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2alpha.PurgeProductsResponse} message PurgeProductsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesMetadata.toObject = function toObject() { - return {}; + PurgeProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeSample = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgeCount = options.longs === String ? "0" : 0; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (typeof message.purgeCount === "number") + object.purgeCount = options.longs === String ? String(message.purgeCount) : message.purgeCount; + else + object.purgeCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgeCount) : options.longs === Number ? new $util.LongBits(message.purgeCount.low >>> 0, message.purgeCount.high >>> 0).toNumber() : message.purgeCount; + if (message.purgeSample && message.purgeSample.length) { + object.purgeSample = []; + for (var j = 0; j < message.purgeSample.length; ++j) + object.purgeSample[j] = message.purgeSample[j]; + } + return object; }; /** - * Converts this AddFulfillmentPlacesMetadata to JSON. + * Converts this PurgeProductsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + PurgeProductsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddFulfillmentPlacesMetadata + * Gets the default type url for PurgeProductsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddFulfillmentPlacesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsResponse"; }; - return AddFulfillmentPlacesMetadata; + return PurgeProductsResponse; })(); - v2alpha.AddFulfillmentPlacesResponse = (function() { + v2alpha.PurgeUserEventsRequest = (function() { /** - * Properties of an AddFulfillmentPlacesResponse. + * Properties of a PurgeUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IAddFulfillmentPlacesResponse + * @interface IPurgeUserEventsRequest + * @property {string|null} [parent] PurgeUserEventsRequest parent + * @property {string|null} [filter] PurgeUserEventsRequest filter + * @property {boolean|null} [force] PurgeUserEventsRequest force */ /** - * Constructs a new AddFulfillmentPlacesResponse. + * Constructs a new PurgeUserEventsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddFulfillmentPlacesResponse. - * @implements IAddFulfillmentPlacesResponse + * @classdesc Represents a PurgeUserEventsRequest. + * @implements IPurgeUserEventsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set */ - function AddFulfillmentPlacesResponse(properties) { + function PurgeUserEventsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90017,63 +101224,105 @@ } /** - * Creates a new AddFulfillmentPlacesResponse instance using the specified properties. + * PurgeUserEventsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.parent = ""; + + /** + * PurgeUserEventsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.filter = ""; + + /** + * PurgeUserEventsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @instance + */ + PurgeUserEventsRequest.prototype.force = false; + + /** + * Creates a new PurgeUserEventsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest instance */ - AddFulfillmentPlacesResponse.create = function create(properties) { - return new AddFulfillmentPlacesResponse(properties); + PurgeUserEventsRequest.create = function create(properties) { + return new PurgeUserEventsRequest(properties); }; /** - * Encodes the specified AddFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encode = function encode(message, writer) { + PurgeUserEventsRequest.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 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified AddFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.IAddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decode = function decode(reader, length) { + PurgeUserEventsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -90083,114 +101332,139 @@ }; /** - * Decodes an AddFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddFulfillmentPlacesResponse message. + * Verifies a PurgeUserEventsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddFulfillmentPlacesResponse.verify = function verify(message) { + PurgeUserEventsRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates an AddFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} AddFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest */ - AddFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse) + PurgeUserEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest) return object; - return new $root.google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse(); + var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; }; /** - * Creates a plain object from an AddFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static - * @param {google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse} message AddFulfillmentPlacesResponse + * @param {google.cloud.retail.v2alpha.PurgeUserEventsRequest} message PurgeUserEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddFulfillmentPlacesResponse.toObject = function toObject() { - return {}; + PurgeUserEventsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; }; /** - * Converts this AddFulfillmentPlacesResponse to JSON. + * Converts this PurgeUserEventsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @instance * @returns {Object.} JSON object */ - AddFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + PurgeUserEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddFulfillmentPlacesResponse + * Gets the default type url for PurgeUserEventsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddFulfillmentPlacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddFulfillmentPlacesResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeUserEventsRequest"; }; - return AddFulfillmentPlacesResponse; + return PurgeUserEventsRequest; })(); - v2alpha.AddLocalInventoriesRequest = (function() { + v2alpha.PurgeUserEventsResponse = (function() { /** - * Properties of an AddLocalInventoriesRequest. + * Properties of a PurgeUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesRequest - * @property {string|null} [product] AddLocalInventoriesRequest product - * @property {Array.|null} [localInventories] AddLocalInventoriesRequest localInventories - * @property {google.protobuf.IFieldMask|null} [addMask] AddLocalInventoriesRequest addMask - * @property {google.protobuf.ITimestamp|null} [addTime] AddLocalInventoriesRequest addTime - * @property {boolean|null} [allowMissing] AddLocalInventoriesRequest allowMissing + * @interface IPurgeUserEventsResponse + * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount */ /** - * Constructs a new AddLocalInventoriesRequest. + * Constructs a new PurgeUserEventsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesRequest. - * @implements IAddLocalInventoriesRequest + * @classdesc Represents a PurgeUserEventsResponse. + * @implements IPurgeUserEventsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set */ - function AddLocalInventoriesRequest(properties) { - this.localInventories = []; + function PurgeUserEventsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90198,134 +101472,75 @@ } /** - * AddLocalInventoriesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @instance - */ - AddLocalInventoriesRequest.prototype.product = ""; - - /** - * AddLocalInventoriesRequest localInventories. - * @member {Array.} localInventories - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @instance - */ - AddLocalInventoriesRequest.prototype.localInventories = $util.emptyArray; - - /** - * AddLocalInventoriesRequest addMask. - * @member {google.protobuf.IFieldMask|null|undefined} addMask - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @instance - */ - AddLocalInventoriesRequest.prototype.addMask = null; - - /** - * AddLocalInventoriesRequest addTime. - * @member {google.protobuf.ITimestamp|null|undefined} addTime - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest - * @instance - */ - AddLocalInventoriesRequest.prototype.addTime = null; - - /** - * AddLocalInventoriesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * PurgeUserEventsResponse purgedEventsCount. + * @member {number|Long} purgedEventsCount + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @instance */ - AddLocalInventoriesRequest.prototype.allowMissing = false; + PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new AddLocalInventoriesRequest instance using the specified properties. + * Creates a new PurgeUserEventsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest instance + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse instance */ - AddLocalInventoriesRequest.create = function create(properties) { - return new AddLocalInventoriesRequest(properties); + PurgeUserEventsResponse.create = function create(properties) { + return new PurgeUserEventsResponse(properties); }; /** - * Encodes the specified AddLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesRequest.encode = function encode(message, writer) { + PurgeUserEventsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.localInventories != null && message.localInventories.length) - for (var i = 0; i < message.localInventories.length; ++i) - $root.google.cloud.retail.v2alpha.LocalInventory.encode(message.localInventories[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.addMask != null && Object.hasOwnProperty.call(message, "addMask")) - $root.google.protobuf.FieldMask.encode(message.addMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.addTime != null && Object.hasOwnProperty.call(message, "addTime")) - $root.google.protobuf.Timestamp.encode(message.addTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); + if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); return writer; }; /** - * Encodes the specified AddLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesRequest} message AddLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesRequest.decode = function decode(reader, length) { + PurgeUserEventsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.product = reader.string(); - break; - } - case 2: { - if (!(message.localInventories && message.localInventories.length)) - message.localInventories = []; - message.localInventories.push($root.google.cloud.retail.v2alpha.LocalInventory.decode(reader, reader.uint32())); - break; - } - case 4: { - message.addMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 5: { - message.addTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.allowMissing = reader.bool(); + message.purgedEventsCount = reader.int64(); break; } default: @@ -90337,182 +101552,139 @@ }; /** - * Decodes an AddLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddLocalInventoriesRequest message. + * Verifies a PurgeUserEventsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddLocalInventoriesRequest.verify = function verify(message) { + PurgeUserEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.localInventories != null && message.hasOwnProperty("localInventories")) { - if (!Array.isArray(message.localInventories)) - return "localInventories: array expected"; - for (var i = 0; i < message.localInventories.length; ++i) { - var error = $root.google.cloud.retail.v2alpha.LocalInventory.verify(message.localInventories[i]); - if (error) - return "localInventories." + error; - } - } - if (message.addMask != null && message.hasOwnProperty("addMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.addMask); - if (error) - return "addMask." + error; - } - if (message.addTime != null && message.hasOwnProperty("addTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.addTime); - if (error) - return "addTime." + error; - } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) + return "purgedEventsCount: integer|Long expected"; return null; }; /** - * Creates an AddLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} AddLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse */ - AddLocalInventoriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest) + PurgeUserEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.localInventories) { - if (!Array.isArray(object.localInventories)) - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.localInventories: array expected"); - message.localInventories = []; - for (var i = 0; i < object.localInventories.length; ++i) { - if (typeof object.localInventories[i] !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.localInventories: object expected"); - message.localInventories[i] = $root.google.cloud.retail.v2alpha.LocalInventory.fromObject(object.localInventories[i]); - } - } - if (object.addMask != null) { - if (typeof object.addMask !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addMask: object expected"); - message.addMask = $root.google.protobuf.FieldMask.fromObject(object.addMask); - } - if (object.addTime != null) { - if (typeof object.addTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.AddLocalInventoriesRequest.addTime: object expected"); - message.addTime = $root.google.protobuf.Timestamp.fromObject(object.addTime); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); + var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); + if (object.purgedEventsCount != null) + if ($util.Long) + (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; + else if (typeof object.purgedEventsCount === "string") + message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); + else if (typeof object.purgedEventsCount === "number") + message.purgedEventsCount = object.purgedEventsCount; + else if (typeof object.purgedEventsCount === "object") + message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an AddLocalInventoriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesRequest} message AddLocalInventoriesRequest + * @param {google.cloud.retail.v2alpha.PurgeUserEventsResponse} message PurgeUserEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddLocalInventoriesRequest.toObject = function toObject(message, options) { + PurgeUserEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.localInventories = []; - if (options.defaults) { - object.product = ""; - object.addMask = null; - object.addTime = null; - object.allowMissing = false; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.localInventories && message.localInventories.length) { - object.localInventories = []; - for (var j = 0; j < message.localInventories.length; ++j) - object.localInventories[j] = $root.google.cloud.retail.v2alpha.LocalInventory.toObject(message.localInventories[j], options); - } - if (message.addMask != null && message.hasOwnProperty("addMask")) - object.addMask = $root.google.protobuf.FieldMask.toObject(message.addMask, options); - if (message.addTime != null && message.hasOwnProperty("addTime")) - object.addTime = $root.google.protobuf.Timestamp.toObject(message.addTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgedEventsCount = options.longs === String ? "0" : 0; + if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) + if (typeof message.purgedEventsCount === "number") + object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; + else + object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; return object; }; /** - * Converts this AddLocalInventoriesRequest to JSON. + * Converts this PurgeUserEventsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @instance * @returns {Object.} JSON object */ - AddLocalInventoriesRequest.prototype.toJSON = function toJSON() { + PurgeUserEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddLocalInventoriesRequest + * Gets the default type url for PurgeUserEventsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddLocalInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PurgeUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeUserEventsResponse"; }; - return AddLocalInventoriesRequest; + return PurgeUserEventsResponse; })(); - v2alpha.AddLocalInventoriesMetadata = (function() { + v2alpha.LoggingConfig = (function() { /** - * Properties of an AddLocalInventoriesMetadata. + * Properties of a LoggingConfig. * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesMetadata + * @interface ILoggingConfig + * @property {string|null} [name] LoggingConfig name + * @property {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null} [defaultLogGenerationRule] LoggingConfig defaultLogGenerationRule + * @property {Array.|null} [serviceLogGenerationRules] LoggingConfig serviceLogGenerationRules */ /** - * Constructs a new AddLocalInventoriesMetadata. + * Constructs a new LoggingConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesMetadata. - * @implements IAddLocalInventoriesMetadata + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.ILoggingConfig=} [properties] Properties to set */ - function AddLocalInventoriesMetadata(properties) { + function LoggingConfig(properties) { + this.serviceLogGenerationRules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90520,63 +101692,108 @@ } /** - * Creates a new AddLocalInventoriesMetadata instance using the specified properties. + * LoggingConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @instance + */ + LoggingConfig.prototype.name = ""; + + /** + * LoggingConfig defaultLogGenerationRule. + * @member {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null|undefined} defaultLogGenerationRule + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @instance + */ + LoggingConfig.prototype.defaultLogGenerationRule = null; + + /** + * LoggingConfig serviceLogGenerationRules. + * @member {Array.} serviceLogGenerationRules + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @instance + */ + LoggingConfig.prototype.serviceLogGenerationRules = $util.emptyArray; + + /** + * Creates a new LoggingConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata instance + * @param {google.cloud.retail.v2alpha.ILoggingConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.LoggingConfig} LoggingConfig instance */ - AddLocalInventoriesMetadata.create = function create(properties) { - return new AddLocalInventoriesMetadata(properties); + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); }; /** - * Encodes the specified AddLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ILoggingConfig} message LoggingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesMetadata.encode = function encode(message, writer) { + LoggingConfig.encode = function encode(message, writer) { 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.defaultLogGenerationRule != null && Object.hasOwnProperty.call(message, "defaultLogGenerationRule")) + $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.encode(message.defaultLogGenerationRule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceLogGenerationRules != null && message.serviceLogGenerationRules.length) + for (var i = 0; i < message.serviceLogGenerationRules.length; ++i) + $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.encode(message.serviceLogGenerationRules[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified AddLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesMetadata} message AddLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.ILoggingConfig} message LoggingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a LoggingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.LoggingConfig} LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesMetadata.decode = function decode(reader, length) { + LoggingConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.LoggingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.defaultLogGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.serviceLogGenerationRules && message.serviceLogGenerationRules.length)) + message.serviceLogGenerationRules = []; + message.serviceLogGenerationRules.push($root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -90586,108 +101803,695 @@ }; /** - * Decodes an AddLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.LoggingConfig} LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddLocalInventoriesMetadata message. + * Verifies a LoggingConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddLocalInventoriesMetadata.verify = function verify(message) { + LoggingConfig.verify = function verify(message) { if (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.defaultLogGenerationRule != null && message.hasOwnProperty("defaultLogGenerationRule")) { + var error = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify(message.defaultLogGenerationRule); + if (error) + return "defaultLogGenerationRule." + error; + } + if (message.serviceLogGenerationRules != null && message.hasOwnProperty("serviceLogGenerationRules")) { + if (!Array.isArray(message.serviceLogGenerationRules)) + return "serviceLogGenerationRules: array expected"; + for (var i = 0; i < message.serviceLogGenerationRules.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.verify(message.serviceLogGenerationRules[i]); + if (error) + return "serviceLogGenerationRules." + error; + } + } return null; }; /** - * Creates an AddLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} AddLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.LoggingConfig} LoggingConfig */ - AddLocalInventoriesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata) + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.LoggingConfig) return object; - return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.LoggingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.defaultLogGenerationRule != null) { + if (typeof object.defaultLogGenerationRule !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LoggingConfig.defaultLogGenerationRule: object expected"); + message.defaultLogGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.fromObject(object.defaultLogGenerationRule); + } + if (object.serviceLogGenerationRules) { + if (!Array.isArray(object.serviceLogGenerationRules)) + throw TypeError(".google.cloud.retail.v2alpha.LoggingConfig.serviceLogGenerationRules: array expected"); + message.serviceLogGenerationRules = []; + for (var i = 0; i < object.serviceLogGenerationRules.length; ++i) { + if (typeof object.serviceLogGenerationRules[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LoggingConfig.serviceLogGenerationRules: object expected"); + message.serviceLogGenerationRules[i] = $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.fromObject(object.serviceLogGenerationRules[i]); + } + } + return message; }; /** - * Creates a plain object from an AddLocalInventoriesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.LoggingConfig * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesMetadata} message AddLocalInventoriesMetadata + * @param {google.cloud.retail.v2alpha.LoggingConfig} message LoggingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddLocalInventoriesMetadata.toObject = function toObject() { - return {}; + LoggingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceLogGenerationRules = []; + if (options.defaults) { + object.name = ""; + object.defaultLogGenerationRule = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.defaultLogGenerationRule != null && message.hasOwnProperty("defaultLogGenerationRule")) + object.defaultLogGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.toObject(message.defaultLogGenerationRule, options); + if (message.serviceLogGenerationRules && message.serviceLogGenerationRules.length) { + object.serviceLogGenerationRules = []; + for (var j = 0; j < message.serviceLogGenerationRules.length; ++j) + object.serviceLogGenerationRules[j] = $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.toObject(message.serviceLogGenerationRules[j], options); + } + return object; + }; + + /** + * Converts this LoggingConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @instance + * @returns {Object.} JSON object + */ + LoggingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.LoggingConfig"; }; - /** - * Converts this AddLocalInventoriesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata - * @instance - * @returns {Object.} JSON object - */ - AddLocalInventoriesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + LoggingConfig.LogGenerationRule = (function() { + + /** + * Properties of a LogGenerationRule. + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @interface ILogGenerationRule + * @property {google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel|null} [loggingLevel] LogGenerationRule loggingLevel + * @property {number|null} [infoLogSampleRate] LogGenerationRule infoLogSampleRate + */ + + /** + * Constructs a new LogGenerationRule. + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @classdesc Represents a LogGenerationRule. + * @implements ILogGenerationRule + * @constructor + * @param {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule=} [properties] Properties to set + */ + function LogGenerationRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogGenerationRule loggingLevel. + * @member {google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel} loggingLevel + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @instance + */ + LogGenerationRule.prototype.loggingLevel = 0; + + /** + * LogGenerationRule infoLogSampleRate. + * @member {number|null|undefined} infoLogSampleRate + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @instance + */ + LogGenerationRule.prototype.infoLogSampleRate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogGenerationRule _infoLogSampleRate. + * @member {"infoLogSampleRate"|undefined} _infoLogSampleRate + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @instance + */ + Object.defineProperty(LogGenerationRule.prototype, "_infoLogSampleRate", { + get: $util.oneOfGetter($oneOfFields = ["infoLogSampleRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogGenerationRule instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule} LogGenerationRule instance + */ + LogGenerationRule.create = function create(properties) { + return new LogGenerationRule(properties); + }; + + /** + * Encodes the specified LogGenerationRule message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule} message LogGenerationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogGenerationRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.loggingLevel != null && Object.hasOwnProperty.call(message, "loggingLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.loggingLevel); + if (message.infoLogSampleRate != null && Object.hasOwnProperty.call(message, "infoLogSampleRate")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.infoLogSampleRate); + return writer; + }; + + /** + * Encodes the specified LogGenerationRule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule} message LogGenerationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogGenerationRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogGenerationRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule} LogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogGenerationRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.loggingLevel = reader.int32(); + break; + } + case 2: { + message.infoLogSampleRate = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogGenerationRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule} LogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogGenerationRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogGenerationRule message. + * @function verify + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogGenerationRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.loggingLevel != null && message.hasOwnProperty("loggingLevel")) + switch (message.loggingLevel) { + default: + return "loggingLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.infoLogSampleRate != null && message.hasOwnProperty("infoLogSampleRate")) { + properties._infoLogSampleRate = 1; + if (typeof message.infoLogSampleRate !== "number") + return "infoLogSampleRate: number expected"; + } + return null; + }; + + /** + * Creates a LogGenerationRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule} LogGenerationRule + */ + LogGenerationRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule) + return object; + var message = new $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule(); + switch (object.loggingLevel) { + default: + if (typeof object.loggingLevel === "number") { + message.loggingLevel = object.loggingLevel; + break; + } + break; + case "LOGGING_LEVEL_UNSPECIFIED": + case 0: + message.loggingLevel = 0; + break; + case "LOGGING_DISABLED": + case 1: + message.loggingLevel = 1; + break; + case "LOG_ERRORS_AND_ABOVE": + case 2: + message.loggingLevel = 2; + break; + case "LOG_WARNINGS_AND_ABOVE": + case 3: + message.loggingLevel = 3; + break; + case "LOG_ALL": + case 4: + message.loggingLevel = 4; + break; + } + if (object.infoLogSampleRate != null) + message.infoLogSampleRate = Number(object.infoLogSampleRate); + return message; + }; + + /** + * Creates a plain object from a LogGenerationRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule} message LogGenerationRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogGenerationRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.loggingLevel = options.enums === String ? "LOGGING_LEVEL_UNSPECIFIED" : 0; + if (message.loggingLevel != null && message.hasOwnProperty("loggingLevel")) + object.loggingLevel = options.enums === String ? $root.google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel[message.loggingLevel] === undefined ? message.loggingLevel : $root.google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel[message.loggingLevel] : message.loggingLevel; + if (message.infoLogSampleRate != null && message.hasOwnProperty("infoLogSampleRate")) { + object.infoLogSampleRate = options.json && !isFinite(message.infoLogSampleRate) ? String(message.infoLogSampleRate) : message.infoLogSampleRate; + if (options.oneofs) + object._infoLogSampleRate = "infoLogSampleRate"; + } + return object; + }; + + /** + * Converts this LogGenerationRule to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @instance + * @returns {Object.} JSON object + */ + LogGenerationRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogGenerationRule + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogGenerationRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule"; + }; + + return LogGenerationRule; + })(); + + LoggingConfig.ServiceLogGenerationRule = (function() { + + /** + * Properties of a ServiceLogGenerationRule. + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @interface IServiceLogGenerationRule + * @property {string|null} [serviceName] ServiceLogGenerationRule serviceName + * @property {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null} [logGenerationRule] ServiceLogGenerationRule logGenerationRule + */ + + /** + * Constructs a new ServiceLogGenerationRule. + * @memberof google.cloud.retail.v2alpha.LoggingConfig + * @classdesc Represents a ServiceLogGenerationRule. + * @implements IServiceLogGenerationRule + * @constructor + * @param {google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule=} [properties] Properties to set + */ + function ServiceLogGenerationRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceLogGenerationRule serviceName. + * @member {string} serviceName + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @instance + */ + ServiceLogGenerationRule.prototype.serviceName = ""; + + /** + * ServiceLogGenerationRule logGenerationRule. + * @member {google.cloud.retail.v2alpha.LoggingConfig.ILogGenerationRule|null|undefined} logGenerationRule + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @instance + */ + ServiceLogGenerationRule.prototype.logGenerationRule = null; + + /** + * Creates a new ServiceLogGenerationRule instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule} ServiceLogGenerationRule instance + */ + ServiceLogGenerationRule.create = function create(properties) { + return new ServiceLogGenerationRule(properties); + }; + + /** + * Encodes the specified ServiceLogGenerationRule message. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule} message ServiceLogGenerationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLogGenerationRule.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.logGenerationRule != null && Object.hasOwnProperty.call(message, "logGenerationRule")) + $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.encode(message.logGenerationRule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceLogGenerationRule message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.IServiceLogGenerationRule} message ServiceLogGenerationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLogGenerationRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLogGenerationRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule} ServiceLogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLogGenerationRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 3: { + message.logGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLogGenerationRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule} ServiceLogGenerationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLogGenerationRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLogGenerationRule message. + * @function verify + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLogGenerationRule.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.logGenerationRule != null && message.hasOwnProperty("logGenerationRule")) { + var error = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.verify(message.logGenerationRule); + if (error) + return "logGenerationRule." + error; + } + return null; + }; + + /** + * Creates a ServiceLogGenerationRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule} ServiceLogGenerationRule + */ + ServiceLogGenerationRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule) + return object; + var message = new $root.google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.logGenerationRule != null) { + if (typeof object.logGenerationRule !== "object") + throw TypeError(".google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule.logGenerationRule: object expected"); + message.logGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.fromObject(object.logGenerationRule); + } + return message; + }; + + /** + * Creates a plain object from a ServiceLogGenerationRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule} message ServiceLogGenerationRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLogGenerationRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.logGenerationRule = null; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.logGenerationRule != null && message.hasOwnProperty("logGenerationRule")) + object.logGenerationRule = $root.google.cloud.retail.v2alpha.LoggingConfig.LogGenerationRule.toObject(message.logGenerationRule, options); + return object; + }; + + /** + * Converts this ServiceLogGenerationRule to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @instance + * @returns {Object.} JSON object + */ + ServiceLogGenerationRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceLogGenerationRule + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceLogGenerationRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.LoggingConfig.ServiceLogGenerationRule"; + }; + + return ServiceLogGenerationRule; + })(); /** - * Gets the default type url for AddLocalInventoriesMetadata - * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * LoggingLevel enum. + * @name google.cloud.retail.v2alpha.LoggingConfig.LoggingLevel + * @enum {number} + * @property {number} LOGGING_LEVEL_UNSPECIFIED=0 LOGGING_LEVEL_UNSPECIFIED value + * @property {number} LOGGING_DISABLED=1 LOGGING_DISABLED value + * @property {number} LOG_ERRORS_AND_ABOVE=2 LOG_ERRORS_AND_ABOVE value + * @property {number} LOG_WARNINGS_AND_ABOVE=3 LOG_WARNINGS_AND_ABOVE value + * @property {number} LOG_ALL=4 LOG_ALL value */ - AddLocalInventoriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesMetadata"; - }; + LoggingConfig.LoggingLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGING_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOGGING_DISABLED"] = 1; + values[valuesById[2] = "LOG_ERRORS_AND_ABOVE"] = 2; + values[valuesById[3] = "LOG_WARNINGS_AND_ABOVE"] = 3; + values[valuesById[4] = "LOG_ALL"] = 4; + return values; + })(); - return AddLocalInventoriesMetadata; + return LoggingConfig; })(); - v2alpha.AddLocalInventoriesResponse = (function() { + v2alpha.Project = (function() { /** - * Properties of an AddLocalInventoriesResponse. + * Properties of a Project. * @memberof google.cloud.retail.v2alpha - * @interface IAddLocalInventoriesResponse + * @interface IProject + * @property {string|null} [name] Project name + * @property {Array.|null} [enrolledSolutions] Project enrolledSolutions */ /** - * Constructs a new AddLocalInventoriesResponse. + * Constructs a new Project. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents an AddLocalInventoriesResponse. - * @implements IAddLocalInventoriesResponse + * @classdesc Represents a Project. + * @implements IProject * @constructor - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IProject=} [properties] Properties to set */ - function AddLocalInventoriesResponse(properties) { + function Project(properties) { + this.enrolledSolutions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90695,63 +102499,102 @@ } /** - * Creates a new AddLocalInventoriesResponse instance using the specified properties. + * Project name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.Project + * @instance + */ + Project.prototype.name = ""; + + /** + * Project enrolledSolutions. + * @member {Array.} enrolledSolutions + * @memberof google.cloud.retail.v2alpha.Project + * @instance + */ + Project.prototype.enrolledSolutions = $util.emptyArray; + + /** + * Creates a new Project instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse instance + * @param {google.cloud.retail.v2alpha.IProject=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.Project} Project instance */ - AddLocalInventoriesResponse.create = function create(properties) { - return new AddLocalInventoriesResponse(properties); + Project.create = function create(properties) { + return new Project(properties); }; /** - * Encodes the specified AddLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified Project message. Does not implicitly {@link google.cloud.retail.v2alpha.Project.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProject} message Project message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesResponse.encode = function encode(message, writer) { + Project.encode = function encode(message, writer) { 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.enrolledSolutions != null && message.enrolledSolutions.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.enrolledSolutions.length; ++i) + writer.int32(message.enrolledSolutions[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified AddLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AddLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified Project message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.Project.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static - * @param {google.cloud.retail.v2alpha.IAddLocalInventoriesResponse} message AddLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IProject} message Project message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + Project.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer. + * Decodes a Project message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.Project} Project * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesResponse.decode = function decode(reader, length) { + Project.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.Project(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.enrolledSolutions && message.enrolledSolutions.length)) + message.enrolledSolutions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.enrolledSolutions.push(reader.int32()); + } else + message.enrolledSolutions.push(reader.int32()); + break; + } default: reader.skipType(tag & 7); break; @@ -90761,113 +102604,169 @@ }; /** - * Decodes an AddLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes a Project message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.Project} Project * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + Project.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddLocalInventoriesResponse message. + * Verifies a Project message. * @function verify - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddLocalInventoriesResponse.verify = function verify(message) { + Project.verify = function verify(message) { if (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.enrolledSolutions != null && message.hasOwnProperty("enrolledSolutions")) { + if (!Array.isArray(message.enrolledSolutions)) + return "enrolledSolutions: array expected"; + for (var i = 0; i < message.enrolledSolutions.length; ++i) + switch (message.enrolledSolutions[i]) { + default: + return "enrolledSolutions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } return null; }; /** - * Creates an AddLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Project message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} AddLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.Project} Project */ - AddLocalInventoriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse) + Project.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.Project) return object; - return new $root.google.cloud.retail.v2alpha.AddLocalInventoriesResponse(); + var message = new $root.google.cloud.retail.v2alpha.Project(); + if (object.name != null) + message.name = String(object.name); + if (object.enrolledSolutions) { + if (!Array.isArray(object.enrolledSolutions)) + throw TypeError(".google.cloud.retail.v2alpha.Project.enrolledSolutions: array expected"); + message.enrolledSolutions = []; + for (var i = 0; i < object.enrolledSolutions.length; ++i) + switch (object.enrolledSolutions[i]) { + default: + if (typeof object.enrolledSolutions[i] === "number") { + message.enrolledSolutions[i] = object.enrolledSolutions[i]; + break; + } + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.enrolledSolutions[i] = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.enrolledSolutions[i] = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.enrolledSolutions[i] = 2; + break; + } + } + return message; }; /** - * Creates a plain object from an AddLocalInventoriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a Project message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static - * @param {google.cloud.retail.v2alpha.AddLocalInventoriesResponse} message AddLocalInventoriesResponse + * @param {google.cloud.retail.v2alpha.Project} message Project * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddLocalInventoriesResponse.toObject = function toObject() { - return {}; + Project.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.enrolledSolutions = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enrolledSolutions && message.enrolledSolutions.length) { + object.enrolledSolutions = []; + for (var j = 0; j < message.enrolledSolutions.length; ++j) + object.enrolledSolutions[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolutions[j]] === undefined ? message.enrolledSolutions[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolutions[j]] : message.enrolledSolutions[j]; + } + return object; }; /** - * Converts this AddLocalInventoriesResponse to JSON. + * Converts this Project to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @instance * @returns {Object.} JSON object */ - AddLocalInventoriesResponse.prototype.toJSON = function toJSON() { + Project.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddLocalInventoriesResponse + * Gets the default type url for Project * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.AddLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.Project * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddLocalInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Project.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.AddLocalInventoriesResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.Project"; }; - return AddLocalInventoriesResponse; + return Project; })(); - v2alpha.RemoveLocalInventoriesRequest = (function() { + v2alpha.AlertConfig = (function() { /** - * Properties of a RemoveLocalInventoriesRequest. + * Properties of an AlertConfig. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesRequest - * @property {string|null} [product] RemoveLocalInventoriesRequest product - * @property {Array.|null} [placeIds] RemoveLocalInventoriesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveLocalInventoriesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveLocalInventoriesRequest allowMissing + * @interface IAlertConfig + * @property {string|null} [name] AlertConfig name + * @property {Array.|null} [alertPolicies] AlertConfig alertPolicies */ /** - * Constructs a new RemoveLocalInventoriesRequest. + * Constructs a new AlertConfig. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesRequest. - * @implements IRemoveLocalInventoriesRequest + * @classdesc Represents an AlertConfig. + * @implements IAlertConfig * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAlertConfig=} [properties] Properties to set */ - function RemoveLocalInventoriesRequest(properties) { - this.placeIds = []; + function AlertConfig(properties) { + this.alertPolicies = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90875,120 +102774,92 @@ } /** - * RemoveLocalInventoriesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest - * @instance - */ - RemoveLocalInventoriesRequest.prototype.product = ""; - - /** - * RemoveLocalInventoriesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest - * @instance - */ - RemoveLocalInventoriesRequest.prototype.placeIds = $util.emptyArray; - - /** - * RemoveLocalInventoriesRequest removeTime. - * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * AlertConfig name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.AlertConfig * @instance */ - RemoveLocalInventoriesRequest.prototype.removeTime = null; + AlertConfig.prototype.name = ""; /** - * RemoveLocalInventoriesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * AlertConfig alertPolicies. + * @member {Array.} alertPolicies + * @memberof google.cloud.retail.v2alpha.AlertConfig * @instance */ - RemoveLocalInventoriesRequest.prototype.allowMissing = false; + AlertConfig.prototype.alertPolicies = $util.emptyArray; /** - * Creates a new RemoveLocalInventoriesRequest instance using the specified properties. + * Creates a new AlertConfig instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest instance + * @param {google.cloud.retail.v2alpha.IAlertConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AlertConfig} AlertConfig instance */ - RemoveLocalInventoriesRequest.create = function create(properties) { - return new RemoveLocalInventoriesRequest(properties); + AlertConfig.create = function create(properties) { + return new AlertConfig(properties); }; /** - * Encodes the specified RemoveLocalInventoriesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified AlertConfig message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAlertConfig} message AlertConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesRequest.encode = function encode(message, writer) { + AlertConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.placeIds[i]); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.alertPolicies != null && message.alertPolicies.length) + for (var i = 0; i < message.alertPolicies.length; ++i) + $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.encode(message.alertPolicies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RemoveLocalInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.verify|verify} messages. + * Encodes the specified AlertConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAlertConfig} message AlertConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AlertConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer. + * Decodes an AlertConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.AlertConfig} AlertConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesRequest.decode = function decode(reader, length) { + AlertConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AlertConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.product = reader.string(); + message.name = reader.string(); break; } case 2: { - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - } - case 5: { - message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allowMissing = reader.bool(); + if (!(message.alertPolicies && message.alertPolicies.length)) + message.alertPolicies = []; + message.alertPolicies.push($root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.decode(reader, reader.uint32())); break; } default: @@ -91000,164 +102871,962 @@ }; /** - * Decodes a RemoveLocalInventoriesRequest message from the specified reader or buffer, length delimited. + * Decodes an AlertConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.AlertConfig} AlertConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + AlertConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesRequest message. + * Verifies an AlertConfig message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesRequest.verify = function verify(message) { + AlertConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.removeTime); - if (error) - return "removeTime." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.alertPolicies != null && message.hasOwnProperty("alertPolicies")) { + if (!Array.isArray(message.alertPolicies)) + return "alertPolicies: array expected"; + for (var i = 0; i < message.alertPolicies.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.verify(message.alertPolicies[i]); + if (error) + return "alertPolicies." + error; + } } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; return null; }; /** - * Creates a RemoveLocalInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AlertConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} RemoveLocalInventoriesRequest + * @returns {google.cloud.retail.v2alpha.AlertConfig} AlertConfig */ - RemoveLocalInventoriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest) + AlertConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AlertConfig) return object; - var message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } - if (object.removeTime != null) { - if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest.removeTime: object expected"); - message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + var message = new $root.google.cloud.retail.v2alpha.AlertConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.alertPolicies) { + if (!Array.isArray(object.alertPolicies)) + throw TypeError(".google.cloud.retail.v2alpha.AlertConfig.alertPolicies: array expected"); + message.alertPolicies = []; + for (var i = 0; i < object.alertPolicies.length; ++i) { + if (typeof object.alertPolicies[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AlertConfig.alertPolicies: object expected"); + message.alertPolicies[i] = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.fromObject(object.alertPolicies[i]); + } } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a RemoveLocalInventoriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AlertConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest} message RemoveLocalInventoriesRequest + * @param {google.cloud.retail.v2alpha.AlertConfig} message AlertConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesRequest.toObject = function toObject(message, options) { + AlertConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.placeIds = []; - if (options.defaults) { - object.product = ""; - object.allowMissing = false; - object.removeTime = null; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + object.alertPolicies = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.alertPolicies && message.alertPolicies.length) { + object.alertPolicies = []; + for (var j = 0; j < message.alertPolicies.length; ++j) + object.alertPolicies[j] = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.toObject(message.alertPolicies[j], options); } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); return object; }; /** - * Converts this RemoveLocalInventoriesRequest to JSON. + * Converts this AlertConfig to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesRequest.prototype.toJSON = function toJSON() { + AlertConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveLocalInventoriesRequest + * Gets the default type url for AlertConfig * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest + * @memberof google.cloud.retail.v2alpha.AlertConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveLocalInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AlertConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AlertConfig"; }; - return RemoveLocalInventoriesRequest; + AlertConfig.AlertPolicy = (function() { + + /** + * Properties of an AlertPolicy. + * @memberof google.cloud.retail.v2alpha.AlertConfig + * @interface IAlertPolicy + * @property {string|null} [alertGroup] AlertPolicy alertGroup + * @property {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus|null} [enrollStatus] AlertPolicy enrollStatus + * @property {Array.|null} [recipients] AlertPolicy recipients + */ + + /** + * Constructs a new AlertPolicy. + * @memberof google.cloud.retail.v2alpha.AlertConfig + * @classdesc Represents an AlertPolicy. + * @implements IAlertPolicy + * @constructor + * @param {google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy=} [properties] Properties to set + */ + function AlertPolicy(properties) { + this.recipients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlertPolicy alertGroup. + * @member {string} alertGroup + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @instance + */ + AlertPolicy.prototype.alertGroup = ""; + + /** + * AlertPolicy enrollStatus. + * @member {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus} enrollStatus + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @instance + */ + AlertPolicy.prototype.enrollStatus = 0; + + /** + * AlertPolicy recipients. + * @member {Array.} recipients + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @instance + */ + AlertPolicy.prototype.recipients = $util.emptyArray; + + /** + * Creates a new AlertPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy} AlertPolicy instance + */ + AlertPolicy.create = function create(properties) { + return new AlertPolicy(properties); + }; + + /** + * Encodes the specified AlertPolicy message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy} message AlertPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlertPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alertGroup != null && Object.hasOwnProperty.call(message, "alertGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.alertGroup); + if (message.enrollStatus != null && Object.hasOwnProperty.call(message, "enrollStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enrollStatus); + if (message.recipients != null && message.recipients.length) + for (var i = 0; i < message.recipients.length; ++i) + $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.encode(message.recipients[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.IAlertPolicy} message AlertPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlertPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlertPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy} AlertPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlertPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.alertGroup = reader.string(); + break; + } + case 2: { + message.enrollStatus = reader.int32(); + break; + } + case 3: { + if (!(message.recipients && message.recipients.length)) + message.recipients = []; + message.recipients.push($root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy} AlertPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlertPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlertPolicy message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlertPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alertGroup != null && message.hasOwnProperty("alertGroup")) + if (!$util.isString(message.alertGroup)) + return "alertGroup: string expected"; + if (message.enrollStatus != null && message.hasOwnProperty("enrollStatus")) + switch (message.enrollStatus) { + default: + return "enrollStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.recipients != null && message.hasOwnProperty("recipients")) { + if (!Array.isArray(message.recipients)) + return "recipients: array expected"; + for (var i = 0; i < message.recipients.length; ++i) { + var error = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.verify(message.recipients[i]); + if (error) + return "recipients." + error; + } + } + return null; + }; + + /** + * Creates an AlertPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy} AlertPolicy + */ + AlertPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy) + return object; + var message = new $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy(); + if (object.alertGroup != null) + message.alertGroup = String(object.alertGroup); + switch (object.enrollStatus) { + default: + if (typeof object.enrollStatus === "number") { + message.enrollStatus = object.enrollStatus; + break; + } + break; + case "ENROLL_STATUS_UNSPECIFIED": + case 0: + message.enrollStatus = 0; + break; + case "ENROLLED": + case 1: + message.enrollStatus = 1; + break; + case "DECLINED": + case 2: + message.enrollStatus = 2; + break; + } + if (object.recipients) { + if (!Array.isArray(object.recipients)) + throw TypeError(".google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.recipients: array expected"); + message.recipients = []; + for (var i = 0; i < object.recipients.length; ++i) { + if (typeof object.recipients[i] !== "object") + throw TypeError(".google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.recipients: object expected"); + message.recipients[i] = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.fromObject(object.recipients[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy} message AlertPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlertPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.recipients = []; + if (options.defaults) { + object.alertGroup = ""; + object.enrollStatus = options.enums === String ? "ENROLL_STATUS_UNSPECIFIED" : 0; + } + if (message.alertGroup != null && message.hasOwnProperty("alertGroup")) + object.alertGroup = message.alertGroup; + if (message.enrollStatus != null && message.hasOwnProperty("enrollStatus")) + object.enrollStatus = options.enums === String ? $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus[message.enrollStatus] === undefined ? message.enrollStatus : $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus[message.enrollStatus] : message.enrollStatus; + if (message.recipients && message.recipients.length) { + object.recipients = []; + for (var j = 0; j < message.recipients.length; ++j) + object.recipients[j] = $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.toObject(message.recipients[j], options); + } + return object; + }; + + /** + * Converts this AlertPolicy to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @instance + * @returns {Object.} JSON object + */ + AlertPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlertPolicy + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlertPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AlertConfig.AlertPolicy"; + }; + + AlertPolicy.Recipient = (function() { + + /** + * Properties of a Recipient. + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @interface IRecipient + * @property {string|null} [emailAddress] Recipient emailAddress + */ + + /** + * Constructs a new Recipient. + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy + * @classdesc Represents a Recipient. + * @implements IRecipient + * @constructor + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient=} [properties] Properties to set + */ + function Recipient(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Recipient emailAddress. + * @member {string} emailAddress + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @instance + */ + Recipient.prototype.emailAddress = ""; + + /** + * Creates a new Recipient instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient} Recipient instance + */ + Recipient.create = function create(properties) { + return new Recipient(properties); + }; + + /** + * Encodes the specified Recipient message. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient} message Recipient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recipient.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.emailAddress); + return writer; + }; + + /** + * Encodes the specified Recipient message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.IRecipient} message Recipient message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recipient.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Recipient message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient} Recipient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recipient.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.emailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Recipient message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient} Recipient + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recipient.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Recipient message. + * @function verify + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Recipient.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + return null; + }; + + /** + * Creates a Recipient message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient} Recipient + */ + Recipient.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient) + return object; + var message = new $root.google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient(); + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + return message; + }; + + /** + * Creates a plain object from a Recipient message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient} message Recipient + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Recipient.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.emailAddress = ""; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) + object.emailAddress = message.emailAddress; + return object; + }; + + /** + * Converts this Recipient to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @instance + * @returns {Object.} JSON object + */ + Recipient.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Recipient + * @function getTypeUrl + * @memberof google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Recipient.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.Recipient"; + }; + + return Recipient; + })(); + + /** + * EnrollStatus enum. + * @name google.cloud.retail.v2alpha.AlertConfig.AlertPolicy.EnrollStatus + * @enum {number} + * @property {number} ENROLL_STATUS_UNSPECIFIED=0 ENROLL_STATUS_UNSPECIFIED value + * @property {number} ENROLLED=1 ENROLLED value + * @property {number} DECLINED=2 DECLINED value + */ + AlertPolicy.EnrollStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENROLL_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENROLLED"] = 1; + values[valuesById[2] = "DECLINED"] = 2; + return values; + })(); + + return AlertPolicy; + })(); + + return AlertConfig; })(); - v2alpha.RemoveLocalInventoriesMetadata = (function() { + v2alpha.ProjectService = (function() { /** - * Properties of a RemoveLocalInventoriesMetadata. + * Constructs a new ProjectService service. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesMetadata + * @classdesc Represents a ProjectService + * @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 ProjectService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProjectService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProjectService; /** - * Constructs a new RemoveLocalInventoriesMetadata. + * Creates new ProjectService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.retail.v2alpha.ProjectService + * @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 {ProjectService} RPC service. Useful where requests and/or responses are streamed. + */ + ProjectService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getProject}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef GetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Project} [response] Project + */ + + /** + * Calls GetProject. + * @function getProject + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetProjectRequest} request GetProjectRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.GetProjectCallback} callback Node-style callback called with the error, if any, and Project + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.getProject = function getProject(request, callback) { + return this.rpcCall(getProject, $root.google.cloud.retail.v2alpha.GetProjectRequest, $root.google.cloud.retail.v2alpha.Project, request, callback); + }, "name", { value: "GetProject" }); + + /** + * Calls GetProject. + * @function getProject + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetProjectRequest} request GetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|acceptTerms}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef AcceptTermsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.Project} [response] Project + */ + + /** + * Calls AcceptTerms. + * @function acceptTerms + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest} request AcceptTermsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.AcceptTermsCallback} callback Node-style callback called with the error, if any, and Project + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.acceptTerms = function acceptTerms(request, callback) { + return this.rpcCall(acceptTerms, $root.google.cloud.retail.v2alpha.AcceptTermsRequest, $root.google.cloud.retail.v2alpha.Project, request, callback); + }, "name", { value: "AcceptTerms" }); + + /** + * Calls AcceptTerms. + * @function acceptTerms + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest} request AcceptTermsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|enrollSolution}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef EnrollSolutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EnrollSolution. + * @function enrollSolution + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest} request EnrollSolutionRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.EnrollSolutionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.enrollSolution = function enrollSolution(request, callback) { + return this.rpcCall(enrollSolution, $root.google.cloud.retail.v2alpha.EnrollSolutionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EnrollSolution" }); + + /** + * Calls EnrollSolution. + * @function enrollSolution + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest} request EnrollSolutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|listEnrolledSolutions}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef ListEnrolledSolutionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} [response] ListEnrolledSolutionsResponse + */ + + /** + * Calls ListEnrolledSolutions. + * @function listEnrolledSolutions + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest} request ListEnrolledSolutionsRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.ListEnrolledSolutionsCallback} callback Node-style callback called with the error, if any, and ListEnrolledSolutionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.listEnrolledSolutions = function listEnrolledSolutions(request, callback) { + return this.rpcCall(listEnrolledSolutions, $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest, $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse, request, callback); + }, "name", { value: "ListEnrolledSolutions" }); + + /** + * Calls ListEnrolledSolutions. + * @function listEnrolledSolutions + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest} request ListEnrolledSolutionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getLoggingConfig}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef GetLoggingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.LoggingConfig} [response] LoggingConfig + */ + + /** + * Calls GetLoggingConfig. + * @function getLoggingConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest} request GetLoggingConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.GetLoggingConfigCallback} callback Node-style callback called with the error, if any, and LoggingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.getLoggingConfig = function getLoggingConfig(request, callback) { + return this.rpcCall(getLoggingConfig, $root.google.cloud.retail.v2alpha.GetLoggingConfigRequest, $root.google.cloud.retail.v2alpha.LoggingConfig, request, callback); + }, "name", { value: "GetLoggingConfig" }); + + /** + * Calls GetLoggingConfig. + * @function getLoggingConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest} request GetLoggingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|updateLoggingConfig}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef UpdateLoggingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.LoggingConfig} [response] LoggingConfig + */ + + /** + * Calls UpdateLoggingConfig. + * @function updateLoggingConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest} request UpdateLoggingConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfigCallback} callback Node-style callback called with the error, if any, and LoggingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.updateLoggingConfig = function updateLoggingConfig(request, callback) { + return this.rpcCall(updateLoggingConfig, $root.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest, $root.google.cloud.retail.v2alpha.LoggingConfig, request, callback); + }, "name", { value: "UpdateLoggingConfig" }); + + /** + * Calls UpdateLoggingConfig. + * @function updateLoggingConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest} request UpdateLoggingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|getAlertConfig}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef GetAlertConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AlertConfig} [response] AlertConfig + */ + + /** + * Calls GetAlertConfig. + * @function getAlertConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest} request GetAlertConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.GetAlertConfigCallback} callback Node-style callback called with the error, if any, and AlertConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.getAlertConfig = function getAlertConfig(request, callback) { + return this.rpcCall(getAlertConfig, $root.google.cloud.retail.v2alpha.GetAlertConfigRequest, $root.google.cloud.retail.v2alpha.AlertConfig, request, callback); + }, "name", { value: "GetAlertConfig" }); + + /** + * Calls GetAlertConfig. + * @function getAlertConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest} request GetAlertConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.retail.v2alpha.ProjectService|updateAlertConfig}. + * @memberof google.cloud.retail.v2alpha.ProjectService + * @typedef UpdateAlertConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.retail.v2alpha.AlertConfig} [response] AlertConfig + */ + + /** + * Calls UpdateAlertConfig. + * @function updateAlertConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest} request UpdateAlertConfigRequest message or plain object + * @param {google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfigCallback} callback Node-style callback called with the error, if any, and AlertConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProjectService.prototype.updateAlertConfig = function updateAlertConfig(request, callback) { + return this.rpcCall(updateAlertConfig, $root.google.cloud.retail.v2alpha.UpdateAlertConfigRequest, $root.google.cloud.retail.v2alpha.AlertConfig, request, callback); + }, "name", { value: "UpdateAlertConfig" }); + + /** + * Calls UpdateAlertConfig. + * @function updateAlertConfig + * @memberof google.cloud.retail.v2alpha.ProjectService + * @instance + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest} request UpdateAlertConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProjectService; + })(); + + v2alpha.GetProjectRequest = (function() { + + /** + * Properties of a GetProjectRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesMetadata. - * @implements IRemoveLocalInventoriesMetadata + * @interface IGetProjectRequest + * @property {string|null} [name] GetProjectRequest name + */ + + /** + * Constructs a new GetProjectRequest. + * @memberof google.cloud.retail.v2alpha + * @classdesc Represents a GetProjectRequest. + * @implements IGetProjectRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetProjectRequest=} [properties] Properties to set */ - function RemoveLocalInventoriesMetadata(properties) { + function GetProjectRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91165,63 +103834,77 @@ } /** - * Creates a new RemoveLocalInventoriesMetadata instance using the specified properties. + * GetProjectRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetProjectRequest + * @instance + */ + GetProjectRequest.prototype.name = ""; + + /** + * Creates a new GetProjectRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata instance + * @param {google.cloud.retail.v2alpha.IGetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetProjectRequest} GetProjectRequest instance */ - RemoveLocalInventoriesMetadata.create = function create(properties) { - return new RemoveLocalInventoriesMetadata(properties); + GetProjectRequest.create = function create(properties) { + return new GetProjectRequest(properties); }; /** - * Encodes the specified RemoveLocalInventoriesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetProjectRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProjectRequest} message GetProjectRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesMetadata.encode = function encode(message, writer) { + GetProjectRequest.encode = function encode(message, writer) { 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 RemoveLocalInventoriesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata.verify|verify} messages. + * Encodes the specified GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetProjectRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetProjectRequest} message GetProjectRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + GetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer. + * Decodes a GetProjectRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.GetProjectRequest} GetProjectRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesMetadata.decode = function decode(reader, length) { + GetProjectRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetProjectRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -91231,108 +103914,122 @@ }; /** - * Decodes a RemoveLocalInventoriesMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetProjectRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.GetProjectRequest} GetProjectRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesMetadata.decodeDelimited = function decodeDelimited(reader) { + GetProjectRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesMetadata message. + * Verifies a GetProjectRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesMetadata.verify = function verify(message) { + GetProjectRequest.verify = function verify(message) { if (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 RemoveLocalInventoriesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetProjectRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} RemoveLocalInventoriesMetadata + * @returns {google.cloud.retail.v2alpha.GetProjectRequest} GetProjectRequest */ - RemoveLocalInventoriesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata) + GetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetProjectRequest) return object; - return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.GetProjectRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from a RemoveLocalInventoriesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a GetProjectRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata} message RemoveLocalInventoriesMetadata + * @param {google.cloud.retail.v2alpha.GetProjectRequest} message GetProjectRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesMetadata.toObject = function toObject() { - return {}; + GetProjectRequest.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 RemoveLocalInventoriesMetadata to JSON. + * Converts this GetProjectRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesMetadata.prototype.toJSON = function toJSON() { + GetProjectRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveLocalInventoriesMetadata + * Gets the default type url for GetProjectRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata + * @memberof google.cloud.retail.v2alpha.GetProjectRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveLocalInventoriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetProjectRequest"; }; - return RemoveLocalInventoriesMetadata; + return GetProjectRequest; })(); - v2alpha.RemoveLocalInventoriesResponse = (function() { + v2alpha.AcceptTermsRequest = (function() { /** - * Properties of a RemoveLocalInventoriesResponse. + * Properties of an AcceptTermsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveLocalInventoriesResponse + * @interface IAcceptTermsRequest + * @property {string|null} [project] AcceptTermsRequest project */ /** - * Constructs a new RemoveLocalInventoriesResponse. + * Constructs a new AcceptTermsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveLocalInventoriesResponse. - * @implements IRemoveLocalInventoriesResponse + * @classdesc Represents an AcceptTermsRequest. + * @implements IAcceptTermsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest=} [properties] Properties to set */ - function RemoveLocalInventoriesResponse(properties) { + function AcceptTermsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91340,63 +104037,77 @@ } /** - * Creates a new RemoveLocalInventoriesResponse instance using the specified properties. + * AcceptTermsRequest project. + * @member {string} project + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest + * @instance + */ + AcceptTermsRequest.prototype.project = ""; + + /** + * Creates a new AcceptTermsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse instance + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.AcceptTermsRequest} AcceptTermsRequest instance */ - RemoveLocalInventoriesResponse.create = function create(properties) { - return new RemoveLocalInventoriesResponse(properties); + AcceptTermsRequest.create = function create(properties) { + return new AcceptTermsRequest(properties); }; /** - * Encodes the specified RemoveLocalInventoriesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified AcceptTermsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.AcceptTermsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest} message AcceptTermsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesResponse.encode = function encode(message, writer) { + AcceptTermsRequest.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); return writer; }; /** - * Encodes the specified RemoveLocalInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse.verify|verify} messages. + * Encodes the specified AcceptTermsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.AcceptTermsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IAcceptTermsRequest} message AcceptTermsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveLocalInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + AcceptTermsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer. + * Decodes an AcceptTermsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.AcceptTermsRequest} AcceptTermsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesResponse.decode = function decode(reader, length) { + AcceptTermsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.AcceptTermsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -91406,114 +104117,123 @@ }; /** - * Decodes a RemoveLocalInventoriesResponse message from the specified reader or buffer, length delimited. + * Decodes an AcceptTermsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.AcceptTermsRequest} AcceptTermsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveLocalInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + AcceptTermsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveLocalInventoriesResponse message. + * Verifies an AcceptTermsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveLocalInventoriesResponse.verify = function verify(message) { + AcceptTermsRequest.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"; return null; }; /** - * Creates a RemoveLocalInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AcceptTermsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} RemoveLocalInventoriesResponse + * @returns {google.cloud.retail.v2alpha.AcceptTermsRequest} AcceptTermsRequest */ - RemoveLocalInventoriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse) + AcceptTermsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.AcceptTermsRequest) return object; - return new $root.google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse(); + var message = new $root.google.cloud.retail.v2alpha.AcceptTermsRequest(); + if (object.project != null) + message.project = String(object.project); + return message; }; /** - * Creates a plain object from a RemoveLocalInventoriesResponse message. Also converts values to other types if specified. + * Creates a plain object from an AcceptTermsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse} message RemoveLocalInventoriesResponse + * @param {google.cloud.retail.v2alpha.AcceptTermsRequest} message AcceptTermsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveLocalInventoriesResponse.toObject = function toObject() { - return {}; + AcceptTermsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; }; /** - * Converts this RemoveLocalInventoriesResponse to JSON. + * Converts this AcceptTermsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @instance * @returns {Object.} JSON object */ - RemoveLocalInventoriesResponse.prototype.toJSON = function toJSON() { + AcceptTermsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveLocalInventoriesResponse + * Gets the default type url for AcceptTermsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse + * @memberof google.cloud.retail.v2alpha.AcceptTermsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveLocalInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AcceptTermsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveLocalInventoriesResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.AcceptTermsRequest"; }; - return RemoveLocalInventoriesResponse; + return AcceptTermsRequest; })(); - v2alpha.RemoveFulfillmentPlacesRequest = (function() { + v2alpha.EnrollSolutionRequest = (function() { /** - * Properties of a RemoveFulfillmentPlacesRequest. + * Properties of an EnrollSolutionRequest. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesRequest - * @property {string|null} [product] RemoveFulfillmentPlacesRequest product - * @property {string|null} [type] RemoveFulfillmentPlacesRequest type - * @property {Array.|null} [placeIds] RemoveFulfillmentPlacesRequest placeIds - * @property {google.protobuf.ITimestamp|null} [removeTime] RemoveFulfillmentPlacesRequest removeTime - * @property {boolean|null} [allowMissing] RemoveFulfillmentPlacesRequest allowMissing + * @interface IEnrollSolutionRequest + * @property {string|null} [project] EnrollSolutionRequest project + * @property {google.cloud.retail.v2alpha.SolutionType|null} [solution] EnrollSolutionRequest solution */ /** - * Constructs a new RemoveFulfillmentPlacesRequest. + * Constructs a new EnrollSolutionRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesRequest. - * @implements IRemoveFulfillmentPlacesRequest + * @classdesc Represents an EnrollSolutionRequest. + * @implements IEnrollSolutionRequest * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest=} [properties] Properties to set */ - function RemoveFulfillmentPlacesRequest(properties) { - this.placeIds = []; + function EnrollSolutionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91521,134 +104241,89 @@ } /** - * RemoveFulfillmentPlacesRequest product. - * @member {string} product - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.product = ""; - - /** - * RemoveFulfillmentPlacesRequest type. - * @member {string} type - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.type = ""; - - /** - * RemoveFulfillmentPlacesRequest placeIds. - * @member {Array.} placeIds - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest - * @instance - */ - RemoveFulfillmentPlacesRequest.prototype.placeIds = $util.emptyArray; - - /** - * RemoveFulfillmentPlacesRequest removeTime. - * @member {google.protobuf.ITimestamp|null|undefined} removeTime - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * EnrollSolutionRequest project. + * @member {string} project + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.removeTime = null; + EnrollSolutionRequest.prototype.project = ""; /** - * RemoveFulfillmentPlacesRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * EnrollSolutionRequest solution. + * @member {google.cloud.retail.v2alpha.SolutionType} solution + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @instance */ - RemoveFulfillmentPlacesRequest.prototype.allowMissing = false; + EnrollSolutionRequest.prototype.solution = 0; /** - * Creates a new RemoveFulfillmentPlacesRequest instance using the specified properties. + * Creates a new EnrollSolutionRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest instance + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.EnrollSolutionRequest} EnrollSolutionRequest instance */ - RemoveFulfillmentPlacesRequest.create = function create(properties) { - return new RemoveFulfillmentPlacesRequest(properties); + EnrollSolutionRequest.create = function create(properties) { + return new EnrollSolutionRequest(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified EnrollSolutionRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest} message EnrollSolutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encode = function encode(message, writer) { + EnrollSolutionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.placeIds != null && message.placeIds.length) - for (var i = 0; i < message.placeIds.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.placeIds[i]); - if (message.removeTime != null && Object.hasOwnProperty.call(message, "removeTime")) - $root.google.protobuf.Timestamp.encode(message.removeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allowMissing); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.solution != null && Object.hasOwnProperty.call(message, "solution")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.solution); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.verify|verify} messages. + * Encodes the specified EnrollSolutionRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionRequest} message EnrollSolutionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + EnrollSolutionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer. + * Decodes an EnrollSolutionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.EnrollSolutionRequest} EnrollSolutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decode = function decode(reader, length) { + EnrollSolutionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.EnrollSolutionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.product = reader.string(); + message.project = reader.string(); break; } case 2: { - message.type = reader.string(); - break; - } - case 3: { - if (!(message.placeIds && message.placeIds.length)) - message.placeIds = []; - message.placeIds.push(reader.string()); - break; - } - case 4: { - message.removeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.allowMissing = reader.bool(); + message.solution = reader.int32(); break; } default: @@ -91660,172 +104335,155 @@ }; /** - * Decodes a RemoveFulfillmentPlacesRequest message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.EnrollSolutionRequest} EnrollSolutionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesRequest.decodeDelimited = function decodeDelimited(reader) { + EnrollSolutionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesRequest message. + * Verifies an EnrollSolutionRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesRequest.verify = function verify(message) { + EnrollSolutionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) - if (!$util.isString(message.product)) - return "product: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.placeIds != null && message.hasOwnProperty("placeIds")) { - if (!Array.isArray(message.placeIds)) - return "placeIds: array expected"; - for (var i = 0; i < message.placeIds.length; ++i) - if (!$util.isString(message.placeIds[i])) - return "placeIds: string[] expected"; - } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.removeTime); - if (error) - return "removeTime." + error; - } - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.solution != null && message.hasOwnProperty("solution")) + switch (message.solution) { + default: + return "solution: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a RemoveFulfillmentPlacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} RemoveFulfillmentPlacesRequest + * @returns {google.cloud.retail.v2alpha.EnrollSolutionRequest} EnrollSolutionRequest */ - RemoveFulfillmentPlacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest) + EnrollSolutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.EnrollSolutionRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest(); - if (object.product != null) - message.product = String(object.product); - if (object.type != null) - message.type = String(object.type); - if (object.placeIds) { - if (!Array.isArray(object.placeIds)) - throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.placeIds: array expected"); - message.placeIds = []; - for (var i = 0; i < object.placeIds.length; ++i) - message.placeIds[i] = String(object.placeIds[i]); - } - if (object.removeTime != null) { - if (typeof object.removeTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest.removeTime: object expected"); - message.removeTime = $root.google.protobuf.Timestamp.fromObject(object.removeTime); + var message = new $root.google.cloud.retail.v2alpha.EnrollSolutionRequest(); + if (object.project != null) + message.project = String(object.project); + switch (object.solution) { + default: + if (typeof object.solution === "number") { + message.solution = object.solution; + break; + } + break; + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.solution = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.solution = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.solution = 2; + break; } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); return message; }; /** - * Creates a plain object from a RemoveFulfillmentPlacesRequest message. Also converts values to other types if specified. + * Creates a plain object from an EnrollSolutionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest} message RemoveFulfillmentPlacesRequest + * @param {google.cloud.retail.v2alpha.EnrollSolutionRequest} message EnrollSolutionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesRequest.toObject = function toObject(message, options) { + EnrollSolutionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.placeIds = []; if (options.defaults) { - object.product = ""; - object.type = ""; - object.removeTime = null; - object.allowMissing = false; - } - if (message.product != null && message.hasOwnProperty("product")) - object.product = message.product; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.placeIds && message.placeIds.length) { - object.placeIds = []; - for (var j = 0; j < message.placeIds.length; ++j) - object.placeIds[j] = message.placeIds[j]; + object.project = ""; + object.solution = options.enums === String ? "SOLUTION_TYPE_UNSPECIFIED" : 0; } - if (message.removeTime != null && message.hasOwnProperty("removeTime")) - object.removeTime = $root.google.protobuf.Timestamp.toObject(message.removeTime, options); - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.solution != null && message.hasOwnProperty("solution")) + object.solution = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solution] === undefined ? message.solution : $root.google.cloud.retail.v2alpha.SolutionType[message.solution] : message.solution; return object; }; /** - * Converts this RemoveFulfillmentPlacesRequest to JSON. + * Converts this EnrollSolutionRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesRequest.prototype.toJSON = function toJSON() { + EnrollSolutionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveFulfillmentPlacesRequest + * Gets the default type url for EnrollSolutionRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest + * @memberof google.cloud.retail.v2alpha.EnrollSolutionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveFulfillmentPlacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnrollSolutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.EnrollSolutionRequest"; }; - return RemoveFulfillmentPlacesRequest; + return EnrollSolutionRequest; })(); - v2alpha.RemoveFulfillmentPlacesMetadata = (function() { + v2alpha.EnrollSolutionResponse = (function() { /** - * Properties of a RemoveFulfillmentPlacesMetadata. + * Properties of an EnrollSolutionResponse. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesMetadata + * @interface IEnrollSolutionResponse + * @property {google.cloud.retail.v2alpha.SolutionType|null} [enrolledSolution] EnrollSolutionResponse enrolledSolution */ /** - * Constructs a new RemoveFulfillmentPlacesMetadata. + * Constructs a new EnrollSolutionResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesMetadata. - * @implements IRemoveFulfillmentPlacesMetadata + * @classdesc Represents an EnrollSolutionResponse. + * @implements IEnrollSolutionResponse * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IEnrollSolutionResponse=} [properties] Properties to set */ - function RemoveFulfillmentPlacesMetadata(properties) { + function EnrollSolutionResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91833,63 +104491,77 @@ } /** - * Creates a new RemoveFulfillmentPlacesMetadata instance using the specified properties. + * EnrollSolutionResponse enrolledSolution. + * @member {google.cloud.retail.v2alpha.SolutionType} enrolledSolution + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse + * @instance + */ + EnrollSolutionResponse.prototype.enrolledSolution = 0; + + /** + * Creates a new EnrollSolutionResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata instance + * @param {google.cloud.retail.v2alpha.IEnrollSolutionResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.EnrollSolutionResponse} EnrollSolutionResponse instance */ - RemoveFulfillmentPlacesMetadata.create = function create(properties) { - return new RemoveFulfillmentPlacesMetadata(properties); + EnrollSolutionResponse.create = function create(properties) { + return new EnrollSolutionResponse(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified EnrollSolutionResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionResponse} message EnrollSolutionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encode = function encode(message, writer) { + EnrollSolutionResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.enrolledSolution != null && Object.hasOwnProperty.call(message, "enrolledSolution")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.enrolledSolution); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata.verify|verify} messages. + * Encodes the specified EnrollSolutionResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionResponse} message EnrollSolutionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + EnrollSolutionResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer. + * Decodes an EnrollSolutionResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.EnrollSolutionResponse} EnrollSolutionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decode = function decode(reader, length) { + EnrollSolutionResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.EnrollSolutionResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.enrolledSolution = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -91899,108 +104571,145 @@ }; /** - * Decodes a RemoveFulfillmentPlacesMetadata message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.EnrollSolutionResponse} EnrollSolutionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesMetadata.decodeDelimited = function decodeDelimited(reader) { + EnrollSolutionResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesMetadata message. + * Verifies an EnrollSolutionResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesMetadata.verify = function verify(message) { + EnrollSolutionResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.enrolledSolution != null && message.hasOwnProperty("enrolledSolution")) + switch (message.enrolledSolution) { + default: + return "enrolledSolution: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a RemoveFulfillmentPlacesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} RemoveFulfillmentPlacesMetadata + * @returns {google.cloud.retail.v2alpha.EnrollSolutionResponse} EnrollSolutionResponse */ - RemoveFulfillmentPlacesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata) + EnrollSolutionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.EnrollSolutionResponse) return object; - return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata(); + var message = new $root.google.cloud.retail.v2alpha.EnrollSolutionResponse(); + switch (object.enrolledSolution) { + default: + if (typeof object.enrolledSolution === "number") { + message.enrolledSolution = object.enrolledSolution; + break; + } + break; + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.enrolledSolution = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.enrolledSolution = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.enrolledSolution = 2; + break; + } + return message; }; /** - * Creates a plain object from a RemoveFulfillmentPlacesMetadata message. Also converts values to other types if specified. + * Creates a plain object from an EnrollSolutionResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata} message RemoveFulfillmentPlacesMetadata + * @param {google.cloud.retail.v2alpha.EnrollSolutionResponse} message EnrollSolutionResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesMetadata.toObject = function toObject() { - return {}; + EnrollSolutionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enrolledSolution = options.enums === String ? "SOLUTION_TYPE_UNSPECIFIED" : 0; + if (message.enrolledSolution != null && message.hasOwnProperty("enrolledSolution")) + object.enrolledSolution = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolution] === undefined ? message.enrolledSolution : $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolution] : message.enrolledSolution; + return object; }; /** - * Converts this RemoveFulfillmentPlacesMetadata to JSON. + * Converts this EnrollSolutionResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesMetadata.prototype.toJSON = function toJSON() { + EnrollSolutionResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveFulfillmentPlacesMetadata + * Gets the default type url for EnrollSolutionResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata + * @memberof google.cloud.retail.v2alpha.EnrollSolutionResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveFulfillmentPlacesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnrollSolutionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.EnrollSolutionResponse"; }; - return RemoveFulfillmentPlacesMetadata; + return EnrollSolutionResponse; })(); - v2alpha.RemoveFulfillmentPlacesResponse = (function() { + v2alpha.EnrollSolutionMetadata = (function() { /** - * Properties of a RemoveFulfillmentPlacesResponse. + * Properties of an EnrollSolutionMetadata. * @memberof google.cloud.retail.v2alpha - * @interface IRemoveFulfillmentPlacesResponse + * @interface IEnrollSolutionMetadata */ /** - * Constructs a new RemoveFulfillmentPlacesResponse. + * Constructs a new EnrollSolutionMetadata. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a RemoveFulfillmentPlacesResponse. - * @implements IRemoveFulfillmentPlacesResponse + * @classdesc Represents an EnrollSolutionMetadata. + * @implements IEnrollSolutionMetadata * @constructor - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IEnrollSolutionMetadata=} [properties] Properties to set */ - function RemoveFulfillmentPlacesResponse(properties) { + function EnrollSolutionMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92008,60 +104717,60 @@ } /** - * Creates a new RemoveFulfillmentPlacesResponse instance using the specified properties. + * Creates a new EnrollSolutionMetadata instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse instance + * @param {google.cloud.retail.v2alpha.IEnrollSolutionMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.EnrollSolutionMetadata} EnrollSolutionMetadata instance */ - RemoveFulfillmentPlacesResponse.create = function create(properties) { - return new RemoveFulfillmentPlacesResponse(properties); + EnrollSolutionMetadata.create = function create(properties) { + return new EnrollSolutionMetadata(properties); }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified EnrollSolutionMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionMetadata} message EnrollSolutionMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encode = function encode(message, writer) { + EnrollSolutionMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified RemoveFulfillmentPlacesResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse.verify|verify} messages. + * Encodes the specified EnrollSolutionMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.EnrollSolutionMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static - * @param {google.cloud.retail.v2alpha.IRemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IEnrollSolutionMetadata} message EnrollSolutionMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RemoveFulfillmentPlacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + EnrollSolutionMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer. + * Decodes an EnrollSolutionMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.EnrollSolutionMetadata} EnrollSolutionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decode = function decode(reader, length) { + EnrollSolutionMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.EnrollSolutionMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -92074,108 +104783,109 @@ }; /** - * Decodes a RemoveFulfillmentPlacesResponse message from the specified reader or buffer, length delimited. + * Decodes an EnrollSolutionMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.EnrollSolutionMetadata} EnrollSolutionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RemoveFulfillmentPlacesResponse.decodeDelimited = function decodeDelimited(reader) { + EnrollSolutionMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RemoveFulfillmentPlacesResponse message. + * Verifies an EnrollSolutionMetadata message. * @function verify - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RemoveFulfillmentPlacesResponse.verify = function verify(message) { + EnrollSolutionMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a RemoveFulfillmentPlacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an EnrollSolutionMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} RemoveFulfillmentPlacesResponse + * @returns {google.cloud.retail.v2alpha.EnrollSolutionMetadata} EnrollSolutionMetadata */ - RemoveFulfillmentPlacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse) + EnrollSolutionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.EnrollSolutionMetadata) return object; - return new $root.google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse(); + return new $root.google.cloud.retail.v2alpha.EnrollSolutionMetadata(); }; /** - * Creates a plain object from a RemoveFulfillmentPlacesResponse message. Also converts values to other types if specified. + * Creates a plain object from an EnrollSolutionMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static - * @param {google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse} message RemoveFulfillmentPlacesResponse + * @param {google.cloud.retail.v2alpha.EnrollSolutionMetadata} message EnrollSolutionMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RemoveFulfillmentPlacesResponse.toObject = function toObject() { + EnrollSolutionMetadata.toObject = function toObject() { return {}; }; /** - * Converts this RemoveFulfillmentPlacesResponse to JSON. + * Converts this EnrollSolutionMetadata to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @instance * @returns {Object.} JSON object */ - RemoveFulfillmentPlacesResponse.prototype.toJSON = function toJSON() { + EnrollSolutionMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RemoveFulfillmentPlacesResponse + * Gets the default type url for EnrollSolutionMetadata * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse + * @memberof google.cloud.retail.v2alpha.EnrollSolutionMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RemoveFulfillmentPlacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnrollSolutionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.RemoveFulfillmentPlacesResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.EnrollSolutionMetadata"; }; - return RemoveFulfillmentPlacesResponse; + return EnrollSolutionMetadata; })(); - v2alpha.PurgeMetadata = (function() { + v2alpha.ListEnrolledSolutionsRequest = (function() { /** - * Properties of a PurgeMetadata. + * Properties of a ListEnrolledSolutionsRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeMetadata + * @interface IListEnrolledSolutionsRequest + * @property {string|null} [parent] ListEnrolledSolutionsRequest parent */ /** - * Constructs a new PurgeMetadata. + * Constructs a new ListEnrolledSolutionsRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeMetadata. - * @implements IPurgeMetadata + * @classdesc Represents a ListEnrolledSolutionsRequest. + * @implements IListEnrolledSolutionsRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest=} [properties] Properties to set */ - function PurgeMetadata(properties) { + function ListEnrolledSolutionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92183,63 +104893,77 @@ } /** - * Creates a new PurgeMetadata instance using the specified properties. + * ListEnrolledSolutionsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest + * @instance + */ + ListEnrolledSolutionsRequest.prototype.parent = ""; + + /** + * Creates a new ListEnrolledSolutionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata instance + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest} ListEnrolledSolutionsRequest instance */ - PurgeMetadata.create = function create(properties) { - return new PurgeMetadata(properties); + ListEnrolledSolutionsRequest.create = function create(properties) { + return new ListEnrolledSolutionsRequest(properties); }; /** - * Encodes the specified PurgeMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * Encodes the specified ListEnrolledSolutionsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest} message ListEnrolledSolutionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encode = function encode(message, writer) { + ListEnrolledSolutionsRequest.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); return writer; }; /** - * Encodes the specified PurgeMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeMetadata.verify|verify} messages. + * Encodes the specified ListEnrolledSolutionsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeMetadata} message PurgeMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest} message ListEnrolledSolutionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListEnrolledSolutionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer. + * Decodes a ListEnrolledSolutionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest} ListEnrolledSolutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decode = function decode(reader, length) { + ListEnrolledSolutionsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -92249,112 +104973,123 @@ }; /** - * Decodes a PurgeMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListEnrolledSolutionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest} ListEnrolledSolutionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeMetadata.decodeDelimited = function decodeDelimited(reader) { + ListEnrolledSolutionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeMetadata message. + * Verifies a ListEnrolledSolutionsRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeMetadata.verify = function verify(message) { + ListEnrolledSolutionsRequest.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"; return null; }; /** - * Creates a PurgeMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnrolledSolutionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeMetadata} PurgeMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest} ListEnrolledSolutionsRequest */ - PurgeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeMetadata) + ListEnrolledSolutionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest) return object; - return new $root.google.cloud.retail.v2alpha.PurgeMetadata(); + var message = new $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; }; /** - * Creates a plain object from a PurgeMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListEnrolledSolutionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeMetadata} message PurgeMetadata + * @param {google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest} message ListEnrolledSolutionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeMetadata.toObject = function toObject() { - return {}; + ListEnrolledSolutionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; }; /** - * Converts this PurgeMetadata to JSON. + * Converts this ListEnrolledSolutionsRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @instance * @returns {Object.} JSON object */ - PurgeMetadata.prototype.toJSON = function toJSON() { + ListEnrolledSolutionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeMetadata + * Gets the default type url for ListEnrolledSolutionsRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListEnrolledSolutionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest"; }; - return PurgeMetadata; + return ListEnrolledSolutionsRequest; })(); - v2alpha.PurgeProductsMetadata = (function() { + v2alpha.ListEnrolledSolutionsResponse = (function() { /** - * Properties of a PurgeProductsMetadata. + * Properties of a ListEnrolledSolutionsResponse. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeProductsMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] PurgeProductsMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] PurgeProductsMetadata updateTime - * @property {number|Long|null} [successCount] PurgeProductsMetadata successCount - * @property {number|Long|null} [failureCount] PurgeProductsMetadata failureCount + * @interface IListEnrolledSolutionsResponse + * @property {Array.|null} [enrolledSolutions] ListEnrolledSolutionsResponse enrolledSolutions */ /** - * Constructs a new PurgeProductsMetadata. + * Constructs a new ListEnrolledSolutionsResponse. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeProductsMetadata. - * @implements IPurgeProductsMetadata + * @classdesc Represents a ListEnrolledSolutionsResponse. + * @implements IListEnrolledSolutionsResponse * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse=} [properties] Properties to set */ - function PurgeProductsMetadata(properties) { + function ListEnrolledSolutionsResponse(properties) { + this.enrolledSolutions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92362,117 +105097,86 @@ } /** - * PurgeProductsMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata - * @instance - */ - PurgeProductsMetadata.prototype.createTime = null; - - /** - * PurgeProductsMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata - * @instance - */ - PurgeProductsMetadata.prototype.updateTime = null; - - /** - * PurgeProductsMetadata successCount. - * @member {number|Long} successCount - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata - * @instance - */ - PurgeProductsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PurgeProductsMetadata failureCount. - * @member {number|Long} failureCount - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * ListEnrolledSolutionsResponse enrolledSolutions. + * @member {Array.} enrolledSolutions + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @instance */ - PurgeProductsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListEnrolledSolutionsResponse.prototype.enrolledSolutions = $util.emptyArray; /** - * Creates a new PurgeProductsMetadata instance using the specified properties. + * Creates a new ListEnrolledSolutionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata instance + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} ListEnrolledSolutionsResponse instance */ - PurgeProductsMetadata.create = function create(properties) { - return new PurgeProductsMetadata(properties); + ListEnrolledSolutionsResponse.create = function create(properties) { + return new ListEnrolledSolutionsResponse(properties); }; /** - * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. + * Encodes the specified ListEnrolledSolutionsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse} message ListEnrolledSolutionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsMetadata.encode = function encode(message, writer) { + ListEnrolledSolutionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); - if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + if (message.enrolledSolutions != null && message.enrolledSolutions.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.enrolledSolutions.length; ++i) + writer.int32(message.enrolledSolutions[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsMetadata.verify|verify} messages. + * Encodes the specified ListEnrolledSolutionsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse} message ListEnrolledSolutionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListEnrolledSolutionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * Decodes a ListEnrolledSolutionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} ListEnrolledSolutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsMetadata.decode = function decode(reader, length) { + ListEnrolledSolutionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse(); 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.successCount = reader.int64(); - break; - } - case 4: { - message.failureCount = reader.int64(); + if (!(message.enrolledSolutions && message.enrolledSolutions.length)) + message.enrolledSolutions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.enrolledSolutions.push(reader.int32()); + } else + message.enrolledSolutions.push(reader.int32()); break; } default: @@ -92484,187 +105188,158 @@ }; /** - * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListEnrolledSolutionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} ListEnrolledSolutionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsMetadata.decodeDelimited = function decodeDelimited(reader) { + ListEnrolledSolutionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeProductsMetadata message. + * Verifies a ListEnrolledSolutionsResponse message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeProductsMetadata.verify = function verify(message) { + ListEnrolledSolutionsResponse.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.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (message.enrolledSolutions != null && message.hasOwnProperty("enrolledSolutions")) { + if (!Array.isArray(message.enrolledSolutions)) + return "enrolledSolutions: array expected"; + for (var i = 0; i < message.enrolledSolutions.length; ++i) + switch (message.enrolledSolutions[i]) { + default: + return "enrolledSolutions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } } - if (message.successCount != null && message.hasOwnProperty("successCount")) - if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) - return "successCount: integer|Long expected"; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) - return "failureCount: integer|Long expected"; return null; }; /** - * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnrolledSolutionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeProductsMetadata} PurgeProductsMetadata + * @returns {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} ListEnrolledSolutionsResponse */ - PurgeProductsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsMetadata) + ListEnrolledSolutionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeProductsMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.retail.v2alpha.PurgeProductsMetadata.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.retail.v2alpha.PurgeProductsMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse(); + if (object.enrolledSolutions) { + if (!Array.isArray(object.enrolledSolutions)) + throw TypeError(".google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse.enrolledSolutions: array expected"); + message.enrolledSolutions = []; + for (var i = 0; i < object.enrolledSolutions.length; ++i) + switch (object.enrolledSolutions[i]) { + default: + if (typeof object.enrolledSolutions[i] === "number") { + message.enrolledSolutions[i] = object.enrolledSolutions[i]; + break; + } + case "SOLUTION_TYPE_UNSPECIFIED": + case 0: + message.enrolledSolutions[i] = 0; + break; + case "SOLUTION_TYPE_RECOMMENDATION": + case 1: + message.enrolledSolutions[i] = 1; + break; + case "SOLUTION_TYPE_SEARCH": + case 2: + message.enrolledSolutions[i] = 2; + break; + } } - if (object.successCount != null) - if ($util.Long) - (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; - else if (typeof object.successCount === "string") - message.successCount = parseInt(object.successCount, 10); - else if (typeof object.successCount === "number") - message.successCount = object.successCount; - else if (typeof object.successCount === "object") - message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); - if (object.failureCount != null) - if ($util.Long) - (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; - else if (typeof object.failureCount === "string") - message.failureCount = parseInt(object.failureCount, 10); - else if (typeof object.failureCount === "number") - message.failureCount = object.failureCount; - else if (typeof object.failureCount === "object") - message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListEnrolledSolutionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static - * @param {google.cloud.retail.v2alpha.PurgeProductsMetadata} message PurgeProductsMetadata + * @param {google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse} message ListEnrolledSolutionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeProductsMetadata.toObject = function toObject(message, options) { + ListEnrolledSolutionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.updateTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.successCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.failureCount = options.longs === String ? "0" : 0; + if (options.arrays || options.defaults) + object.enrolledSolutions = []; + if (message.enrolledSolutions && message.enrolledSolutions.length) { + object.enrolledSolutions = []; + for (var j = 0; j < message.enrolledSolutions.length; ++j) + object.enrolledSolutions[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolutions[j]] === undefined ? message.enrolledSolutions[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.enrolledSolutions[j]] : message.enrolledSolutions[j]; } - 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.successCount != null && message.hasOwnProperty("successCount")) - if (typeof message.successCount === "number") - object.successCount = options.longs === String ? String(message.successCount) : message.successCount; - else - object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; - if (message.failureCount != null && message.hasOwnProperty("failureCount")) - if (typeof message.failureCount === "number") - object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; - else - object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; return object; }; /** - * Converts this PurgeProductsMetadata to JSON. + * Converts this ListEnrolledSolutionsResponse to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @instance * @returns {Object.} JSON object */ - PurgeProductsMetadata.prototype.toJSON = function toJSON() { + ListEnrolledSolutionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeProductsMetadata + * Gets the default type url for ListEnrolledSolutionsResponse * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeProductsMetadata + * @memberof google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeProductsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListEnrolledSolutionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsMetadata"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse"; }; - return PurgeProductsMetadata; + return ListEnrolledSolutionsResponse; })(); - v2alpha.PurgeProductsRequest = (function() { + v2alpha.GetLoggingConfigRequest = (function() { /** - * Properties of a PurgeProductsRequest. + * Properties of a GetLoggingConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeProductsRequest - * @property {string|null} [parent] PurgeProductsRequest parent - * @property {string|null} [filter] PurgeProductsRequest filter - * @property {boolean|null} [force] PurgeProductsRequest force + * @interface IGetLoggingConfigRequest + * @property {string|null} [name] GetLoggingConfigRequest name */ /** - * Constructs a new PurgeProductsRequest. + * Constructs a new GetLoggingConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeProductsRequest. - * @implements IPurgeProductsRequest + * @classdesc Represents a GetLoggingConfigRequest. + * @implements IGetLoggingConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest=} [properties] Properties to set */ - function PurgeProductsRequest(properties) { + function GetLoggingConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92672,103 +105347,75 @@ } /** - * PurgeProductsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest - * @instance - */ - PurgeProductsRequest.prototype.parent = ""; - - /** - * PurgeProductsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest - * @instance - */ - PurgeProductsRequest.prototype.filter = ""; - - /** - * PurgeProductsRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * GetLoggingConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @instance */ - PurgeProductsRequest.prototype.force = false; + GetLoggingConfigRequest.prototype.name = ""; /** - * Creates a new PurgeProductsRequest instance using the specified properties. + * Creates a new GetLoggingConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest instance + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetLoggingConfigRequest} GetLoggingConfigRequest instance */ - PurgeProductsRequest.create = function create(properties) { - return new PurgeProductsRequest(properties); + GetLoggingConfigRequest.create = function create(properties) { + return new GetLoggingConfigRequest(properties); }; /** - * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. + * Encodes the specified GetLoggingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetLoggingConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest} message GetLoggingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsRequest.encode = function encode(message, writer) { + GetLoggingConfigRequest.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 2, wireType 2 =*/18).string(message.filter); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsRequest.verify|verify} messages. + * Encodes the specified GetLoggingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetLoggingConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetLoggingConfigRequest} message GetLoggingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetLoggingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * Decodes a GetLoggingConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest + * @returns {google.cloud.retail.v2alpha.GetLoggingConfigRequest} GetLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsRequest.decode = function decode(reader, length) { + GetLoggingConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetLoggingConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.force = reader.bool(); + message.name = reader.string(); break; } default: @@ -92780,141 +105427,123 @@ }; /** - * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetLoggingConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest + * @returns {google.cloud.retail.v2alpha.GetLoggingConfigRequest} GetLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsRequest.decodeDelimited = function decodeDelimited(reader) { + GetLoggingConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeProductsRequest message. + * Verifies a GetLoggingConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeProductsRequest.verify = function verify(message) { + GetLoggingConfigRequest.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.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetLoggingConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeProductsRequest} PurgeProductsRequest + * @returns {google.cloud.retail.v2alpha.GetLoggingConfigRequest} GetLoggingConfigRequest */ - PurgeProductsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsRequest) + GetLoggingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetLoggingConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeProductsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.retail.v2alpha.GetLoggingConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetLoggingConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeProductsRequest} message PurgeProductsRequest + * @param {google.cloud.retail.v2alpha.GetLoggingConfigRequest} message GetLoggingConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeProductsRequest.toObject = function toObject(message, options) { + GetLoggingConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.force = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this PurgeProductsRequest to JSON. + * Converts this GetLoggingConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @instance * @returns {Object.} JSON object */ - PurgeProductsRequest.prototype.toJSON = function toJSON() { + GetLoggingConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeProductsRequest + * Gets the default type url for GetLoggingConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeProductsRequest + * @memberof google.cloud.retail.v2alpha.GetLoggingConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetLoggingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetLoggingConfigRequest"; }; - return PurgeProductsRequest; + return GetLoggingConfigRequest; })(); - v2alpha.PurgeProductsResponse = (function() { + v2alpha.UpdateLoggingConfigRequest = (function() { /** - * Properties of a PurgeProductsResponse. + * Properties of an UpdateLoggingConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeProductsResponse - * @property {number|Long|null} [purgeCount] PurgeProductsResponse purgeCount - * @property {Array.|null} [purgeSample] PurgeProductsResponse purgeSample + * @interface IUpdateLoggingConfigRequest + * @property {google.cloud.retail.v2alpha.ILoggingConfig|null} [loggingConfig] UpdateLoggingConfigRequest loggingConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateLoggingConfigRequest updateMask */ /** - * Constructs a new PurgeProductsResponse. + * Constructs a new UpdateLoggingConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeProductsResponse. - * @implements IPurgeProductsResponse + * @classdesc Represents an UpdateLoggingConfigRequest. + * @implements IUpdateLoggingConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest=} [properties] Properties to set */ - function PurgeProductsResponse(properties) { - this.purgeSample = []; + function UpdateLoggingConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92922,92 +105551,89 @@ } /** - * PurgeProductsResponse purgeCount. - * @member {number|Long} purgeCount - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * UpdateLoggingConfigRequest loggingConfig. + * @member {google.cloud.retail.v2alpha.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @instance */ - PurgeProductsResponse.prototype.purgeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateLoggingConfigRequest.prototype.loggingConfig = null; /** - * PurgeProductsResponse purgeSample. - * @member {Array.} purgeSample - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * UpdateLoggingConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @instance */ - PurgeProductsResponse.prototype.purgeSample = $util.emptyArray; + UpdateLoggingConfigRequest.prototype.updateMask = null; /** - * Creates a new PurgeProductsResponse instance using the specified properties. + * Creates a new UpdateLoggingConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse instance + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateLoggingConfigRequest} UpdateLoggingConfigRequest instance */ - PurgeProductsResponse.create = function create(properties) { - return new PurgeProductsResponse(properties); + UpdateLoggingConfigRequest.create = function create(properties) { + return new UpdateLoggingConfigRequest(properties); }; /** - * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. + * Encodes the specified UpdateLoggingConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest} message UpdateLoggingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsResponse.encode = function encode(message, writer) { + UpdateLoggingConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.purgeCount != null && Object.hasOwnProperty.call(message, "purgeCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgeCount); - if (message.purgeSample != null && message.purgeSample.length) - for (var i = 0; i < message.purgeSample.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.purgeSample[i]); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.retail.v2alpha.LoggingConfig.encode(message.loggingConfig, 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 PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeProductsResponse.verify|verify} messages. + * Encodes the specified UpdateLoggingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest} message UpdateLoggingConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateLoggingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * Decodes an UpdateLoggingConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse + * @returns {google.cloud.retail.v2alpha.UpdateLoggingConfigRequest} UpdateLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsResponse.decode = function decode(reader, length) { + UpdateLoggingConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeProductsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.purgeCount = reader.int64(); + message.loggingConfig = $root.google.cloud.retail.v2alpha.LoggingConfig.decode(reader, reader.uint32()); break; } case 2: { - if (!(message.purgeSample && message.purgeSample.length)) - message.purgeSample = []; - message.purgeSample.push(reader.string()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -93019,159 +105645,141 @@ }; /** - * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateLoggingConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse + * @returns {google.cloud.retail.v2alpha.UpdateLoggingConfigRequest} UpdateLoggingConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeProductsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateLoggingConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeProductsResponse message. + * Verifies an UpdateLoggingConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeProductsResponse.verify = function verify(message) { + UpdateLoggingConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) - if (!$util.isInteger(message.purgeCount) && !(message.purgeCount && $util.isInteger(message.purgeCount.low) && $util.isInteger(message.purgeCount.high))) - return "purgeCount: integer|Long expected"; - if (message.purgeSample != null && message.hasOwnProperty("purgeSample")) { - if (!Array.isArray(message.purgeSample)) - return "purgeSample: array expected"; - for (var i = 0; i < message.purgeSample.length; ++i) - if (!$util.isString(message.purgeSample[i])) - return "purgeSample: string[] expected"; + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.retail.v2alpha.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateLoggingConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeProductsResponse} PurgeProductsResponse + * @returns {google.cloud.retail.v2alpha.UpdateLoggingConfigRequest} UpdateLoggingConfigRequest */ - PurgeProductsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeProductsResponse) + UpdateLoggingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeProductsResponse(); - if (object.purgeCount != null) - if ($util.Long) - (message.purgeCount = $util.Long.fromValue(object.purgeCount)).unsigned = false; - else if (typeof object.purgeCount === "string") - message.purgeCount = parseInt(object.purgeCount, 10); - else if (typeof object.purgeCount === "number") - message.purgeCount = object.purgeCount; - else if (typeof object.purgeCount === "object") - message.purgeCount = new $util.LongBits(object.purgeCount.low >>> 0, object.purgeCount.high >>> 0).toNumber(); - if (object.purgeSample) { - if (!Array.isArray(object.purgeSample)) - throw TypeError(".google.cloud.retail.v2alpha.PurgeProductsResponse.purgeSample: array expected"); - message.purgeSample = []; - for (var i = 0; i < object.purgeSample.length; ++i) - message.purgeSample[i] = String(object.purgeSample[i]); + var message = new $root.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest(); + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.retail.v2alpha.LoggingConfig.fromObject(object.loggingConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateLoggingConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateLoggingConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeProductsResponse} message PurgeProductsResponse + * @param {google.cloud.retail.v2alpha.UpdateLoggingConfigRequest} message UpdateLoggingConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeProductsResponse.toObject = function toObject(message, options) { + UpdateLoggingConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.purgeSample = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.purgeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.purgeCount = options.longs === String ? "0" : 0; - if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) - if (typeof message.purgeCount === "number") - object.purgeCount = options.longs === String ? String(message.purgeCount) : message.purgeCount; - else - object.purgeCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgeCount) : options.longs === Number ? new $util.LongBits(message.purgeCount.low >>> 0, message.purgeCount.high >>> 0).toNumber() : message.purgeCount; - if (message.purgeSample && message.purgeSample.length) { - object.purgeSample = []; - for (var j = 0; j < message.purgeSample.length; ++j) - object.purgeSample[j] = message.purgeSample[j]; + if (options.defaults) { + object.loggingConfig = null; + object.updateMask = null; } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.retail.v2alpha.LoggingConfig.toObject(message.loggingConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this PurgeProductsResponse to JSON. + * Converts this UpdateLoggingConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @instance * @returns {Object.} JSON object */ - PurgeProductsResponse.prototype.toJSON = function toJSON() { + UpdateLoggingConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeProductsResponse + * Gets the default type url for UpdateLoggingConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeProductsResponse + * @memberof google.cloud.retail.v2alpha.UpdateLoggingConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateLoggingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeProductsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateLoggingConfigRequest"; }; - return PurgeProductsResponse; + return UpdateLoggingConfigRequest; })(); - v2alpha.PurgeUserEventsRequest = (function() { + v2alpha.GetAlertConfigRequest = (function() { /** - * Properties of a PurgeUserEventsRequest. + * Properties of a GetAlertConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeUserEventsRequest - * @property {string|null} [parent] PurgeUserEventsRequest parent - * @property {string|null} [filter] PurgeUserEventsRequest filter - * @property {boolean|null} [force] PurgeUserEventsRequest force + * @interface IGetAlertConfigRequest + * @property {string|null} [name] GetAlertConfigRequest name */ /** - * Constructs a new PurgeUserEventsRequest. + * Constructs a new GetAlertConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeUserEventsRequest. - * @implements IPurgeUserEventsRequest + * @classdesc Represents a GetAlertConfigRequest. + * @implements IGetAlertConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest=} [properties] Properties to set */ - function PurgeUserEventsRequest(properties) { + function GetAlertConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93179,103 +105787,75 @@ } /** - * PurgeUserEventsRequest parent. - * @member {string} parent - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest - * @instance - */ - PurgeUserEventsRequest.prototype.parent = ""; - - /** - * PurgeUserEventsRequest filter. - * @member {string} filter - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest - * @instance - */ - PurgeUserEventsRequest.prototype.filter = ""; - - /** - * PurgeUserEventsRequest force. - * @member {boolean} force - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * GetAlertConfigRequest name. + * @member {string} name + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @instance */ - PurgeUserEventsRequest.prototype.force = false; + GetAlertConfigRequest.prototype.name = ""; /** - * Creates a new PurgeUserEventsRequest instance using the specified properties. + * Creates a new GetAlertConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest instance + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.GetAlertConfigRequest} GetAlertConfigRequest instance */ - PurgeUserEventsRequest.create = function create(properties) { - return new PurgeUserEventsRequest(properties); + GetAlertConfigRequest.create = function create(properties) { + return new GetAlertConfigRequest(properties); }; /** - * Encodes the specified PurgeUserEventsRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified GetAlertConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.GetAlertConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest} message GetAlertConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encode = function encode(message, writer) { + GetAlertConfigRequest.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 2, wireType 2 =*/18).string(message.filter); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified PurgeUserEventsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsRequest.verify|verify} messages. + * Encodes the specified GetAlertConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.GetAlertConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsRequest} message PurgeUserEventsRequest message or plain object to encode + * @param {google.cloud.retail.v2alpha.IGetAlertConfigRequest} message GetAlertConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetAlertConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer. + * Decodes a GetAlertConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.GetAlertConfigRequest} GetAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decode = function decode(reader, length) { + GetAlertConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.GetAlertConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.force = reader.bool(); + message.name = reader.string(); break; } default: @@ -93287,139 +105867,123 @@ }; /** - * Decodes a PurgeUserEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetAlertConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.GetAlertConfigRequest} GetAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsRequest.decodeDelimited = function decodeDelimited(reader) { + GetAlertConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsRequest message. + * Verifies a GetAlertConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsRequest.verify = function verify(message) { + GetAlertConfigRequest.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.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a PurgeUserEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetAlertConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsRequest} PurgeUserEventsRequest + * @returns {google.cloud.retail.v2alpha.GetAlertConfigRequest} GetAlertConfigRequest */ - PurgeUserEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest) + GetAlertConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.GetAlertConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.retail.v2alpha.GetAlertConfigRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a PurgeUserEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetAlertConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeUserEventsRequest} message PurgeUserEventsRequest + * @param {google.cloud.retail.v2alpha.GetAlertConfigRequest} message GetAlertConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsRequest.toObject = function toObject(message, options) { + GetAlertConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.force = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this PurgeUserEventsRequest to JSON. + * Converts this GetAlertConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @instance * @returns {Object.} JSON object */ - PurgeUserEventsRequest.prototype.toJSON = function toJSON() { + GetAlertConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeUserEventsRequest + * Gets the default type url for GetAlertConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsRequest + * @memberof google.cloud.retail.v2alpha.GetAlertConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeUserEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetAlertConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeUserEventsRequest"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.GetAlertConfigRequest"; }; - return PurgeUserEventsRequest; + return GetAlertConfigRequest; })(); - v2alpha.PurgeUserEventsResponse = (function() { + v2alpha.UpdateAlertConfigRequest = (function() { /** - * Properties of a PurgeUserEventsResponse. + * Properties of an UpdateAlertConfigRequest. * @memberof google.cloud.retail.v2alpha - * @interface IPurgeUserEventsResponse - * @property {number|Long|null} [purgedEventsCount] PurgeUserEventsResponse purgedEventsCount + * @interface IUpdateAlertConfigRequest + * @property {google.cloud.retail.v2alpha.IAlertConfig|null} [alertConfig] UpdateAlertConfigRequest alertConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAlertConfigRequest updateMask */ /** - * Constructs a new PurgeUserEventsResponse. + * Constructs a new UpdateAlertConfigRequest. * @memberof google.cloud.retail.v2alpha - * @classdesc Represents a PurgeUserEventsResponse. - * @implements IPurgeUserEventsResponse + * @classdesc Represents an UpdateAlertConfigRequest. + * @implements IUpdateAlertConfigRequest * @constructor - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest=} [properties] Properties to set */ - function PurgeUserEventsResponse(properties) { + function UpdateAlertConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93427,75 +105991,89 @@ } /** - * PurgeUserEventsResponse purgedEventsCount. - * @member {number|Long} purgedEventsCount - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * UpdateAlertConfigRequest alertConfig. + * @member {google.cloud.retail.v2alpha.IAlertConfig|null|undefined} alertConfig + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @instance */ - PurgeUserEventsResponse.prototype.purgedEventsCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UpdateAlertConfigRequest.prototype.alertConfig = null; /** - * Creates a new PurgeUserEventsResponse instance using the specified properties. + * UpdateAlertConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest + * @instance + */ + UpdateAlertConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAlertConfigRequest instance using the specified properties. * @function create - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse=} [properties] Properties to set - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse instance + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2alpha.UpdateAlertConfigRequest} UpdateAlertConfigRequest instance */ - PurgeUserEventsResponse.create = function create(properties) { - return new PurgeUserEventsResponse(properties); + UpdateAlertConfigRequest.create = function create(properties) { + return new UpdateAlertConfigRequest(properties); }; /** - * Encodes the specified PurgeUserEventsResponse message. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified UpdateAlertConfigRequest message. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAlertConfigRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest} message UpdateAlertConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encode = function encode(message, writer) { + UpdateAlertConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.purgedEventsCount != null && Object.hasOwnProperty.call(message, "purgedEventsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgedEventsCount); + if (message.alertConfig != null && Object.hasOwnProperty.call(message, "alertConfig")) + $root.google.cloud.retail.v2alpha.AlertConfig.encode(message.alertConfig, 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 PurgeUserEventsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.PurgeUserEventsResponse.verify|verify} messages. + * Encodes the specified UpdateAlertConfigRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2alpha.UpdateAlertConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.IPurgeUserEventsResponse} message PurgeUserEventsResponse message or plain object to encode + * @param {google.cloud.retail.v2alpha.IUpdateAlertConfigRequest} message UpdateAlertConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PurgeUserEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAlertConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer. + * Decodes an UpdateAlertConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.UpdateAlertConfigRequest} UpdateAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decode = function decode(reader, length) { + UpdateAlertConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2alpha.UpdateAlertConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.purgedEventsCount = reader.int64(); + message.alertConfig = $root.google.cloud.retail.v2alpha.AlertConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -93507,116 +106085,121 @@ }; /** - * Decodes a PurgeUserEventsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateAlertConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.UpdateAlertConfigRequest} UpdateAlertConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PurgeUserEventsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateAlertConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PurgeUserEventsResponse message. + * Verifies an UpdateAlertConfigRequest message. * @function verify - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PurgeUserEventsResponse.verify = function verify(message) { + UpdateAlertConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (!$util.isInteger(message.purgedEventsCount) && !(message.purgedEventsCount && $util.isInteger(message.purgedEventsCount.low) && $util.isInteger(message.purgedEventsCount.high))) - return "purgedEventsCount: integer|Long expected"; + if (message.alertConfig != null && message.hasOwnProperty("alertConfig")) { + var error = $root.google.cloud.retail.v2alpha.AlertConfig.verify(message.alertConfig); + if (error) + return "alertConfig." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a PurgeUserEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAlertConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.retail.v2alpha.PurgeUserEventsResponse} PurgeUserEventsResponse + * @returns {google.cloud.retail.v2alpha.UpdateAlertConfigRequest} UpdateAlertConfigRequest */ - PurgeUserEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse) + UpdateAlertConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2alpha.UpdateAlertConfigRequest) return object; - var message = new $root.google.cloud.retail.v2alpha.PurgeUserEventsResponse(); - if (object.purgedEventsCount != null) - if ($util.Long) - (message.purgedEventsCount = $util.Long.fromValue(object.purgedEventsCount)).unsigned = false; - else if (typeof object.purgedEventsCount === "string") - message.purgedEventsCount = parseInt(object.purgedEventsCount, 10); - else if (typeof object.purgedEventsCount === "number") - message.purgedEventsCount = object.purgedEventsCount; - else if (typeof object.purgedEventsCount === "object") - message.purgedEventsCount = new $util.LongBits(object.purgedEventsCount.low >>> 0, object.purgedEventsCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.retail.v2alpha.UpdateAlertConfigRequest(); + if (object.alertConfig != null) { + if (typeof object.alertConfig !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateAlertConfigRequest.alertConfig: object expected"); + message.alertConfig = $root.google.cloud.retail.v2alpha.AlertConfig.fromObject(object.alertConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.retail.v2alpha.UpdateAlertConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a PurgeUserEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAlertConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static - * @param {google.cloud.retail.v2alpha.PurgeUserEventsResponse} message PurgeUserEventsResponse + * @param {google.cloud.retail.v2alpha.UpdateAlertConfigRequest} message UpdateAlertConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PurgeUserEventsResponse.toObject = function toObject(message, options) { + UpdateAlertConfigRequest.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.purgedEventsCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.purgedEventsCount = options.longs === String ? "0" : 0; - if (message.purgedEventsCount != null && message.hasOwnProperty("purgedEventsCount")) - if (typeof message.purgedEventsCount === "number") - object.purgedEventsCount = options.longs === String ? String(message.purgedEventsCount) : message.purgedEventsCount; - else - object.purgedEventsCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgedEventsCount) : options.longs === Number ? new $util.LongBits(message.purgedEventsCount.low >>> 0, message.purgedEventsCount.high >>> 0).toNumber() : message.purgedEventsCount; + if (options.defaults) { + object.alertConfig = null; + object.updateMask = null; + } + if (message.alertConfig != null && message.hasOwnProperty("alertConfig")) + object.alertConfig = $root.google.cloud.retail.v2alpha.AlertConfig.toObject(message.alertConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this PurgeUserEventsResponse to JSON. + * Converts this UpdateAlertConfigRequest to JSON. * @function toJSON - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @instance * @returns {Object.} JSON object */ - PurgeUserEventsResponse.prototype.toJSON = function toJSON() { + UpdateAlertConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PurgeUserEventsResponse + * Gets the default type url for UpdateAlertConfigRequest * @function getTypeUrl - * @memberof google.cloud.retail.v2alpha.PurgeUserEventsResponse + * @memberof google.cloud.retail.v2alpha.UpdateAlertConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PurgeUserEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateAlertConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.retail.v2alpha.PurgeUserEventsResponse"; + return typeUrlPrefix + "/google.cloud.retail.v2alpha.UpdateAlertConfigRequest"; }; - return PurgeUserEventsResponse; + return UpdateAlertConfigRequest; })(); v2alpha.ServingConfig = (function() { @@ -93642,6 +106225,7 @@ * @property {string|null} [diversityLevel] ServingConfig diversityLevel * @property {google.cloud.retail.v2alpha.ServingConfig.DiversityType|null} [diversityType] ServingConfig diversityType * @property {string|null} [enableCategoryFilterLevel] ServingConfig enableCategoryFilterLevel + * @property {boolean|null} [ignoreRecsDenylist] ServingConfig ignoreRecsDenylist * @property {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] ServingConfig personalizationSpec * @property {Array.|null} [solutionTypes] ServingConfig solutionTypes */ @@ -93807,6 +106391,14 @@ */ ServingConfig.prototype.enableCategoryFilterLevel = ""; + /** + * ServingConfig ignoreRecsDenylist. + * @member {boolean} ignoreRecsDenylist + * @memberof google.cloud.retail.v2alpha.ServingConfig + * @instance + */ + ServingConfig.prototype.ignoreRecsDenylist = false; + /** * ServingConfig personalizationSpec. * @member {google.cloud.retail.v2alpha.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec @@ -93898,6 +106490,8 @@ writer.uint32(/* id 20, wireType 0 =*/160).int32(message.diversityType); if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.ignoreRecsDenylist != null && Object.hasOwnProperty.call(message, "ignoreRecsDenylist")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.ignoreRecsDenylist); return writer; }; @@ -94018,6 +106612,10 @@ message.enableCategoryFilterLevel = reader.string(); break; } + case 24: { + message.ignoreRecsDenylist = reader.bool(); + break; + } case 21: { message.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); break; @@ -94163,6 +106761,9 @@ if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) if (!$util.isString(message.enableCategoryFilterLevel)) return "enableCategoryFilterLevel: string expected"; + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + if (typeof message.ignoreRecsDenylist !== "boolean") + return "ignoreRecsDenylist: boolean expected"; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { var error = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); if (error) @@ -94296,6 +106897,8 @@ } if (object.enableCategoryFilterLevel != null) message.enableCategoryFilterLevel = String(object.enableCategoryFilterLevel); + if (object.ignoreRecsDenylist != null) + message.ignoreRecsDenylist = Boolean(object.ignoreRecsDenylist); if (object.personalizationSpec != null) { if (typeof object.personalizationSpec !== "object") throw TypeError(".google.cloud.retail.v2alpha.ServingConfig.personalizationSpec: object expected"); @@ -94364,6 +106967,7 @@ object.enableCategoryFilterLevel = ""; object.diversityType = options.enums === String ? "DIVERSITY_TYPE_UNSPECIFIED" : 0; object.personalizationSpec = null; + object.ignoreRecsDenylist = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -94433,6 +107037,8 @@ object.diversityType = options.enums === String ? $root.google.cloud.retail.v2alpha.ServingConfig.DiversityType[message.diversityType] === undefined ? message.diversityType : $root.google.cloud.retail.v2alpha.ServingConfig.DiversityType[message.diversityType] : message.diversityType; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + object.ignoreRecsDenylist = message.ignoreRecsDenylist; return object; }; @@ -101358,6 +113964,7 @@ * @property {google.cloud.retail.v2beta.RecommendationsFilteringOption|null} [recommendationsFilteringOption] CatalogAttribute recommendationsFilteringOption * @property {google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption|null} [exactSearchableOption] CatalogAttribute exactSearchableOption * @property {google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption|null} [retrievableOption] CatalogAttribute retrievableOption + * @property {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig|null} [facetConfig] CatalogAttribute facetConfig */ /** @@ -101447,6 +114054,14 @@ */ CatalogAttribute.prototype.retrievableOption = 0; + /** + * CatalogAttribute facetConfig. + * @member {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig|null|undefined} facetConfig + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @instance + */ + CatalogAttribute.prototype.facetConfig = null; + /** * Creates a new CatalogAttribute instance using the specified properties. * @function create @@ -101489,6 +114104,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.exactSearchableOption); if (message.retrievableOption != null && Object.hasOwnProperty.call(message, "retrievableOption")) writer.uint32(/* id 12, wireType 0 =*/96).int32(message.retrievableOption); + if (message.facetConfig != null && Object.hasOwnProperty.call(message, "facetConfig")) + $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.encode(message.facetConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -101559,6 +114176,10 @@ message.retrievableOption = reader.int32(); break; } + case 13: { + message.facetConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -101663,6 +114284,11 @@ case 2: break; } + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.verify(message.facetConfig); + if (error) + return "facetConfig." + error; + } return null; }; @@ -101822,6 +114448,11 @@ message.retrievableOption = 2; break; } + if (object.facetConfig != null) { + if (typeof object.facetConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.facetConfig: object expected"); + message.facetConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.fromObject(object.facetConfig); + } return message; }; @@ -101848,6 +114479,7 @@ object.type = options.enums === String ? "UNKNOWN" : 0; object.exactSearchableOption = options.enums === String ? "EXACT_SEARCHABLE_OPTION_UNSPECIFIED" : 0; object.retrievableOption = options.enums === String ? "RETRIEVABLE_OPTION_UNSPECIFIED" : 0; + object.facetConfig = null; } if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; @@ -101867,6 +114499,8 @@ object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; if (message.retrievableOption != null && message.hasOwnProperty("retrievableOption")) object.retrievableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption[message.retrievableOption] === undefined ? message.retrievableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.RetrievableOption[message.retrievableOption] : message.retrievableOption; + if (message.facetConfig != null && message.hasOwnProperty("facetConfig")) + object.facetConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.toObject(message.facetConfig, options); return object; }; @@ -101896,6 +114530,1343 @@ return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute"; }; + CatalogAttribute.FacetConfig = (function() { + + /** + * Properties of a FacetConfig. + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @interface IFacetConfig + * @property {Array.|null} [facetIntervals] FacetConfig facetIntervals + * @property {Array.|null} [ignoredFacetValues] FacetConfig ignoredFacetValues + * @property {Array.|null} [mergedFacetValues] FacetConfig mergedFacetValues + * @property {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet|null} [mergedFacet] FacetConfig mergedFacet + * @property {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig|null} [rerankConfig] FacetConfig rerankConfig + */ + + /** + * Constructs a new FacetConfig. + * @memberof google.cloud.retail.v2beta.CatalogAttribute + * @classdesc Represents a FacetConfig. + * @implements IFacetConfig + * @constructor + * @param {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig=} [properties] Properties to set + */ + function FacetConfig(properties) { + this.facetIntervals = []; + this.ignoredFacetValues = []; + this.mergedFacetValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetConfig facetIntervals. + * @member {Array.} facetIntervals + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.facetIntervals = $util.emptyArray; + + /** + * FacetConfig ignoredFacetValues. + * @member {Array.} ignoredFacetValues + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.ignoredFacetValues = $util.emptyArray; + + /** + * FacetConfig mergedFacetValues. + * @member {Array.} mergedFacetValues + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacetValues = $util.emptyArray; + + /** + * FacetConfig mergedFacet. + * @member {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet|null|undefined} mergedFacet + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.mergedFacet = null; + + /** + * FacetConfig rerankConfig. + * @member {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig|null|undefined} rerankConfig + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + */ + FacetConfig.prototype.rerankConfig = null; + + /** + * Creates a new FacetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig} FacetConfig instance + */ + FacetConfig.create = function create(properties) { + return new FacetConfig(properties); + }; + + /** + * Encodes the specified FacetConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetIntervals != null && message.facetIntervals.length) + for (var i = 0; i < message.facetIntervals.length; ++i) + $root.google.cloud.retail.v2beta.Interval.encode(message.facetIntervals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ignoredFacetValues != null && message.ignoredFacetValues.length) + for (var i = 0; i < message.ignoredFacetValues.length; ++i) + $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.encode(message.ignoredFacetValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mergedFacetValues != null && message.mergedFacetValues.length) + for (var i = 0; i < message.mergedFacetValues.length; ++i) + $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.encode(message.mergedFacetValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mergedFacet != null && Object.hasOwnProperty.call(message, "mergedFacet")) + $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.encode(message.mergedFacet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rerankConfig != null && Object.hasOwnProperty.call(message, "rerankConfig")) + $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.encode(message.rerankConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FacetConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.IFacetConfig} message FacetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.facetIntervals && message.facetIntervals.length)) + message.facetIntervals = []; + message.facetIntervals.push($root.google.cloud.retail.v2beta.Interval.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ignoredFacetValues && message.ignoredFacetValues.length)) + message.ignoredFacetValues = []; + message.ignoredFacetValues.push($root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.mergedFacetValues && message.mergedFacetValues.length)) + message.mergedFacetValues = []; + message.mergedFacetValues.push($root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.decode(reader, reader.uint32())); + break; + } + case 4: { + message.mergedFacet = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rerankConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig} FacetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetIntervals != null && message.hasOwnProperty("facetIntervals")) { + if (!Array.isArray(message.facetIntervals)) + return "facetIntervals: array expected"; + for (var i = 0; i < message.facetIntervals.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Interval.verify(message.facetIntervals[i]); + if (error) + return "facetIntervals." + error; + } + } + if (message.ignoredFacetValues != null && message.hasOwnProperty("ignoredFacetValues")) { + if (!Array.isArray(message.ignoredFacetValues)) + return "ignoredFacetValues: array expected"; + for (var i = 0; i < message.ignoredFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify(message.ignoredFacetValues[i]); + if (error) + return "ignoredFacetValues." + error; + } + } + if (message.mergedFacetValues != null && message.hasOwnProperty("mergedFacetValues")) { + if (!Array.isArray(message.mergedFacetValues)) + return "mergedFacetValues: array expected"; + for (var i = 0; i < message.mergedFacetValues.length; ++i) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.verify(message.mergedFacetValues[i]); + if (error) + return "mergedFacetValues." + error; + } + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.verify(message.mergedFacet); + if (error) + return "mergedFacet." + error; + } + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) { + var error = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.verify(message.rerankConfig); + if (error) + return "rerankConfig." + error; + } + return null; + }; + + /** + * Creates a FacetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig} FacetConfig + */ + FacetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig(); + if (object.facetIntervals) { + if (!Array.isArray(object.facetIntervals)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.facetIntervals: array expected"); + message.facetIntervals = []; + for (var i = 0; i < object.facetIntervals.length; ++i) { + if (typeof object.facetIntervals[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.facetIntervals: object expected"); + message.facetIntervals[i] = $root.google.cloud.retail.v2beta.Interval.fromObject(object.facetIntervals[i]); + } + } + if (object.ignoredFacetValues) { + if (!Array.isArray(object.ignoredFacetValues)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.ignoredFacetValues: array expected"); + message.ignoredFacetValues = []; + for (var i = 0; i < object.ignoredFacetValues.length; ++i) { + if (typeof object.ignoredFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.ignoredFacetValues: object expected"); + message.ignoredFacetValues[i] = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.fromObject(object.ignoredFacetValues[i]); + } + } + if (object.mergedFacetValues) { + if (!Array.isArray(object.mergedFacetValues)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.mergedFacetValues: array expected"); + message.mergedFacetValues = []; + for (var i = 0; i < object.mergedFacetValues.length; ++i) { + if (typeof object.mergedFacetValues[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.mergedFacetValues: object expected"); + message.mergedFacetValues[i] = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.fromObject(object.mergedFacetValues[i]); + } + } + if (object.mergedFacet != null) { + if (typeof object.mergedFacet !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.mergedFacet: object expected"); + message.mergedFacet = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.fromObject(object.mergedFacet); + } + if (object.rerankConfig != null) { + if (typeof object.rerankConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.rerankConfig: object expected"); + message.rerankConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.fromObject(object.rerankConfig); + } + return message; + }; + + /** + * Creates a plain object from a FacetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig} message FacetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.facetIntervals = []; + object.ignoredFacetValues = []; + object.mergedFacetValues = []; + } + if (options.defaults) { + object.mergedFacet = null; + object.rerankConfig = null; + } + if (message.facetIntervals && message.facetIntervals.length) { + object.facetIntervals = []; + for (var j = 0; j < message.facetIntervals.length; ++j) + object.facetIntervals[j] = $root.google.cloud.retail.v2beta.Interval.toObject(message.facetIntervals[j], options); + } + if (message.ignoredFacetValues && message.ignoredFacetValues.length) { + object.ignoredFacetValues = []; + for (var j = 0; j < message.ignoredFacetValues.length; ++j) + object.ignoredFacetValues[j] = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.toObject(message.ignoredFacetValues[j], options); + } + if (message.mergedFacetValues && message.mergedFacetValues.length) { + object.mergedFacetValues = []; + for (var j = 0; j < message.mergedFacetValues.length; ++j) + object.mergedFacetValues[j] = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.toObject(message.mergedFacetValues[j], options); + } + if (message.mergedFacet != null && message.hasOwnProperty("mergedFacet")) + object.mergedFacet = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.toObject(message.mergedFacet, options); + if (message.rerankConfig != null && message.hasOwnProperty("rerankConfig")) + object.rerankConfig = $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.toObject(message.rerankConfig, options); + return object; + }; + + /** + * Converts this FacetConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @instance + * @returns {Object.} JSON object + */ + FacetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute.FacetConfig"; + }; + + FacetConfig.IgnoredFacetValues = (function() { + + /** + * Properties of an IgnoredFacetValues. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @interface IIgnoredFacetValues + * @property {Array.|null} [values] IgnoredFacetValues values + * @property {google.protobuf.ITimestamp|null} [startTime] IgnoredFacetValues startTime + * @property {google.protobuf.ITimestamp|null} [endTime] IgnoredFacetValues endTime + */ + + /** + * Constructs a new IgnoredFacetValues. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @classdesc Represents an IgnoredFacetValues. + * @implements IIgnoredFacetValues + * @constructor + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + */ + function IgnoredFacetValues(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]]; + } + + /** + * IgnoredFacetValues values. + * @member {Array.} values + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.values = $util.emptyArray; + + /** + * IgnoredFacetValues startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.startTime = null; + + /** + * IgnoredFacetValues endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + */ + IgnoredFacetValues.prototype.endTime = null; + + /** + * Creates a new IgnoredFacetValues instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues instance + */ + IgnoredFacetValues.create = function create(properties) { + return new IgnoredFacetValues(properties); + }; + + /** + * Encodes the specified IgnoredFacetValues message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IgnoredFacetValues message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IIgnoredFacetValues} message IgnoredFacetValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IgnoredFacetValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IgnoredFacetValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IgnoredFacetValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IgnoredFacetValues message. + * @function verify + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IgnoredFacetValues.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) + if (!$util.isString(message.values[i])) + return "values: string[] 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 IgnoredFacetValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues} IgnoredFacetValues + */ + IgnoredFacetValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues) + return object; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.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.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an IgnoredFacetValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues} message IgnoredFacetValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IgnoredFacetValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + 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 IgnoredFacetValues to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @instance + * @returns {Object.} JSON object + */ + IgnoredFacetValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IgnoredFacetValues + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IgnoredFacetValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IgnoredFacetValues"; + }; + + return IgnoredFacetValues; + })(); + + FacetConfig.MergedFacetValue = (function() { + + /** + * Properties of a MergedFacetValue. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @interface IMergedFacetValue + * @property {Array.|null} [values] MergedFacetValue values + * @property {string|null} [mergedValue] MergedFacetValue mergedValue + */ + + /** + * Constructs a new MergedFacetValue. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacetValue. + * @implements IMergedFacetValue + * @constructor + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + */ + function MergedFacetValue(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]]; + } + + /** + * MergedFacetValue values. + * @member {Array.} values + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.values = $util.emptyArray; + + /** + * MergedFacetValue mergedValue. + * @member {string} mergedValue + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + */ + MergedFacetValue.prototype.mergedValue = ""; + + /** + * Creates a new MergedFacetValue instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue instance + */ + MergedFacetValue.create = function create(properties) { + return new MergedFacetValue(properties); + }; + + /** + * Encodes the specified MergedFacetValue message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + if (message.mergedValue != null && Object.hasOwnProperty.call(message, "mergedValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mergedValue); + return writer; + }; + + /** + * Encodes the specified MergedFacetValue message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacetValue} message MergedFacetValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacetValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + case 2: { + message.mergedValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacetValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacetValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacetValue message. + * @function verify + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacetValue.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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + if (!$util.isString(message.mergedValue)) + return "mergedValue: string expected"; + return null; + }; + + /** + * Creates a MergedFacetValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue} MergedFacetValue + */ + MergedFacetValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue) + return object; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + if (object.mergedValue != null) + message.mergedValue = String(object.mergedValue); + return message; + }; + + /** + * Creates a plain object from a MergedFacetValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue} message MergedFacetValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacetValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) + object.mergedValue = ""; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + if (message.mergedValue != null && message.hasOwnProperty("mergedValue")) + object.mergedValue = message.mergedValue; + return object; + }; + + /** + * Converts this MergedFacetValue to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @instance + * @returns {Object.} JSON object + */ + MergedFacetValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacetValue + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacetValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacetValue"; + }; + + return MergedFacetValue; + })(); + + FacetConfig.MergedFacet = (function() { + + /** + * Properties of a MergedFacet. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @interface IMergedFacet + * @property {string|null} [mergedFacetKey] MergedFacet mergedFacetKey + */ + + /** + * Constructs a new MergedFacet. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @classdesc Represents a MergedFacet. + * @implements IMergedFacet + * @constructor + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + */ + function MergedFacet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergedFacet mergedFacetKey. + * @member {string} mergedFacetKey + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @instance + */ + MergedFacet.prototype.mergedFacetKey = ""; + + /** + * Creates a new MergedFacet instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet instance + */ + MergedFacet.create = function create(properties) { + return new MergedFacet(properties); + }; + + /** + * Encodes the specified MergedFacet message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mergedFacetKey != null && Object.hasOwnProperty.call(message, "mergedFacetKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mergedFacetKey); + return writer; + }; + + /** + * Encodes the specified MergedFacet message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IMergedFacet} message MergedFacet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergedFacet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mergedFacetKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergedFacet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergedFacet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergedFacet message. + * @function verify + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergedFacet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + if (!$util.isString(message.mergedFacetKey)) + return "mergedFacetKey: string expected"; + return null; + }; + + /** + * Creates a MergedFacet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet} MergedFacet + */ + MergedFacet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet) + return object; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet(); + if (object.mergedFacetKey != null) + message.mergedFacetKey = String(object.mergedFacetKey); + return message; + }; + + /** + * Creates a plain object from a MergedFacet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet} message MergedFacet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergedFacet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mergedFacetKey = ""; + if (message.mergedFacetKey != null && message.hasOwnProperty("mergedFacetKey")) + object.mergedFacetKey = message.mergedFacetKey; + return object; + }; + + /** + * Converts this MergedFacet to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @instance + * @returns {Object.} JSON object + */ + MergedFacet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MergedFacet + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergedFacet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.MergedFacet"; + }; + + return MergedFacet; + })(); + + FacetConfig.RerankConfig = (function() { + + /** + * Properties of a RerankConfig. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @interface IRerankConfig + * @property {boolean|null} [rerankFacet] RerankConfig rerankFacet + * @property {Array.|null} [facetValues] RerankConfig facetValues + */ + + /** + * Constructs a new RerankConfig. + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig + * @classdesc Represents a RerankConfig. + * @implements IRerankConfig + * @constructor + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + */ + function RerankConfig(properties) { + this.facetValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RerankConfig rerankFacet. + * @member {boolean} rerankFacet + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.rerankFacet = false; + + /** + * RerankConfig facetValues. + * @member {Array.} facetValues + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @instance + */ + RerankConfig.prototype.facetValues = $util.emptyArray; + + /** + * Creates a new RerankConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig instance + */ + RerankConfig.create = function create(properties) { + return new RerankConfig(properties); + }; + + /** + * Encodes the specified RerankConfig message. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rerankFacet != null && Object.hasOwnProperty.call(message, "rerankFacet")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.rerankFacet); + if (message.facetValues != null && message.facetValues.length) + for (var i = 0; i < message.facetValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.facetValues[i]); + return writer; + }; + + /** + * Encodes the specified RerankConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.IRerankConfig} message RerankConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RerankConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rerankFacet = reader.bool(); + break; + } + case 2: { + if (!(message.facetValues && message.facetValues.length)) + message.facetValues = []; + message.facetValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RerankConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RerankConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RerankConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RerankConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + if (typeof message.rerankFacet !== "boolean") + return "rerankFacet: boolean expected"; + if (message.facetValues != null && message.hasOwnProperty("facetValues")) { + if (!Array.isArray(message.facetValues)) + return "facetValues: array expected"; + for (var i = 0; i < message.facetValues.length; ++i) + if (!$util.isString(message.facetValues[i])) + return "facetValues: string[] expected"; + } + return null; + }; + + /** + * Creates a RerankConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig} RerankConfig + */ + RerankConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig(); + if (object.rerankFacet != null) + message.rerankFacet = Boolean(object.rerankFacet); + if (object.facetValues) { + if (!Array.isArray(object.facetValues)) + throw TypeError(".google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig.facetValues: array expected"); + message.facetValues = []; + for (var i = 0; i < object.facetValues.length; ++i) + message.facetValues[i] = String(object.facetValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a RerankConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig} message RerankConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RerankConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facetValues = []; + if (options.defaults) + object.rerankFacet = false; + if (message.rerankFacet != null && message.hasOwnProperty("rerankFacet")) + object.rerankFacet = message.rerankFacet; + if (message.facetValues && message.facetValues.length) { + object.facetValues = []; + for (var j = 0; j < message.facetValues.length; ++j) + object.facetValues[j] = message.facetValues[j]; + } + return object; + }; + + /** + * Converts this RerankConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @instance + * @returns {Object.} JSON object + */ + RerankConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RerankConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RerankConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.CatalogAttribute.FacetConfig.RerankConfig"; + }; + + return RerankConfig; + })(); + + return FacetConfig; + })(); + /** * AttributeType enum. * @name google.cloud.retail.v2beta.CatalogAttribute.AttributeType @@ -103953,6 +117924,7 @@ * @interface ICondition * @property {Array.|null} [queryTerms] Condition queryTerms * @property {Array.|null} [activeTimeRange] Condition activeTimeRange + * @property {Array.|null} [pageCategories] Condition pageCategories */ /** @@ -103966,6 +117938,7 @@ function Condition(properties) { this.queryTerms = []; this.activeTimeRange = []; + this.pageCategories = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -103988,6 +117961,14 @@ */ Condition.prototype.activeTimeRange = $util.emptyArray; + /** + * Condition pageCategories. + * @member {Array.} pageCategories + * @memberof google.cloud.retail.v2beta.Condition + * @instance + */ + Condition.prototype.pageCategories = $util.emptyArray; + /** * Creates a new Condition instance using the specified properties. * @function create @@ -104018,6 +117999,9 @@ if (message.activeTimeRange != null && message.activeTimeRange.length) for (var i = 0; i < message.activeTimeRange.length; ++i) $root.google.cloud.retail.v2beta.Condition.TimeRange.encode(message.activeTimeRange[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageCategories != null && message.pageCategories.length) + for (var i = 0; i < message.pageCategories.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageCategories[i]); return writer; }; @@ -104064,6 +118048,12 @@ message.activeTimeRange.push($root.google.cloud.retail.v2beta.Condition.TimeRange.decode(reader, reader.uint32())); break; } + case 4: { + if (!(message.pageCategories && message.pageCategories.length)) + message.pageCategories = []; + message.pageCategories.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -104117,6 +118107,13 @@ return "activeTimeRange." + error; } } + if (message.pageCategories != null && message.hasOwnProperty("pageCategories")) { + if (!Array.isArray(message.pageCategories)) + return "pageCategories: array expected"; + for (var i = 0; i < message.pageCategories.length; ++i) + if (!$util.isString(message.pageCategories[i])) + return "pageCategories: string[] expected"; + } return null; }; @@ -104152,6 +118149,13 @@ message.activeTimeRange[i] = $root.google.cloud.retail.v2beta.Condition.TimeRange.fromObject(object.activeTimeRange[i]); } } + if (object.pageCategories) { + if (!Array.isArray(object.pageCategories)) + throw TypeError(".google.cloud.retail.v2beta.Condition.pageCategories: array expected"); + message.pageCategories = []; + for (var i = 0; i < object.pageCategories.length; ++i) + message.pageCategories[i] = String(object.pageCategories[i]); + } return message; }; @@ -104171,6 +118175,7 @@ if (options.arrays || options.defaults) { object.queryTerms = []; object.activeTimeRange = []; + object.pageCategories = []; } if (message.queryTerms && message.queryTerms.length) { object.queryTerms = []; @@ -104182,6 +118187,11 @@ for (var j = 0; j < message.activeTimeRange.length; ++j) object.activeTimeRange[j] = $root.google.cloud.retail.v2beta.Condition.TimeRange.toObject(message.activeTimeRange[j], options); } + if (message.pageCategories && message.pageCategories.length) { + object.pageCategories = []; + for (var j = 0; j < message.pageCategories.length; ++j) + object.pageCategories[j] = message.pageCategories[j]; + } return object; }; @@ -104692,6 +118702,8 @@ * @property {google.cloud.retail.v2beta.Rule.IIgnoreAction|null} [ignoreAction] Rule ignoreAction * @property {google.cloud.retail.v2beta.Rule.IFilterAction|null} [filterAction] Rule filterAction * @property {google.cloud.retail.v2beta.Rule.ITwowaySynonymsAction|null} [twowaySynonymsAction] Rule twowaySynonymsAction + * @property {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction|null} [forceReturnFacetAction] Rule forceReturnFacetAction + * @property {google.cloud.retail.v2beta.Rule.IRemoveFacetAction|null} [removeFacetAction] Rule removeFacetAction * @property {google.cloud.retail.v2beta.ICondition|null} [condition] Rule condition */ @@ -104774,6 +118786,22 @@ */ Rule.prototype.twowaySynonymsAction = null; + /** + * Rule forceReturnFacetAction. + * @member {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction|null|undefined} forceReturnFacetAction + * @memberof google.cloud.retail.v2beta.Rule + * @instance + */ + Rule.prototype.forceReturnFacetAction = null; + + /** + * Rule removeFacetAction. + * @member {google.cloud.retail.v2beta.Rule.IRemoveFacetAction|null|undefined} removeFacetAction + * @memberof google.cloud.retail.v2beta.Rule + * @instance + */ + Rule.prototype.removeFacetAction = null; + /** * Rule condition. * @member {google.cloud.retail.v2beta.ICondition|null|undefined} condition @@ -104787,12 +118815,12 @@ /** * Rule action. - * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|undefined} action + * @member {"boostAction"|"redirectAction"|"onewaySynonymsAction"|"doNotAssociateAction"|"replacementAction"|"ignoreAction"|"filterAction"|"twowaySynonymsAction"|"forceReturnFacetAction"|"removeFacetAction"|undefined} action * @memberof google.cloud.retail.v2beta.Rule * @instance */ Object.defineProperty(Rule.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction"]), + get: $util.oneOfGetter($oneOfFields = ["boostAction", "redirectAction", "onewaySynonymsAction", "doNotAssociateAction", "replacementAction", "ignoreAction", "filterAction", "twowaySynonymsAction", "forceReturnFacetAction", "removeFacetAction"]), set: $util.oneOfSetter($oneOfFields) }); @@ -104838,6 +118866,10 @@ $root.google.cloud.retail.v2beta.Rule.FilterAction.encode(message.filterAction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.twowaySynonymsAction != null && Object.hasOwnProperty.call(message, "twowaySynonymsAction")) $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.encode(message.twowaySynonymsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.forceReturnFacetAction != null && Object.hasOwnProperty.call(message, "forceReturnFacetAction")) + $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.encode(message.forceReturnFacetAction, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.removeFacetAction != null && Object.hasOwnProperty.call(message, "removeFacetAction")) + $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction.encode(message.removeFacetAction, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -104904,6 +118936,14 @@ message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.decode(reader, reader.uint32()); break; } + case 12: { + message.forceReturnFacetAction = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.decode(reader, reader.uint32()); + break; + } + case 13: { + message.removeFacetAction = $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction.decode(reader, reader.uint32()); + break; + } case 1: { message.condition = $root.google.cloud.retail.v2beta.Condition.decode(reader, reader.uint32()); break; @@ -105022,6 +119062,26 @@ return "twowaySynonymsAction." + error; } } + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.verify(message.forceReturnFacetAction); + if (error) + return "forceReturnFacetAction." + error; + } + } + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction.verify(message.removeFacetAction); + if (error) + return "removeFacetAction." + error; + } + } if (message.condition != null && message.hasOwnProperty("condition")) { var error = $root.google.cloud.retail.v2beta.Condition.verify(message.condition); if (error) @@ -105082,6 +119142,16 @@ throw TypeError(".google.cloud.retail.v2beta.Rule.twowaySynonymsAction: object expected"); message.twowaySynonymsAction = $root.google.cloud.retail.v2beta.Rule.TwowaySynonymsAction.fromObject(object.twowaySynonymsAction); } + if (object.forceReturnFacetAction != null) { + if (typeof object.forceReturnFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.forceReturnFacetAction: object expected"); + message.forceReturnFacetAction = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.fromObject(object.forceReturnFacetAction); + } + if (object.removeFacetAction != null) { + if (typeof object.removeFacetAction !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.removeFacetAction: object expected"); + message.removeFacetAction = $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction.fromObject(object.removeFacetAction); + } if (object.condition != null) { if (typeof object.condition !== "object") throw TypeError(".google.cloud.retail.v2beta.Rule.condition: object expected"); @@ -105147,6 +119217,16 @@ if (options.oneofs) object.action = "twowaySynonymsAction"; } + if (message.forceReturnFacetAction != null && message.hasOwnProperty("forceReturnFacetAction")) { + object.forceReturnFacetAction = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.toObject(message.forceReturnFacetAction, options); + if (options.oneofs) + object.action = "forceReturnFacetAction"; + } + if (message.removeFacetAction != null && message.hasOwnProperty("removeFacetAction")) { + object.removeFacetAction = $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction.toObject(message.removeFacetAction, options); + if (options.oneofs) + object.action = "removeFacetAction"; + } return object; }; @@ -107110,6 +121190,676 @@ return IgnoreAction; })(); + Rule.ForceReturnFacetAction = (function() { + + /** + * Properties of a ForceReturnFacetAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IForceReturnFacetAction + * @property {Array.|null} [facetPositionAdjustments] ForceReturnFacetAction facetPositionAdjustments + */ + + /** + * Constructs a new ForceReturnFacetAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a ForceReturnFacetAction. + * @implements IForceReturnFacetAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction=} [properties] Properties to set + */ + function ForceReturnFacetAction(properties) { + this.facetPositionAdjustments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForceReturnFacetAction facetPositionAdjustments. + * @member {Array.} facetPositionAdjustments + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @instance + */ + ForceReturnFacetAction.prototype.facetPositionAdjustments = $util.emptyArray; + + /** + * Creates a new ForceReturnFacetAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction} ForceReturnFacetAction instance + */ + ForceReturnFacetAction.create = function create(properties) { + return new ForceReturnFacetAction(properties); + }; + + /** + * Encodes the specified ForceReturnFacetAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceReturnFacetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.facetPositionAdjustments != null && message.facetPositionAdjustments.length) + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) + $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.encode(message.facetPositionAdjustments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ForceReturnFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IForceReturnFacetAction} message ForceReturnFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceReturnFacetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction} ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceReturnFacetAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.facetPositionAdjustments && message.facetPositionAdjustments.length)) + message.facetPositionAdjustments = []; + message.facetPositionAdjustments.push($root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForceReturnFacetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction} ForceReturnFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceReturnFacetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForceReturnFacetAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForceReturnFacetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.facetPositionAdjustments != null && message.hasOwnProperty("facetPositionAdjustments")) { + if (!Array.isArray(message.facetPositionAdjustments)) + return "facetPositionAdjustments: array expected"; + for (var i = 0; i < message.facetPositionAdjustments.length; ++i) { + var error = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify(message.facetPositionAdjustments[i]); + if (error) + return "facetPositionAdjustments." + error; + } + } + return null; + }; + + /** + * Creates a ForceReturnFacetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction} ForceReturnFacetAction + */ + ForceReturnFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction(); + if (object.facetPositionAdjustments) { + if (!Array.isArray(object.facetPositionAdjustments)) + throw TypeError(".google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.facetPositionAdjustments: array expected"); + message.facetPositionAdjustments = []; + for (var i = 0; i < object.facetPositionAdjustments.length; ++i) { + if (typeof object.facetPositionAdjustments[i] !== "object") + throw TypeError(".google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.facetPositionAdjustments: object expected"); + message.facetPositionAdjustments[i] = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.fromObject(object.facetPositionAdjustments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ForceReturnFacetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction} message ForceReturnFacetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForceReturnFacetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facetPositionAdjustments = []; + if (message.facetPositionAdjustments && message.facetPositionAdjustments.length) { + object.facetPositionAdjustments = []; + for (var j = 0; j < message.facetPositionAdjustments.length; ++j) + object.facetPositionAdjustments[j] = $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.toObject(message.facetPositionAdjustments[j], options); + } + return object; + }; + + /** + * Converts this ForceReturnFacetAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @instance + * @returns {Object.} JSON object + */ + ForceReturnFacetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForceReturnFacetAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceReturnFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.Rule.ForceReturnFacetAction"; + }; + + ForceReturnFacetAction.FacetPositionAdjustment = (function() { + + /** + * Properties of a FacetPositionAdjustment. + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @interface IFacetPositionAdjustment + * @property {string|null} [attributeName] FacetPositionAdjustment attributeName + * @property {number|null} [position] FacetPositionAdjustment position + */ + + /** + * Constructs a new FacetPositionAdjustment. + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction + * @classdesc Represents a FacetPositionAdjustment. + * @implements IFacetPositionAdjustment + * @constructor + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + */ + function FacetPositionAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FacetPositionAdjustment attributeName. + * @member {string} attributeName + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.attributeName = ""; + + /** + * FacetPositionAdjustment position. + * @member {number} position + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + */ + FacetPositionAdjustment.prototype.position = 0; + + /** + * Creates a new FacetPositionAdjustment instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment instance + */ + FacetPositionAdjustment.create = function create(properties) { + return new FacetPositionAdjustment(properties); + }; + + /** + * Encodes the specified FacetPositionAdjustment message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeName != null && Object.hasOwnProperty.call(message, "attributeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeName); + if (message.position != null && Object.hasOwnProperty.call(message, "position")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.position); + return writer; + }; + + /** + * Encodes the specified FacetPositionAdjustment message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.IFacetPositionAdjustment} message FacetPositionAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FacetPositionAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attributeName = reader.string(); + break; + } + case 2: { + message.position = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FacetPositionAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FacetPositionAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FacetPositionAdjustment message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FacetPositionAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + if (!$util.isString(message.attributeName)) + return "attributeName: string expected"; + if (message.position != null && message.hasOwnProperty("position")) + if (!$util.isInteger(message.position)) + return "position: integer expected"; + return null; + }; + + /** + * Creates a FacetPositionAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment} FacetPositionAdjustment + */ + FacetPositionAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment(); + if (object.attributeName != null) + message.attributeName = String(object.attributeName); + if (object.position != null) + message.position = object.position | 0; + return message; + }; + + /** + * Creates a plain object from a FacetPositionAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment} message FacetPositionAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FacetPositionAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attributeName = ""; + object.position = 0; + } + if (message.attributeName != null && message.hasOwnProperty("attributeName")) + object.attributeName = message.attributeName; + if (message.position != null && message.hasOwnProperty("position")) + object.position = message.position; + return object; + }; + + /** + * Converts this FacetPositionAdjustment to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @instance + * @returns {Object.} JSON object + */ + FacetPositionAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FacetPositionAdjustment + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FacetPositionAdjustment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.Rule.ForceReturnFacetAction.FacetPositionAdjustment"; + }; + + return FacetPositionAdjustment; + })(); + + return ForceReturnFacetAction; + })(); + + Rule.RemoveFacetAction = (function() { + + /** + * Properties of a RemoveFacetAction. + * @memberof google.cloud.retail.v2beta.Rule + * @interface IRemoveFacetAction + * @property {Array.|null} [attributeNames] RemoveFacetAction attributeNames + */ + + /** + * Constructs a new RemoveFacetAction. + * @memberof google.cloud.retail.v2beta.Rule + * @classdesc Represents a RemoveFacetAction. + * @implements IRemoveFacetAction + * @constructor + * @param {google.cloud.retail.v2beta.Rule.IRemoveFacetAction=} [properties] Properties to set + */ + function RemoveFacetAction(properties) { + this.attributeNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveFacetAction attributeNames. + * @member {Array.} attributeNames + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @instance + */ + RemoveFacetAction.prototype.attributeNames = $util.emptyArray; + + /** + * Creates a new RemoveFacetAction instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRemoveFacetAction=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Rule.RemoveFacetAction} RemoveFacetAction instance + */ + RemoveFacetAction.create = function create(properties) { + return new RemoveFacetAction(properties); + }; + + /** + * Encodes the specified RemoveFacetAction message. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RemoveFacetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFacetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributeNames != null && message.attributeNames.length) + for (var i = 0; i < message.attributeNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attributeNames[i]); + return writer; + }; + + /** + * Encodes the specified RemoveFacetAction message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Rule.RemoveFacetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.IRemoveFacetAction} message RemoveFacetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveFacetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Rule.RemoveFacetAction} RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFacetAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.attributeNames && message.attributeNames.length)) + message.attributeNames = []; + message.attributeNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveFacetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Rule.RemoveFacetAction} RemoveFacetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveFacetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveFacetAction message. + * @function verify + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveFacetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributeNames != null && message.hasOwnProperty("attributeNames")) { + if (!Array.isArray(message.attributeNames)) + return "attributeNames: array expected"; + for (var i = 0; i < message.attributeNames.length; ++i) + if (!$util.isString(message.attributeNames[i])) + return "attributeNames: string[] expected"; + } + return null; + }; + + /** + * Creates a RemoveFacetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Rule.RemoveFacetAction} RemoveFacetAction + */ + RemoveFacetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction) + return object; + var message = new $root.google.cloud.retail.v2beta.Rule.RemoveFacetAction(); + if (object.attributeNames) { + if (!Array.isArray(object.attributeNames)) + throw TypeError(".google.cloud.retail.v2beta.Rule.RemoveFacetAction.attributeNames: array expected"); + message.attributeNames = []; + for (var i = 0; i < object.attributeNames.length; ++i) + message.attributeNames[i] = String(object.attributeNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a RemoveFacetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {google.cloud.retail.v2beta.Rule.RemoveFacetAction} message RemoveFacetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveFacetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attributeNames = []; + if (message.attributeNames && message.attributeNames.length) { + object.attributeNames = []; + for (var j = 0; j < message.attributeNames.length; ++j) + object.attributeNames[j] = message.attributeNames[j]; + } + return object; + }; + + /** + * Converts this RemoveFacetAction to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @instance + * @returns {Object.} JSON object + */ + RemoveFacetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveFacetAction + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.Rule.RemoveFacetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveFacetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.Rule.RemoveFacetAction"; + }; + + return RemoveFacetAction; + })(); + return Rule; })(); @@ -121927,6 +136677,7 @@ * @property {string|null} [deviceType] CompleteQueryRequest deviceType * @property {string|null} [dataset] CompleteQueryRequest dataset * @property {number|null} [maxSuggestions] CompleteQueryRequest maxSuggestions + * @property {boolean|null} [enableAttributeSuggestions] CompleteQueryRequest enableAttributeSuggestions * @property {string|null} [entity] CompleteQueryRequest entity */ @@ -122002,6 +136753,14 @@ */ CompleteQueryRequest.prototype.maxSuggestions = 0; + /** + * CompleteQueryRequest enableAttributeSuggestions. + * @member {boolean} enableAttributeSuggestions + * @memberof google.cloud.retail.v2beta.CompleteQueryRequest + * @instance + */ + CompleteQueryRequest.prototype.enableAttributeSuggestions = false; + /** * CompleteQueryRequest entity. * @member {string} entity @@ -122049,6 +136808,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataset); if (message.visitorId != null && Object.hasOwnProperty.call(message, "visitorId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.visitorId); + if (message.enableAttributeSuggestions != null && Object.hasOwnProperty.call(message, "enableAttributeSuggestions")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableAttributeSuggestions); if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.entity); return writer; @@ -122115,6 +136876,10 @@ message.maxSuggestions = reader.int32(); break; } + case 9: { + message.enableAttributeSuggestions = reader.bool(); + break; + } case 10: { message.entity = reader.string(); break; @@ -122179,6 +136944,9 @@ if (message.maxSuggestions != null && message.hasOwnProperty("maxSuggestions")) if (!$util.isInteger(message.maxSuggestions)) return "maxSuggestions: integer expected"; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + if (typeof message.enableAttributeSuggestions !== "boolean") + return "enableAttributeSuggestions: boolean expected"; if (message.entity != null && message.hasOwnProperty("entity")) if (!$util.isString(message.entity)) return "entity: string expected"; @@ -122216,6 +136984,8 @@ message.dataset = String(object.dataset); if (object.maxSuggestions != null) message.maxSuggestions = object.maxSuggestions | 0; + if (object.enableAttributeSuggestions != null) + message.enableAttributeSuggestions = Boolean(object.enableAttributeSuggestions); if (object.entity != null) message.entity = String(object.entity); return message; @@ -122243,6 +137013,7 @@ object.maxSuggestions = 0; object.dataset = ""; object.visitorId = ""; + object.enableAttributeSuggestions = false; object.entity = ""; } if (message.catalog != null && message.hasOwnProperty("catalog")) @@ -122262,6 +137033,8 @@ object.dataset = message.dataset; if (message.visitorId != null && message.hasOwnProperty("visitorId")) object.visitorId = message.visitorId; + if (message.enableAttributeSuggestions != null && message.hasOwnProperty("enableAttributeSuggestions")) + object.enableAttributeSuggestions = message.enableAttributeSuggestions; if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; return object; @@ -130671,6 +145444,7 @@ * @property {google.cloud.retail.v2beta.Model.DataState|null} [dataState] Model dataState * @property {google.cloud.retail.v2beta.RecommendationsFilteringOption|null} [filteringOption] Model filteringOption * @property {Array.|null} [servingConfigLists] Model servingConfigLists + * @property {google.cloud.retail.v2beta.Model.IModelFeaturesConfig|null} [modelFeaturesConfig] Model modelFeaturesConfig */ /** @@ -130801,6 +145575,14 @@ */ Model.prototype.servingConfigLists = $util.emptyArray; + /** + * Model modelFeaturesConfig. + * @member {google.cloud.retail.v2beta.Model.IModelFeaturesConfig|null|undefined} modelFeaturesConfig + * @memberof google.cloud.retail.v2beta.Model + * @instance + */ + Model.prototype.modelFeaturesConfig = null; + /** * Creates a new Model instance using the specified properties. * @function create @@ -130854,6 +145636,8 @@ if (message.servingConfigLists != null && message.servingConfigLists.length) for (var i = 0; i < message.servingConfigLists.length; ++i) $root.google.cloud.retail.v2beta.Model.ServingConfigList.encode(message.servingConfigLists[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.modelFeaturesConfig != null && Object.hasOwnProperty.call(message, "modelFeaturesConfig")) + $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig.encode(message.modelFeaturesConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; @@ -130946,6 +145730,10 @@ message.servingConfigLists.push($root.google.cloud.retail.v2beta.Model.ServingConfigList.decode(reader, reader.uint32())); break; } + case 22: { + message.modelFeaturesConfig = $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -131067,6 +145855,11 @@ return "servingConfigLists." + error; } } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) { + var error = $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig.verify(message.modelFeaturesConfig); + if (error) + return "modelFeaturesConfig." + error; + } return null; }; @@ -131225,6 +146018,11 @@ message.servingConfigLists[i] = $root.google.cloud.retail.v2beta.Model.ServingConfigList.fromObject(object.servingConfigLists[i]); } } + if (object.modelFeaturesConfig != null) { + if (typeof object.modelFeaturesConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.Model.modelFeaturesConfig: object expected"); + message.modelFeaturesConfig = $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig.fromObject(object.modelFeaturesConfig); + } return message; }; @@ -131257,6 +146055,7 @@ object.tuningOperation = ""; object.dataState = options.enums === String ? "DATA_STATE_UNSPECIFIED" : 0; object.filteringOption = options.enums === String ? "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED" : 0; + object.modelFeaturesConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -131289,6 +146088,8 @@ for (var j = 0; j < message.servingConfigLists.length; ++j) object.servingConfigLists[j] = $root.google.cloud.retail.v2beta.Model.ServingConfigList.toObject(message.servingConfigLists[j], options); } + if (message.modelFeaturesConfig != null && message.hasOwnProperty("modelFeaturesConfig")) + object.modelFeaturesConfig = $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig.toObject(message.modelFeaturesConfig, options); return object; }; @@ -131537,6 +146338,460 @@ return ServingConfigList; })(); + Model.FrequentlyBoughtTogetherFeaturesConfig = (function() { + + /** + * Properties of a FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2beta.Model + * @interface IFrequentlyBoughtTogetherFeaturesConfig + * @property {google.cloud.retail.v2beta.Model.ContextProductsType|null} [contextProductsType] FrequentlyBoughtTogetherFeaturesConfig contextProductsType + */ + + /** + * Constructs a new FrequentlyBoughtTogetherFeaturesConfig. + * @memberof google.cloud.retail.v2beta.Model + * @classdesc Represents a FrequentlyBoughtTogetherFeaturesConfig. + * @implements IFrequentlyBoughtTogetherFeaturesConfig + * @constructor + * @param {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + */ + function FrequentlyBoughtTogetherFeaturesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FrequentlyBoughtTogetherFeaturesConfig contextProductsType. + * @member {google.cloud.retail.v2beta.Model.ContextProductsType} contextProductsType + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.contextProductsType = 0; + + /** + * Creates a new FrequentlyBoughtTogetherFeaturesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig instance + */ + FrequentlyBoughtTogetherFeaturesConfig.create = function create(properties) { + return new FrequentlyBoughtTogetherFeaturesConfig(properties); + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contextProductsType != null && Object.hasOwnProperty.call(message, "contextProductsType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.contextProductsType); + return writer; + }; + + /** + * Encodes the specified FrequentlyBoughtTogetherFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FrequentlyBoughtTogetherFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.contextProductsType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FrequentlyBoughtTogetherFeaturesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FrequentlyBoughtTogetherFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FrequentlyBoughtTogetherFeaturesConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FrequentlyBoughtTogetherFeaturesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + switch (message.contextProductsType) { + default: + return "contextProductsType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FrequentlyBoughtTogetherFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig} FrequentlyBoughtTogetherFeaturesConfig + */ + FrequentlyBoughtTogetherFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig(); + switch (object.contextProductsType) { + default: + if (typeof object.contextProductsType === "number") { + message.contextProductsType = object.contextProductsType; + break; + } + break; + case "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": + case 0: + message.contextProductsType = 0; + break; + case "SINGLE_CONTEXT_PRODUCT": + case 1: + message.contextProductsType = 1; + break; + case "MULTIPLE_CONTEXT_PRODUCTS": + case 2: + message.contextProductsType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FrequentlyBoughtTogetherFeaturesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig} message FrequentlyBoughtTogetherFeaturesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FrequentlyBoughtTogetherFeaturesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.contextProductsType = options.enums === String ? "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED" : 0; + if (message.contextProductsType != null && message.hasOwnProperty("contextProductsType")) + object.contextProductsType = options.enums === String ? $root.google.cloud.retail.v2beta.Model.ContextProductsType[message.contextProductsType] === undefined ? message.contextProductsType : $root.google.cloud.retail.v2beta.Model.ContextProductsType[message.contextProductsType] : message.contextProductsType; + return object; + }; + + /** + * Converts this FrequentlyBoughtTogetherFeaturesConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @instance + * @returns {Object.} JSON object + */ + FrequentlyBoughtTogetherFeaturesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FrequentlyBoughtTogetherFeaturesConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FrequentlyBoughtTogetherFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig"; + }; + + return FrequentlyBoughtTogetherFeaturesConfig; + })(); + + Model.ModelFeaturesConfig = (function() { + + /** + * Properties of a ModelFeaturesConfig. + * @memberof google.cloud.retail.v2beta.Model + * @interface IModelFeaturesConfig + * @property {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig|null} [frequentlyBoughtTogetherConfig] ModelFeaturesConfig frequentlyBoughtTogetherConfig + */ + + /** + * Constructs a new ModelFeaturesConfig. + * @memberof google.cloud.retail.v2beta.Model + * @classdesc Represents a ModelFeaturesConfig. + * @implements IModelFeaturesConfig + * @constructor + * @param {google.cloud.retail.v2beta.Model.IModelFeaturesConfig=} [properties] Properties to set + */ + function ModelFeaturesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelFeaturesConfig frequentlyBoughtTogetherConfig. + * @member {google.cloud.retail.v2beta.Model.IFrequentlyBoughtTogetherFeaturesConfig|null|undefined} frequentlyBoughtTogetherConfig + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @instance + */ + ModelFeaturesConfig.prototype.frequentlyBoughtTogetherConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelFeaturesConfig typeDedicatedConfig. + * @member {"frequentlyBoughtTogetherConfig"|undefined} typeDedicatedConfig + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @instance + */ + Object.defineProperty(ModelFeaturesConfig.prototype, "typeDedicatedConfig", { + get: $util.oneOfGetter($oneOfFields = ["frequentlyBoughtTogetherConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelFeaturesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IModelFeaturesConfig=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.Model.ModelFeaturesConfig} ModelFeaturesConfig instance + */ + ModelFeaturesConfig.create = function create(properties) { + return new ModelFeaturesConfig(properties); + }; + + /** + * Encodes the specified ModelFeaturesConfig message. Does not implicitly {@link google.cloud.retail.v2beta.Model.ModelFeaturesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeaturesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.frequentlyBoughtTogetherConfig != null && Object.hasOwnProperty.call(message, "frequentlyBoughtTogetherConfig")) + $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.encode(message.frequentlyBoughtTogetherConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelFeaturesConfig message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.Model.ModelFeaturesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.IModelFeaturesConfig} message ModelFeaturesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelFeaturesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.Model.ModelFeaturesConfig} ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeaturesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelFeaturesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.Model.ModelFeaturesConfig} ModelFeaturesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelFeaturesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelFeaturesConfig message. + * @function verify + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelFeaturesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + properties.typeDedicatedConfig = 1; + { + var error = $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.verify(message.frequentlyBoughtTogetherConfig); + if (error) + return "frequentlyBoughtTogetherConfig." + error; + } + } + return null; + }; + + /** + * Creates a ModelFeaturesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.Model.ModelFeaturesConfig} ModelFeaturesConfig + */ + ModelFeaturesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig) + return object; + var message = new $root.google.cloud.retail.v2beta.Model.ModelFeaturesConfig(); + if (object.frequentlyBoughtTogetherConfig != null) { + if (typeof object.frequentlyBoughtTogetherConfig !== "object") + throw TypeError(".google.cloud.retail.v2beta.Model.ModelFeaturesConfig.frequentlyBoughtTogetherConfig: object expected"); + message.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.fromObject(object.frequentlyBoughtTogetherConfig); + } + return message; + }; + + /** + * Creates a plain object from a ModelFeaturesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {google.cloud.retail.v2beta.Model.ModelFeaturesConfig} message ModelFeaturesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelFeaturesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.frequentlyBoughtTogetherConfig != null && message.hasOwnProperty("frequentlyBoughtTogetherConfig")) { + object.frequentlyBoughtTogetherConfig = $root.google.cloud.retail.v2beta.Model.FrequentlyBoughtTogetherFeaturesConfig.toObject(message.frequentlyBoughtTogetherConfig, options); + if (options.oneofs) + object.typeDedicatedConfig = "frequentlyBoughtTogetherConfig"; + } + return object; + }; + + /** + * Converts this ModelFeaturesConfig to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @instance + * @returns {Object.} JSON object + */ + ModelFeaturesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelFeaturesConfig + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.Model.ModelFeaturesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelFeaturesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.Model.ModelFeaturesConfig"; + }; + + return ModelFeaturesConfig; + })(); + /** * ServingState enum. * @name google.cloud.retail.v2beta.Model.ServingState @@ -131605,6 +146860,22 @@ return values; })(); + /** + * ContextProductsType enum. + * @name google.cloud.retail.v2beta.Model.ContextProductsType + * @enum {number} + * @property {number} CONTEXT_PRODUCTS_TYPE_UNSPECIFIED=0 CONTEXT_PRODUCTS_TYPE_UNSPECIFIED value + * @property {number} SINGLE_CONTEXT_PRODUCT=1 SINGLE_CONTEXT_PRODUCT value + * @property {number} MULTIPLE_CONTEXT_PRODUCTS=2 MULTIPLE_CONTEXT_PRODUCTS value + */ + Model.ContextProductsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SINGLE_CONTEXT_PRODUCT"] = 1; + values[valuesById[2] = "MULTIPLE_CONTEXT_PRODUCTS"] = 2; + return values; + })(); + return Model; })(); @@ -135787,6 +151058,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.retail.v2beta.ProductService|purgeProducts}. + * @memberof google.cloud.retail.v2beta.ProductService + * @typedef PurgeProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @param {google.cloud.retail.v2beta.ProductService.PurgeProductsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProductService.prototype.purgeProducts = function purgeProducts(request, callback) { + return this.rpcCall(purgeProducts, $root.google.cloud.retail.v2beta.PurgeProductsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PurgeProducts" }); + + /** + * Calls PurgeProducts. + * @function purgeProducts + * @memberof google.cloud.retail.v2beta.ProductService + * @instance + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest} request PurgeProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.retail.v2beta.ProductService|importProducts}. * @memberof google.cloud.retail.v2beta.ProductService @@ -140930,6 +156234,824 @@ return PurgeMetadata; })(); + v2beta.PurgeProductsMetadata = (function() { + + /** + * Properties of a PurgeProductsMetadata. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeProductsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] PurgeProductsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PurgeProductsMetadata updateTime + * @property {number|Long|null} [successCount] PurgeProductsMetadata successCount + * @property {number|Long|null} [failureCount] PurgeProductsMetadata failureCount + */ + + /** + * Constructs a new PurgeProductsMetadata. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeProductsMetadata. + * @implements IPurgeProductsMetadata + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeProductsMetadata=} [properties] Properties to set + */ + function PurgeProductsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeProductsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.createTime = null; + + /** + * PurgeProductsMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.updateTime = null; + + /** + * PurgeProductsMetadata successCount. + * @member {number|Long} successCount + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.successCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsMetadata failureCount. + * @member {number|Long} failureCount + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @instance + */ + PurgeProductsMetadata.prototype.failureCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PurgeProductsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsMetadata=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeProductsMetadata} PurgeProductsMetadata instance + */ + PurgeProductsMetadata.create = function create(properties) { + return new PurgeProductsMetadata(properties); + }; + + /** + * Encodes the specified PurgeProductsMetadata message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.successCount != null && Object.hasOwnProperty.call(message, "successCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.successCount); + if (message.failureCount != null && Object.hasOwnProperty.call(message, "failureCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.failureCount); + return writer; + }; + + /** + * Encodes the specified PurgeProductsMetadata message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsMetadata} message PurgeProductsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeProductsMetadata} PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PurgeProductsMetadata(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.successCount = reader.int64(); + break; + } + case 4: { + message.failureCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeProductsMetadata} PurgeProductsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsMetadata message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsMetadata.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (!$util.isInteger(message.successCount) && !(message.successCount && $util.isInteger(message.successCount.low) && $util.isInteger(message.successCount.high))) + return "successCount: integer|Long expected"; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (!$util.isInteger(message.failureCount) && !(message.failureCount && $util.isInteger(message.failureCount.low) && $util.isInteger(message.failureCount.high))) + return "failureCount: integer|Long expected"; + return null; + }; + + /** + * Creates a PurgeProductsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeProductsMetadata} PurgeProductsMetadata + */ + PurgeProductsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeProductsMetadata) + return object; + var message = new $root.google.cloud.retail.v2beta.PurgeProductsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.retail.v2beta.PurgeProductsMetadata.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.retail.v2beta.PurgeProductsMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.successCount != null) + if ($util.Long) + (message.successCount = $util.Long.fromValue(object.successCount)).unsigned = false; + else if (typeof object.successCount === "string") + message.successCount = parseInt(object.successCount, 10); + else if (typeof object.successCount === "number") + message.successCount = object.successCount; + else if (typeof object.successCount === "object") + message.successCount = new $util.LongBits(object.successCount.low >>> 0, object.successCount.high >>> 0).toNumber(); + if (object.failureCount != null) + if ($util.Long) + (message.failureCount = $util.Long.fromValue(object.failureCount)).unsigned = false; + else if (typeof object.failureCount === "string") + message.failureCount = parseInt(object.failureCount, 10); + else if (typeof object.failureCount === "number") + message.failureCount = object.failureCount; + else if (typeof object.failureCount === "object") + message.failureCount = new $util.LongBits(object.failureCount.low >>> 0, object.failureCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PurgeProductsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {google.cloud.retail.v2beta.PurgeProductsMetadata} message PurgeProductsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.successCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.successCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failureCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failureCount = options.longs === String ? "0" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.successCount != null && message.hasOwnProperty("successCount")) + if (typeof message.successCount === "number") + object.successCount = options.longs === String ? String(message.successCount) : message.successCount; + else + object.successCount = options.longs === String ? $util.Long.prototype.toString.call(message.successCount) : options.longs === Number ? new $util.LongBits(message.successCount.low >>> 0, message.successCount.high >>> 0).toNumber() : message.successCount; + if (message.failureCount != null && message.hasOwnProperty("failureCount")) + if (typeof message.failureCount === "number") + object.failureCount = options.longs === String ? String(message.failureCount) : message.failureCount; + else + object.failureCount = options.longs === String ? $util.Long.prototype.toString.call(message.failureCount) : options.longs === Number ? new $util.LongBits(message.failureCount.low >>> 0, message.failureCount.high >>> 0).toNumber() : message.failureCount; + return object; + }; + + /** + * Converts this PurgeProductsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsMetadata + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.PurgeProductsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.PurgeProductsMetadata"; + }; + + return PurgeProductsMetadata; + })(); + + v2beta.PurgeProductsRequest = (function() { + + /** + * Properties of a PurgeProductsRequest. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeProductsRequest + * @property {string|null} [parent] PurgeProductsRequest parent + * @property {string|null} [filter] PurgeProductsRequest filter + * @property {boolean|null} [force] PurgeProductsRequest force + */ + + /** + * Constructs a new PurgeProductsRequest. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeProductsRequest. + * @implements IPurgeProductsRequest + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest=} [properties] Properties to set + */ + function PurgeProductsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeProductsRequest parent. + * @member {string} parent + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.parent = ""; + + /** + * PurgeProductsRequest filter. + * @member {string} filter + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.filter = ""; + + /** + * PurgeProductsRequest force. + * @member {boolean} force + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @instance + */ + PurgeProductsRequest.prototype.force = false; + + /** + * Creates a new PurgeProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeProductsRequest} PurgeProductsRequest instance + */ + PurgeProductsRequest.create = function create(properties) { + return new PurgeProductsRequest(properties); + }; + + /** + * Encodes the specified PurgeProductsRequest message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsRequest.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 2, wireType 2 =*/18).string(message.filter); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified PurgeProductsRequest message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsRequest} message PurgeProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeProductsRequest} PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PurgeProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeProductsRequest} PurgeProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsRequest message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a PurgeProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeProductsRequest} PurgeProductsRequest + */ + PurgeProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeProductsRequest) + return object; + var message = new $root.google.cloud.retail.v2beta.PurgeProductsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a PurgeProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {google.cloud.retail.v2beta.PurgeProductsRequest} message PurgeProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.force = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this PurgeProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsRequest + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.PurgeProductsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.PurgeProductsRequest"; + }; + + return PurgeProductsRequest; + })(); + + v2beta.PurgeProductsResponse = (function() { + + /** + * Properties of a PurgeProductsResponse. + * @memberof google.cloud.retail.v2beta + * @interface IPurgeProductsResponse + * @property {number|Long|null} [purgeCount] PurgeProductsResponse purgeCount + * @property {Array.|null} [purgeSample] PurgeProductsResponse purgeSample + */ + + /** + * Constructs a new PurgeProductsResponse. + * @memberof google.cloud.retail.v2beta + * @classdesc Represents a PurgeProductsResponse. + * @implements IPurgeProductsResponse + * @constructor + * @param {google.cloud.retail.v2beta.IPurgeProductsResponse=} [properties] Properties to set + */ + function PurgeProductsResponse(properties) { + this.purgeSample = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurgeProductsResponse purgeCount. + * @member {number|Long} purgeCount + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PurgeProductsResponse purgeSample. + * @member {Array.} purgeSample + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @instance + */ + PurgeProductsResponse.prototype.purgeSample = $util.emptyArray; + + /** + * Creates a new PurgeProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsResponse=} [properties] Properties to set + * @returns {google.cloud.retail.v2beta.PurgeProductsResponse} PurgeProductsResponse instance + */ + PurgeProductsResponse.create = function create(properties) { + return new PurgeProductsResponse(properties); + }; + + /** + * Encodes the specified PurgeProductsResponse message. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purgeCount != null && Object.hasOwnProperty.call(message, "purgeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.purgeCount); + if (message.purgeSample != null && message.purgeSample.length) + for (var i = 0; i < message.purgeSample.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.purgeSample[i]); + return writer; + }; + + /** + * Encodes the specified PurgeProductsResponse message, length delimited. Does not implicitly {@link google.cloud.retail.v2beta.PurgeProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2beta.IPurgeProductsResponse} message PurgeProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurgeProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.retail.v2beta.PurgeProductsResponse} PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.retail.v2beta.PurgeProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.purgeCount = reader.int64(); + break; + } + case 2: { + if (!(message.purgeSample && message.purgeSample.length)) + message.purgeSample = []; + message.purgeSample.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurgeProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.retail.v2beta.PurgeProductsResponse} PurgeProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurgeProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurgeProductsResponse message. + * @function verify + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurgeProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (!$util.isInteger(message.purgeCount) && !(message.purgeCount && $util.isInteger(message.purgeCount.low) && $util.isInteger(message.purgeCount.high))) + return "purgeCount: integer|Long expected"; + if (message.purgeSample != null && message.hasOwnProperty("purgeSample")) { + if (!Array.isArray(message.purgeSample)) + return "purgeSample: array expected"; + for (var i = 0; i < message.purgeSample.length; ++i) + if (!$util.isString(message.purgeSample[i])) + return "purgeSample: string[] expected"; + } + return null; + }; + + /** + * Creates a PurgeProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.retail.v2beta.PurgeProductsResponse} PurgeProductsResponse + */ + PurgeProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.retail.v2beta.PurgeProductsResponse) + return object; + var message = new $root.google.cloud.retail.v2beta.PurgeProductsResponse(); + if (object.purgeCount != null) + if ($util.Long) + (message.purgeCount = $util.Long.fromValue(object.purgeCount)).unsigned = false; + else if (typeof object.purgeCount === "string") + message.purgeCount = parseInt(object.purgeCount, 10); + else if (typeof object.purgeCount === "number") + message.purgeCount = object.purgeCount; + else if (typeof object.purgeCount === "object") + message.purgeCount = new $util.LongBits(object.purgeCount.low >>> 0, object.purgeCount.high >>> 0).toNumber(); + if (object.purgeSample) { + if (!Array.isArray(object.purgeSample)) + throw TypeError(".google.cloud.retail.v2beta.PurgeProductsResponse.purgeSample: array expected"); + message.purgeSample = []; + for (var i = 0; i < object.purgeSample.length; ++i) + message.purgeSample[i] = String(object.purgeSample[i]); + } + return message; + }; + + /** + * Creates a plain object from a PurgeProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {google.cloud.retail.v2beta.PurgeProductsResponse} message PurgeProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurgeProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeSample = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.purgeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.purgeCount = options.longs === String ? "0" : 0; + if (message.purgeCount != null && message.hasOwnProperty("purgeCount")) + if (typeof message.purgeCount === "number") + object.purgeCount = options.longs === String ? String(message.purgeCount) : message.purgeCount; + else + object.purgeCount = options.longs === String ? $util.Long.prototype.toString.call(message.purgeCount) : options.longs === Number ? new $util.LongBits(message.purgeCount.low >>> 0, message.purgeCount.high >>> 0).toNumber() : message.purgeCount; + if (message.purgeSample && message.purgeSample.length) { + object.purgeSample = []; + for (var j = 0; j < message.purgeSample.length; ++j) + object.purgeSample[j] = message.purgeSample[j]; + } + return object; + }; + + /** + * Converts this PurgeProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @instance + * @returns {Object.} JSON object + */ + PurgeProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurgeProductsResponse + * @function getTypeUrl + * @memberof google.cloud.retail.v2beta.PurgeProductsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurgeProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.retail.v2beta.PurgeProductsResponse"; + }; + + return PurgeProductsResponse; + })(); + v2beta.PurgeUserEventsRequest = (function() { /** @@ -141420,6 +157542,7 @@ * @property {string|null} [diversityLevel] ServingConfig diversityLevel * @property {google.cloud.retail.v2beta.ServingConfig.DiversityType|null} [diversityType] ServingConfig diversityType * @property {string|null} [enableCategoryFilterLevel] ServingConfig enableCategoryFilterLevel + * @property {boolean|null} [ignoreRecsDenylist] ServingConfig ignoreRecsDenylist * @property {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null} [personalizationSpec] ServingConfig personalizationSpec * @property {Array.|null} [solutionTypes] ServingConfig solutionTypes */ @@ -141585,6 +157708,14 @@ */ ServingConfig.prototype.enableCategoryFilterLevel = ""; + /** + * ServingConfig ignoreRecsDenylist. + * @member {boolean} ignoreRecsDenylist + * @memberof google.cloud.retail.v2beta.ServingConfig + * @instance + */ + ServingConfig.prototype.ignoreRecsDenylist = false; + /** * ServingConfig personalizationSpec. * @member {google.cloud.retail.v2beta.SearchRequest.IPersonalizationSpec|null|undefined} personalizationSpec @@ -141676,6 +157807,8 @@ writer.uint32(/* id 20, wireType 0 =*/160).int32(message.diversityType); if (message.personalizationSpec != null && Object.hasOwnProperty.call(message, "personalizationSpec")) $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.ignoreRecsDenylist != null && Object.hasOwnProperty.call(message, "ignoreRecsDenylist")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.ignoreRecsDenylist); return writer; }; @@ -141796,6 +157929,10 @@ message.enableCategoryFilterLevel = reader.string(); break; } + case 24: { + message.ignoreRecsDenylist = reader.bool(); + break; + } case 21: { message.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.decode(reader, reader.uint32()); break; @@ -141941,6 +158078,9 @@ if (message.enableCategoryFilterLevel != null && message.hasOwnProperty("enableCategoryFilterLevel")) if (!$util.isString(message.enableCategoryFilterLevel)) return "enableCategoryFilterLevel: string expected"; + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + if (typeof message.ignoreRecsDenylist !== "boolean") + return "ignoreRecsDenylist: boolean expected"; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) { var error = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.verify(message.personalizationSpec); if (error) @@ -142074,6 +158214,8 @@ } if (object.enableCategoryFilterLevel != null) message.enableCategoryFilterLevel = String(object.enableCategoryFilterLevel); + if (object.ignoreRecsDenylist != null) + message.ignoreRecsDenylist = Boolean(object.ignoreRecsDenylist); if (object.personalizationSpec != null) { if (typeof object.personalizationSpec !== "object") throw TypeError(".google.cloud.retail.v2beta.ServingConfig.personalizationSpec: object expected"); @@ -142142,6 +158284,7 @@ object.enableCategoryFilterLevel = ""; object.diversityType = options.enums === String ? "DIVERSITY_TYPE_UNSPECIFIED" : 0; object.personalizationSpec = null; + object.ignoreRecsDenylist = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -142211,6 +158354,8 @@ object.diversityType = options.enums === String ? $root.google.cloud.retail.v2beta.ServingConfig.DiversityType[message.diversityType] === undefined ? message.diversityType : $root.google.cloud.retail.v2beta.ServingConfig.DiversityType[message.diversityType] : message.diversityType; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); + if (message.ignoreRecsDenylist != null && message.hasOwnProperty("ignoreRecsDenylist")) + object.ignoreRecsDenylist = message.ignoreRecsDenylist; return object; }; diff --git a/packages/google-cloud-retail/protos/protos.json b/packages/google-cloud-retail/protos/protos.json index c318bd894b1..c308e4a4fd5 100644 --- a/packages/google-cloud-retail/protos/protos.json +++ b/packages/google-cloud-retail/protos/protos.json @@ -264,9 +264,93 @@ "retrievableOption": { "type": "RetrievableOption", "id": 12 + }, + "facetConfig": { + "type": "FacetConfig", + "id": 13 } }, "nested": { + "FacetConfig": { + "fields": { + "facetIntervals": { + "rule": "repeated", + "type": "Interval", + "id": 1 + }, + "ignoredFacetValues": { + "rule": "repeated", + "type": "IgnoredFacetValues", + "id": 2 + }, + "mergedFacetValues": { + "rule": "repeated", + "type": "MergedFacetValue", + "id": 3 + }, + "mergedFacet": { + "type": "MergedFacet", + "id": 4 + }, + "rerankConfig": { + "type": "RerankConfig", + "id": 5 + } + }, + "nested": { + "IgnoredFacetValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "MergedFacetValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "mergedValue": { + "type": "string", + "id": 2 + } + } + }, + "MergedFacet": { + "fields": { + "mergedFacetKey": { + "type": "string", + "id": 1 + } + } + }, + "RerankConfig": { + "fields": { + "rerankFacet": { + "type": "bool", + "id": 1 + }, + "facetValues": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, "AttributeType": { "values": { "UNKNOWN": 0, @@ -479,6 +563,11 @@ "rule": "repeated", "type": "TimeRange", "id": 3 + }, + "pageCategories": { + "rule": "repeated", + "type": "string", + "id": 4 } }, "nested": { @@ -519,7 +608,9 @@ "replacementAction", "ignoreAction", "filterAction", - "twowaySynonymsAction" + "twowaySynonymsAction", + "forceReturnFacetAction", + "removeFacetAction" ] } }, @@ -556,6 +647,14 @@ "type": "TwowaySynonymsAction", "id": 11 }, + "forceReturnFacetAction": { + "type": "ForceReturnFacetAction", + "id": 12 + }, + "removeFacetAction": { + "type": "RemoveFacetAction", + "id": 13 + }, "condition": { "type": "Condition", "id": 1, @@ -665,6 +764,38 @@ "id": 1 } } + }, + "ForceReturnFacetAction": { + "fields": { + "facetPositionAdjustments": { + "rule": "repeated", + "type": "FacetPositionAdjustment", + "id": 1 + } + }, + "nested": { + "FacetPositionAdjustment": { + "fields": { + "attributeName": { + "type": "string", + "id": 1 + }, + "position": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "RemoveFacetAction": { + "fields": { + "attributeNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, @@ -2154,6 +2285,10 @@ "type": "int32", "id": 5 }, + "enableAttributeSuggestions": { + "type": "bool", + "id": 9 + }, "entity": { "type": "string", "id": 10 @@ -2174,7 +2309,10 @@ "recentSearchResults": { "rule": "repeated", "type": "RecentSearchResult", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } }, "nested": { @@ -2192,6 +2330,9 @@ } }, "RecentSearchResult": { + "options": { + "deprecated": true + }, "fields": { "recentSearch": { "type": "string", @@ -2572,6 +2713,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "modelFeaturesConfig": { + "type": "ModelFeaturesConfig", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -2587,6 +2735,32 @@ } } }, + "FrequentlyBoughtTogetherFeaturesConfig": { + "fields": { + "contextProductsType": { + "type": "ContextProductsType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelFeaturesConfig": { + "oneofs": { + "typeDedicatedConfig": { + "oneof": [ + "frequentlyBoughtTogetherConfig" + ] + } + }, + "fields": { + "frequentlyBoughtTogetherConfig": { + "type": "FrequentlyBoughtTogetherFeaturesConfig", + "id": 1 + } + } + }, "ServingState": { "values": { "SERVING_STATE_UNSPECIFIED": 0, @@ -2616,6 +2790,13 @@ "DATA_OK": 1, "DATA_ERROR": 2 } + }, + "ContextProductsType": { + "values": { + "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": 0, + "SINGLE_CONTEXT_PRODUCT": 1, + "MULTIPLE_CONTEXT_PRODUCTS": 2 + } } } }, @@ -3172,6 +3353,30 @@ } ] }, + "PurgeProducts": { + "requestType": "PurgeProductsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2.PurgeProductsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2.PurgeProductsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2.PurgeProductsResponse", + "metadata_type": "google.cloud.retail.v2.PurgeProductsMetadata" + } + } + ] + }, "ImportProducts": { "requestType": "ImportProductsRequest", "responseType": "google.longrunning.Operation", @@ -3634,6 +3839,65 @@ "PurgeMetadata": { "fields": {} }, + "PurgeProductsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + } + } + }, + "PurgeProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "PurgeProductsResponse": { + "fields": { + "purgeCount": { + "type": "int64", + "id": 1 + }, + "purgeSample": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, "PurgeUserEventsRequest": { "fields": { "parent": { @@ -4284,6 +4548,10 @@ "type": "string", "id": 16 }, + "ignoreRecsDenylist": { + "type": "bool", + "id": 24 + }, "personalizationSpec": { "type": "SearchRequest.PersonalizationSpec", "id": 21 @@ -5039,144 +5307,139 @@ } } }, - "ProductLevelConfig": { - "fields": { - "ingestionProductType": { - "type": "string", - "id": 1 - }, - "merchantCenterProductIdField": { - "type": "string", - "id": 2 - } + "BranchView": { + "values": { + "BRANCH_VIEW_UNSPECIFIED": 0, + "BRANCH_VIEW_BASIC": 1, + "BRANCH_VIEW_FULL": 2 } }, - "CatalogAttribute": { + "Branch": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/Branch", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}" + }, "fields": { - "key": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "inUse": { - "type": "bool", - "id": 9, + "displayName": { + "type": "string", + "id": 2, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "type": { - "type": "AttributeType", - "id": 10, + "isDefault": { + "type": "bool", + "id": 3, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "indexableOption": { - "type": "IndexableOption", - "id": 5 - }, - "dynamicFacetableOption": { - "type": "DynamicFacetableOption", - "id": 6 + "lastProductImportTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "searchableOption": { - "type": "SearchableOption", - "id": 7 + "productCountStats": { + "rule": "repeated", + "type": "ProductCountStatistic", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "recommendationsFilteringOption": { - "type": "RecommendationsFilteringOption", - "id": 8 - }, - "exactSearchableOption": { - "type": "ExactSearchableOption", - "id": 11 - }, - "retrievableOption": { - "type": "RetrievableOption", - "id": 12 + "qualityMetrics": { + "rule": "repeated", + "type": "QualityMetric", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { - "AttributeType": { - "values": { - "UNKNOWN": 0, - "TEXTUAL": 1, - "NUMERICAL": 2 - } - }, - "IndexableOption": { - "values": { - "INDEXABLE_OPTION_UNSPECIFIED": 0, - "INDEXABLE_ENABLED": 1, - "INDEXABLE_DISABLED": 2 - } - }, - "DynamicFacetableOption": { - "values": { - "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": 0, - "DYNAMIC_FACETABLE_ENABLED": 1, - "DYNAMIC_FACETABLE_DISABLED": 2 - } - }, - "SearchableOption": { - "values": { - "SEARCHABLE_OPTION_UNSPECIFIED": 0, - "SEARCHABLE_ENABLED": 1, - "SEARCHABLE_DISABLED": 2 - } - }, - "ExactSearchableOption": { - "values": { - "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": 0, - "EXACT_SEARCHABLE_ENABLED": 1, - "EXACT_SEARCHABLE_DISABLED": 2 + "ProductCountStatistic": { + "fields": { + "scope": { + "type": "ProductCountScope", + "id": 1 + }, + "counts": { + "keyType": "string", + "type": "int64", + "id": 2 + } + }, + "nested": { + "ProductCountScope": { + "values": { + "PRODUCT_COUNT_SCOPE_UNSPECIFIED": 0, + "ALL_PRODUCTS": 1, + "LAST_24_HOUR_UPDATE": 2 + } + } } }, - "RetrievableOption": { - "values": { - "RETRIEVABLE_OPTION_UNSPECIFIED": 0, - "RETRIEVABLE_ENABLED": 1, - "RETRIEVABLE_DISABLED": 2 + "QualityMetric": { + "fields": { + "requirementKey": { + "type": "string", + "id": 1 + }, + "qualifiedProductCount": { + "type": "int32", + "id": 2 + }, + "unqualifiedProductCount": { + "type": "int32", + "id": 3 + }, + "suggestedQualityPercentThreshold": { + "type": "double", + "id": 4 + }, + "unqualifiedSampleProducts": { + "rule": "repeated", + "type": "Product", + "id": 5 + } } } } }, - "AttributesConfig": { + "Product": { "options": { - "(google.api.resource).type": "retail.googleapis.com/AttributesConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + "(google.api.resource).type": "retail.googleapis.com/Product", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}" + }, + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } }, "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "catalogAttributes": { - "keyType": "string", - "type": "CatalogAttribute", - "id": 2 + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 16 }, - "attributeConfigLevel": { - "type": "AttributeConfigLevel", - "id": 3, + "ttl": { + "type": "google.protobuf.Duration", + "id": 17, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "INPUT_ONLY" } - } - } - }, - "CompletionConfig": { - "options": { - "(google.api.resource).type": "retail.googleapis.com/CompletionConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" - }, - "fields": { + }, "name": { "type": "string", "id": 1, @@ -5184,150 +5447,180 @@ "(google.api.field_behavior)": "IMMUTABLE" } }, - "matchingOrder": { + "id": { "type": "string", - "id": 2 - }, - "maxSuggestions": { - "type": "int32", - "id": 3 - }, - "minPrefixLength": { - "type": "int32", - "id": 4 - }, - "autoLearning": { - "type": "bool", - "id": 11 - }, - "suggestionsInputConfig": { - "type": "CompletionDataInputConfig", - "id": 5, + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "lastSuggestionsImportOperation": { - "type": "string", - "id": 6, + "type": { + "type": "Type", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "denylistInputConfig": { - "type": "CompletionDataInputConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "primaryProductId": { + "type": "string", + "id": 4 }, - "lastDenylistImportOperation": { + "collectionMemberIds": { + "rule": "repeated", "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 5 }, - "allowlistInputConfig": { - "type": "CompletionDataInputConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "gtin": { + "type": "string", + "id": 6 }, - "lastAllowlistImportOperation": { + "categories": { + "rule": "repeated", "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "MerchantCenterLink": { - "fields": { - "merchantCenterAccountId": { - "type": "int64", - "id": 1, + "id": 7 + }, + "title": { + "type": "string", + "id": 8, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "branchId": { - "type": "string", - "id": 2 - }, - "destinations": { + "brands": { "rule": "repeated", "type": "string", - "id": 3 + "id": 9 }, - "regionCode": { + "description": { "type": "string", - "id": 4 + "id": 10 }, "languageCode": { "type": "string", - "id": 5 + "id": 11 }, - "feeds": { - "rule": "repeated", - "type": "MerchantCenterFeedFilter", - "id": 6 - } - } - }, - "MerchantCenterFeedFilter": { - "fields": { - "primaryFeedId": { - "type": "int64", - "id": 1 + "attributes": { + "keyType": "string", + "type": "CustomAttribute", + "id": 12 }, - "primaryFeedName": { - "type": "string", - "id": 2 - } - } - }, - "MerchantCenterLinkingConfig": { - "fields": { - "links": { + "tags": { "rule": "repeated", - "type": "MerchantCenterLink", - "id": 1 - } - } - }, - "Catalog": { - "options": { - "(google.api.resource).type": "retail.googleapis.com/Catalog", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}" - }, - "fields": { - "name": { "type": "string", - "id": 1, + "id": 13 + }, + "priceInfo": { + "type": "PriceInfo", + "id": 14 + }, + "rating": { + "type": "Rating", + "id": 15 + }, + "availableTime": { + "type": "google.protobuf.Timestamp", + "id": 18 + }, + "availability": { + "type": "Availability", + "id": 19 + }, + "availableQuantity": { + "type": "google.protobuf.Int32Value", + "id": 20 + }, + "fulfillmentInfo": { + "rule": "repeated", + "type": "FulfillmentInfo", + "id": 21 + }, + "uri": { + "type": "string", + "id": 22 + }, + "images": { + "rule": "repeated", + "type": "Image", + "id": 23 + }, + "audience": { + "type": "Audience", + "id": 24 + }, + "colorInfo": { + "type": "ColorInfo", + "id": 25 + }, + "sizes": { + "rule": "repeated", + "type": "string", + "id": 26 + }, + "materials": { + "rule": "repeated", + "type": "string", + "id": 27 + }, + "patterns": { + "rule": "repeated", + "type": "string", + "id": 28 + }, + "conditions": { + "rule": "repeated", + "type": "string", + "id": 29 + }, + "promotions": { + "rule": "repeated", + "type": "Promotion", + "id": 34 + }, + "publishTime": { + "type": "google.protobuf.Timestamp", + "id": 33 + }, + "retrievableFields": { + "type": "google.protobuf.FieldMask", + "id": 30, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "deprecated": true } }, - "displayName": { - "type": "string", - "id": 2, + "variants": { + "rule": "repeated", + "type": "Product", + "id": 31, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "productLevelConfig": { - "type": "ProductLevelConfig", - "id": 4, + "localInventories": { + "rule": "repeated", + "type": "LocalInventory", + "id": 35, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PRIMARY": 1, + "VARIANT": 2, + "COLLECTION": 3 } }, - "merchantCenterLinkingConfig": { - "type": "MerchantCenterLinkingConfig", - "id": 6 + "Availability": { + "values": { + "AVAILABILITY_UNSPECIFIED": 0, + "IN_STOCK": 1, + "OUT_OF_STOCK": 2, + "PREORDER": 3, + "BACKORDER": 4 + } } } }, @@ -5370,6 +5663,11 @@ "rule": "repeated", "type": "TimeRange", "id": 3 + }, + "pageCategories": { + "rule": "repeated", + "type": "string", + "id": 4 } }, "nested": { @@ -5410,7 +5708,9 @@ "replacementAction", "ignoreAction", "filterAction", - "twowaySynonymsAction" + "twowaySynonymsAction", + "forceReturnFacetAction", + "removeFacetAction" ] } }, @@ -5447,6 +5747,14 @@ "type": "TwowaySynonymsAction", "id": 11 }, + "forceReturnFacetAction": { + "type": "ForceReturnFacetAction", + "id": 12 + }, + "removeFacetAction": { + "type": "RemoveFacetAction", + "id": 13 + }, "condition": { "type": "Condition", "id": 1, @@ -5556,6 +5864,38 @@ "id": 1 } } + }, + "ForceReturnFacetAction": { + "fields": { + "facetPositionAdjustments": { + "rule": "repeated", + "type": "FacetPositionAdjustment", + "id": 1 + } + }, + "nested": { + "FacetPositionAdjustment": { + "fields": { + "attributeName": { + "type": "string", + "id": 1 + }, + "position": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "RemoveFacetAction": { + "fields": { + "attributeNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, @@ -5806,618 +6146,870 @@ } } }, - "GcsSource": { + "Promotion": { "fields": { - "inputUris": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dataSchema": { + "promotionId": { "type": "string", - "id": 2 + "id": 1 } } }, - "BigQuerySource": { - "oneofs": { - "partition": { - "oneof": [ - "partitionDate" + "BranchService": { + "options": { + "(google.api.default_host)": "retail.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListBranches": { + "requestType": "ListBranchesRequest", + "responseType": "ListBranchesResponse", + "options": { + "(google.api.http).get": "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/branches", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{parent=projects/*/locations/*/catalogs/*}/branches" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBranch": { + "requestType": "GetBranchRequest", + "responseType": "Branch", + "options": { + "(google.api.http).get": "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*}" + } + }, + { + "(google.api.method_signature)": "name" + } ] } - }, + } + }, + "ListBranchesRequest": { "fields": { - "partitionDate": { - "type": "google.type.Date", - "id": 6 - }, - "projectId": { - "type": "string", - "id": 5 - }, - "datasetId": { + "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tableId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" } }, - "gcsStagingDir": { - "type": "string", - "id": 3 - }, - "dataSchema": { - "type": "string", - "id": 4 + "view": { + "type": "BranchView", + "id": 2 } } }, - "ProductInlineSource": { + "ListBranchesResponse": { "fields": { - "products": { + "branches": { "rule": "repeated", - "type": "Product", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "type": "Branch", + "id": 1 } } }, - "UserEventInlineSource": { + "GetBranchRequest": { "fields": { - "userEvents": { - "rule": "repeated", - "type": "UserEvent", + "name": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" } + }, + "view": { + "type": "BranchView", + "id": 2 } } }, - "ImportErrorsConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsPrefix" - ] - } - }, + "ProductLevelConfig": { "fields": { - "gcsPrefix": { + "ingestionProductType": { "type": "string", "id": 1 + }, + "merchantCenterProductIdField": { + "type": "string", + "id": 2 } } }, - "ImportProductsRequest": { + "CatalogAttribute": { "fields": { - "parent": { + "key": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.field_behavior)": "REQUIRED" } }, - "requestId": { - "type": "string", - "id": 6, + "inUse": { + "type": "bool", + "id": 9, "options": { - "deprecated": true + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "inputConfig": { - "type": "ProductInputConfig", - "id": 2, + "type": { + "type": "AttributeType", + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "errorsConfig": { - "type": "ImportErrorsConfig", - "id": 3 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 4 - }, - "reconciliationMode": { - "type": "ReconciliationMode", + "indexableOption": { + "type": "IndexableOption", "id": 5 }, - "notificationPubsubTopic": { - "type": "string", + "dynamicFacetableOption": { + "type": "DynamicFacetableOption", + "id": 6 + }, + "searchableOption": { + "type": "SearchableOption", "id": 7 }, - "skipDefaultBranchProtection": { - "type": "bool", + "recommendationsFilteringOption": { + "type": "RecommendationsFilteringOption", "id": 8 + }, + "exactSearchableOption": { + "type": "ExactSearchableOption", + "id": 11 + }, + "retrievableOption": { + "type": "RetrievableOption", + "id": 12 + }, + "facetConfig": { + "type": "FacetConfig", + "id": 13 } }, "nested": { - "ReconciliationMode": { + "FacetConfig": { + "fields": { + "facetIntervals": { + "rule": "repeated", + "type": "Interval", + "id": 1 + }, + "ignoredFacetValues": { + "rule": "repeated", + "type": "IgnoredFacetValues", + "id": 2 + }, + "mergedFacetValues": { + "rule": "repeated", + "type": "MergedFacetValue", + "id": 3 + }, + "mergedFacet": { + "type": "MergedFacet", + "id": 4 + }, + "rerankConfig": { + "type": "RerankConfig", + "id": 5 + } + }, + "nested": { + "IgnoredFacetValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "MergedFacetValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "mergedValue": { + "type": "string", + "id": 2 + } + } + }, + "MergedFacet": { + "fields": { + "mergedFacetKey": { + "type": "string", + "id": 1 + } + } + }, + "RerankConfig": { + "fields": { + "rerankFacet": { + "type": "bool", + "id": 1 + }, + "facetValues": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "AttributeType": { "values": { - "RECONCILIATION_MODE_UNSPECIFIED": 0, - "INCREMENTAL": 1, - "FULL": 2 + "UNKNOWN": 0, + "TEXTUAL": 1, + "NUMERICAL": 2 + } + }, + "IndexableOption": { + "values": { + "INDEXABLE_OPTION_UNSPECIFIED": 0, + "INDEXABLE_ENABLED": 1, + "INDEXABLE_DISABLED": 2 + } + }, + "DynamicFacetableOption": { + "values": { + "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": 0, + "DYNAMIC_FACETABLE_ENABLED": 1, + "DYNAMIC_FACETABLE_DISABLED": 2 + } + }, + "SearchableOption": { + "values": { + "SEARCHABLE_OPTION_UNSPECIFIED": 0, + "SEARCHABLE_ENABLED": 1, + "SEARCHABLE_DISABLED": 2 + } + }, + "ExactSearchableOption": { + "values": { + "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": 0, + "EXACT_SEARCHABLE_ENABLED": 1, + "EXACT_SEARCHABLE_DISABLED": 2 + } + }, + "RetrievableOption": { + "values": { + "RETRIEVABLE_OPTION_UNSPECIFIED": 0, + "RETRIEVABLE_ENABLED": 1, + "RETRIEVABLE_DISABLED": 2 } } } }, - "ImportUserEventsRequest": { + "AttributesConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/AttributesConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig" + }, "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "inputConfig": { - "type": "UserEventInputConfig", - "id": 2, + "catalogAttributes": { + "keyType": "string", + "type": "CatalogAttribute", + "id": 2 + }, + "attributeConfigLevel": { + "type": "AttributeConfigLevel", + "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } - }, - "errorsConfig": { - "type": "ImportErrorsConfig", - "id": 3 } } }, - "ImportCompletionDataRequest": { + "CompletionConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/CompletionConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig" + }, "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "inputConfig": { + "matchingOrder": { + "type": "string", + "id": 2 + }, + "maxSuggestions": { + "type": "int32", + "id": 3 + }, + "minPrefixLength": { + "type": "int32", + "id": 4 + }, + "autoLearning": { + "type": "bool", + "id": 11 + }, + "suggestionsInputConfig": { "type": "CompletionDataInputConfig", - "id": 2, + "id": 5, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "notificationPubsubTopic": { + "lastSuggestionsImportOperation": { "type": "string", - "id": 3 - } - } - }, - "ProductInputConfig": { - "oneofs": { - "source": { - "oneof": [ - "productInlineSource", - "gcsSource", - "bigQuerySource" - ] - } - }, - "fields": { - "productInlineSource": { - "type": "ProductInlineSource", - "id": 1 - }, - "gcsSource": { - "type": "GcsSource", - "id": 2 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "bigQuerySource": { - "type": "BigQuerySource", - "id": 3 - } - } - }, - "UserEventInputConfig": { - "oneofs": { - "source": { - "oneof": [ - "userEventInlineSource", - "gcsSource", - "bigQuerySource" - ] - } - }, - "fields": { - "userEventInlineSource": { - "type": "UserEventInlineSource", - "id": 1, + "denylistInputConfig": { + "type": "CompletionDataInputConfig", + "id": 7, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "gcsSource": { - "type": "GcsSource", - "id": 2, + "lastDenylistImportOperation": { + "type": "string", + "id": 8, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "bigQuerySource": { - "type": "BigQuerySource", - "id": 3, + "allowlistInputConfig": { + "type": "CompletionDataInputConfig", + "id": 9, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastAllowlistImportOperation": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" } } } }, - "CompletionDataInputConfig": { - "oneofs": { - "source": { - "oneof": [ - "bigQuerySource" - ] - } - }, + "MerchantCenterLink": { "fields": { - "bigQuerySource": { - "type": "BigQuerySource", + "merchantCenterAccountId": { + "type": "int64", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } - } - } - }, - "ImportMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1 }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "branchId": { + "type": "string", "id": 2 }, - "successCount": { - "type": "int64", + "destinations": { + "rule": "repeated", + "type": "string", "id": 3 }, - "failureCount": { - "type": "int64", + "regionCode": { + "type": "string", "id": 4 }, - "requestId": { + "languageCode": { "type": "string", - "id": 5, - "options": { - "deprecated": true - } + "id": 5 }, - "notificationPubsubTopic": { - "type": "string", + "feeds": { + "rule": "repeated", + "type": "MerchantCenterFeedFilter", "id": 6 - }, - "transformedUserEventsMetadata": { - "type": "TransformedUserEventsMetadata", - "id": 7 } } }, - "TransformedUserEventsMetadata": { + "MerchantCenterFeedFilter": { "fields": { - "sourceEventsCount": { + "primaryFeedId": { "type": "int64", "id": 1 }, - "transformedEventsCount": { - "type": "int64", + "primaryFeedName": { + "type": "string", "id": 2 } } }, - "ImportProductsResponse": { + "MerchantCenterLinkingConfig": { "fields": { - "errorSamples": { + "links": { "rule": "repeated", - "type": "google.rpc.Status", + "type": "MerchantCenterLink", "id": 1 - }, - "errorsConfig": { - "type": "ImportErrorsConfig", - "id": 2 } } }, - "ImportUserEventsResponse": { + "Catalog": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/Catalog", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}" + }, "fields": { - "errorSamples": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, - "errorsConfig": { - "type": "ImportErrorsConfig", - "id": 2 + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, - "importSummary": { - "type": "UserEventImportSummary", - "id": 3 - } - } - }, - "UserEventImportSummary": { - "fields": { - "joinedEventsCount": { - "type": "int64", - "id": 1 + "productLevelConfig": { + "type": "ProductLevelConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "unjoinedEventsCount": { - "type": "int64", - "id": 2 + "merchantCenterLinkingConfig": { + "type": "MerchantCenterLinkingConfig", + "id": 6 } } }, - "ImportCompletionDataResponse": { + "GcsSource": { "fields": { - "errorSamples": { + "inputUris": { "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataSchema": { + "type": "string", + "id": 2 } } }, - "Product": { - "options": { - "(google.api.resource).type": "retail.googleapis.com/Product", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}" - }, + "BigQuerySource": { "oneofs": { - "expiration": { + "partition": { "oneof": [ - "expireTime", - "ttl" + "partitionDate" ] } }, "fields": { - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 16 + "partitionDate": { + "type": "google.type.Date", + "id": 6 }, - "ttl": { - "type": "google.protobuf.Duration", - "id": 17, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } + "projectId": { + "type": "string", + "id": 5 }, - "name": { + "datasetId": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "REQUIRED" } }, - "id": { + "tableId": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "type": { - "type": "Type", - "id": 3, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "REQUIRED" } }, - "primaryProductId": { - "type": "string", - "id": 4 - }, - "collectionMemberIds": { - "rule": "repeated", + "gcsStagingDir": { "type": "string", - "id": 5 + "id": 3 }, - "gtin": { + "dataSchema": { "type": "string", - "id": 6 - }, - "categories": { + "id": 4 + } + } + }, + "ProductInlineSource": { + "fields": { + "products": { "rule": "repeated", - "type": "string", - "id": 7 - }, - "title": { - "type": "string", - "id": 8, + "type": "Product", + "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } - }, - "brands": { + } + } + }, + "UserEventInlineSource": { + "fields": { + "userEvents": { "rule": "repeated", + "type": "UserEvent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportErrorsConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsPrefix" + ] + } + }, + "fields": { + "gcsPrefix": { "type": "string", - "id": 9 - }, - "description": { - "type": "string", - "id": 10 - }, - "languageCode": { - "type": "string", - "id": 11 - }, - "attributes": { - "keyType": "string", - "type": "CustomAttribute", - "id": 12 - }, - "tags": { - "rule": "repeated", + "id": 1 + } + } + }, + "ImportProductsRequest": { + "fields": { + "parent": { "type": "string", - "id": 13 - }, - "priceInfo": { - "type": "PriceInfo", - "id": 14 - }, - "rating": { - "type": "Rating", - "id": 15 - }, - "availableTime": { - "type": "google.protobuf.Timestamp", - "id": 18 - }, - "availability": { - "type": "Availability", - "id": 19 - }, - "availableQuantity": { - "type": "google.protobuf.Int32Value", - "id": 20 - }, - "fulfillmentInfo": { - "rule": "repeated", - "type": "FulfillmentInfo", - "id": 21 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } }, - "uri": { + "requestId": { "type": "string", - "id": 22 - }, - "images": { - "rule": "repeated", - "type": "Image", - "id": 23 + "id": 6, + "options": { + "deprecated": true + } }, - "audience": { - "type": "Audience", - "id": 24 + "inputConfig": { + "type": "ProductInputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "colorInfo": { - "type": "ColorInfo", - "id": 25 + "errorsConfig": { + "type": "ImportErrorsConfig", + "id": 3 }, - "sizes": { - "rule": "repeated", - "type": "string", - "id": 26 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4 }, - "materials": { - "rule": "repeated", - "type": "string", - "id": 27 + "reconciliationMode": { + "type": "ReconciliationMode", + "id": 5 }, - "patterns": { - "rule": "repeated", + "notificationPubsubTopic": { "type": "string", - "id": 28 + "id": 7 }, - "conditions": { - "rule": "repeated", + "skipDefaultBranchProtection": { + "type": "bool", + "id": 8 + } + }, + "nested": { + "ReconciliationMode": { + "values": { + "RECONCILIATION_MODE_UNSPECIFIED": 0, + "INCREMENTAL": 1, + "FULL": 2 + } + } + } + }, + "ImportUserEventsRequest": { + "fields": { + "parent": { "type": "string", - "id": 29 - }, - "promotions": { - "rule": "repeated", - "type": "Promotion", - "id": 34 - }, - "publishTime": { - "type": "google.protobuf.Timestamp", - "id": 33 - }, - "retrievableFields": { - "type": "google.protobuf.FieldMask", - "id": 30, + "id": 1, "options": { - "deprecated": true + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" } }, - "variants": { - "rule": "repeated", - "type": "Product", - "id": 31, + "inputConfig": { + "type": "UserEventInputConfig", + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } }, - "localInventories": { - "rule": "repeated", - "type": "LocalInventory", - "id": 35, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "errorsConfig": { + "type": "ImportErrorsConfig", + "id": 3 } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "PRIMARY": 1, - "VARIANT": 2, - "COLLECTION": 3 + } + }, + "ImportCompletionDataRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" } }, - "Availability": { - "values": { - "AVAILABILITY_UNSPECIFIED": 0, - "IN_STOCK": 1, - "OUT_OF_STOCK": 2, - "PREORDER": 3, - "BACKORDER": 4 + "inputConfig": { + "type": "CompletionDataInputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 3 } } }, - "Promotion": { + "ProductInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "productInlineSource", + "gcsSource", + "bigQuerySource" + ] + } + }, "fields": { - "promotionId": { - "type": "string", + "productInlineSource": { + "type": "ProductInlineSource", "id": 1 + }, + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "bigQuerySource": { + "type": "BigQuerySource", + "id": 3 } } }, - "UserEvent": { + "UserEventInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "userEventInlineSource", + "gcsSource", + "bigQuerySource" + ] + } + }, "fields": { - "eventType": { - "type": "string", + "userEventInlineSource": { + "type": "UserEventInlineSource", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "visitorId": { - "type": "string", + "gcsSource": { + "type": "GcsSource", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "sessionId": { - "type": "string", - "id": 21 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 3 + "bigQuerySource": { + "type": "BigQuerySource", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CompletionDataInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "bigQuerySource" + ] + } + }, + "fields": { + "bigQuerySource": { + "type": "BigQuerySource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "deprecated": true + } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 6 + }, + "transformedUserEventsMetadata": { + "type": "TransformedUserEventsMetadata", + "id": 7 + } + } + }, + "TransformedUserEventsMetadata": { + "fields": { + "sourceEventsCount": { + "type": "int64", + "id": 1 + }, + "transformedEventsCount": { + "type": "int64", + "id": 2 + } + } + }, + "ImportProductsResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "errorsConfig": { + "type": "ImportErrorsConfig", + "id": 2 + } + } + }, + "ImportUserEventsResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "errorsConfig": { + "type": "ImportErrorsConfig", + "id": 2 + }, + "importSummary": { + "type": "UserEventImportSummary", + "id": 3 + } + } + }, + "UserEventImportSummary": { + "fields": { + "joinedEventsCount": { + "type": "int64", + "id": 1 + }, + "unjoinedEventsCount": { + "type": "int64", + "id": 2 + } + } + }, + "ImportCompletionDataResponse": { + "fields": { + "errorSamples": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + } + } + }, + "UserEvent": { + "fields": { + "eventType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "visitorId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sessionId": { + "type": "string", + "id": 21 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 3 }, "experimentIds": { "rule": "repeated", @@ -7139,7 +7731,10 @@ "recentSearchResults": { "rule": "repeated", "type": "RecentSearchResult", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "attributeResults": { "keyType": "string", @@ -7171,6 +7766,9 @@ } }, "RecentSearchResult": { + "options": { + "deprecated": true + }, "fields": { "recentSearch": { "type": "string", @@ -8067,6 +8665,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "source": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -8346,6 +8951,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "modelFeaturesConfig": { + "type": "ModelFeaturesConfig", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -8439,6 +9051,32 @@ } } }, + "FrequentlyBoughtTogetherFeaturesConfig": { + "fields": { + "contextProductsType": { + "type": "ContextProductsType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelFeaturesConfig": { + "oneofs": { + "typeDedicatedConfig": { + "oneof": [ + "frequentlyBoughtTogetherConfig" + ] + } + }, + "fields": { + "frequentlyBoughtTogetherConfig": { + "type": "FrequentlyBoughtTogetherFeaturesConfig", + "id": 1 + } + } + }, "ServingState": { "values": { "SERVING_STATE_UNSPECIFIED": 0, @@ -8468,6 +9106,13 @@ "DATA_OK": 1, "DATA_ERROR": 2 } + }, + "ContextProductsType": { + "values": { + "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": 0, + "SINGLE_CONTEXT_PRODUCT": 1, + "MULTIPLE_CONTEXT_PRODUCTS": 2 + } } } }, @@ -9214,401 +9859,845 @@ } } }, - "CreateProductRequest": { + "CreateProductRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "product": { + "type": "Product", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "productId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, + "UpdateProductRequest": { + "fields": { + "product": { + "type": "Product", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteProductRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "force": { + "type": "bool", + "id": 4 + } + } + }, + "ListProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 5 + }, + "requireTotalSize": { + "type": "bool", + "id": 6 + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "SetInventoryRequest": { + "fields": { + "inventory": { + "type": "Product", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "setMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "setTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "SetInventoryMetadata": { + "fields": {} + }, + "SetInventoryResponse": { + "fields": {} + }, + "AddFulfillmentPlacesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "allowMissing": { + "type": "bool", + "id": 5 + } + } + }, + "AddFulfillmentPlacesMetadata": { + "fields": {} + }, + "AddFulfillmentPlacesResponse": { + "fields": {} + }, + "AddLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "localInventories": { + "rule": "repeated", + "type": "LocalInventory", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "addMask": { + "type": "google.protobuf.FieldMask", + "id": 4 + }, + "addTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 6 + } + } + }, + "AddLocalInventoriesMetadata": { + "fields": {} + }, + "AddLocalInventoriesResponse": { + "fields": {} + }, + "RemoveLocalInventoriesRequest": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + }, + "placeIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "removeTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "RemoveLocalInventoriesMetadata": { + "fields": {} + }, + "RemoveLocalInventoriesResponse": { + "fields": {} + }, + "RemoveFulfillmentPlacesRequest": { "fields": { - "parent": { + "product": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.resource_reference).type": "retail.googleapis.com/Product" } }, - "product": { - "type": "Product", + "type": { + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "productId": { + "placeIds": { + "rule": "repeated", "type": "string", "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "removeTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "allowMissing": { + "type": "bool", + "id": 5 } } }, - "GetProductRequest": { + "RemoveFulfillmentPlacesMetadata": { + "fields": {} + }, + "RemoveFulfillmentPlacesResponse": { + "fields": {} + }, + "PurgeMetadata": { + "fields": {} + }, + "PurgeProductsMetadata": { "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" - } + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 } } }, - "UpdateProductRequest": { + "PurgeProductsRequest": { "fields": { - "product": { - "type": "Product", + "parent": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "allowMissing": { + "force": { "type": "bool", "id": 3 } } }, - "DeleteProductRequest": { + "PurgeProductsResponse": { "fields": { - "name": { + "purgeCount": { + "type": "int64", + "id": 1 + }, + "purgeSample": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, + "PurgeUserEventsRequest": { + "fields": { + "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } }, "force": { "type": "bool", - "id": 4 + "id": 3 } } }, - "ListProductsRequest": { + "PurgeUserEventsResponse": { "fields": { - "parent": { + "purgedEventsCount": { + "type": "int64", + "id": 1 + } + } + }, + "LoggingConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/LoggingConfig", + "(google.api.resource).pattern": "projects/{project}/loggingConfig" + }, + "fields": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "pageSize": { - "type": "int32", + "defaultLogGenerationRule": { + "type": "LogGenerationRule", "id": 2 }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", + "serviceLogGenerationRules": { + "rule": "repeated", + "type": "ServiceLogGenerationRule", "id": 4 + } + }, + "nested": { + "LogGenerationRule": { + "oneofs": { + "_infoLogSampleRate": { + "oneof": [ + "infoLogSampleRate" + ] + } + }, + "fields": { + "loggingLevel": { + "type": "LoggingLevel", + "id": 1 + }, + "infoLogSampleRate": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + } + } }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 5 + "ServiceLogGenerationRule": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "logGenerationRule": { + "type": "LogGenerationRule", + "id": 3 + } + } }, - "requireTotalSize": { - "type": "bool", - "id": 6 + "LoggingLevel": { + "values": { + "LOGGING_LEVEL_UNSPECIFIED": 0, + "LOGGING_DISABLED": 1, + "LOG_ERRORS_AND_ABOVE": 2, + "LOG_WARNINGS_AND_ABOVE": 3, + "LOG_ALL": 4 + } } } }, - "ListProductsResponse": { + "Project": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/RetailProject", + "(google.api.resource).pattern": "projects/{project}/retailProject" + }, "fields": { - "products": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enrolledSolutions": { "rule": "repeated", - "type": "Product", - "id": 1 + "type": "SolutionType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AlertConfig": { + "options": { + "(google.api.resource).type": "retail.googleapis.com/AlertConfig", + "(google.api.resource).pattern": "projects/{project}/alertConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "alertPolicies": { + "rule": "repeated", + "type": "AlertPolicy", + "id": 2 + } + }, + "nested": { + "AlertPolicy": { + "fields": { + "alertGroup": { + "type": "string", + "id": 1 + }, + "enrollStatus": { + "type": "EnrollStatus", + "id": 2 + }, + "recipients": { + "rule": "repeated", + "type": "Recipient", + "id": 3 + } + }, + "nested": { + "Recipient": { + "fields": { + "emailAddress": { + "type": "string", + "id": 1 + } + } + }, + "EnrollStatus": { + "values": { + "ENROLL_STATUS_UNSPECIFIED": 0, + "ENROLLED": 1, + "DECLINED": 2 + } + } + } + } + } + }, + "ProjectService": { + "options": { + "(google.api.default_host)": "retail.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetProject": { + "requestType": "GetProjectRequest", + "responseType": "Project", + "options": { + "(google.api.http).get": "/v2alpha/{name=projects/*/retailProject}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{name=projects/*/retailProject}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "AcceptTerms": { + "requestType": "AcceptTermsRequest", + "responseType": "Project", + "options": { + "(google.api.http).post": "/v2alpha/{project=projects/*/retailProject}:acceptTerms", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2alpha/{project=projects/*/retailProject}:acceptTerms", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project" + } + ] }, - "nextPageToken": { - "type": "string", - "id": 2 + "EnrollSolution": { + "requestType": "EnrollSolutionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2alpha/{project=projects/*}:enrollSolution", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2alpha.EnrollSolutionResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2alpha.EnrollSolutionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2alpha/{project=projects/*}:enrollSolution", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2alpha.EnrollSolutionResponse", + "metadata_type": "google.cloud.retail.v2alpha.EnrollSolutionMetadata" + } + } + ] }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "SetInventoryRequest": { - "fields": { - "inventory": { - "type": "Product", - "id": 1, + "ListEnrolledSolutions": { + "requestType": "ListEnrolledSolutionsRequest", + "responseType": "ListEnrolledSolutionsResponse", "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "(google.api.http).get": "/v2alpha/{parent=projects/*}:enrolledSolutions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{parent=projects/*}:enrolledSolutions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, - "setMask": { - "type": "google.protobuf.FieldMask", - "id": 2 + "GetLoggingConfig": { + "requestType": "GetLoggingConfigRequest", + "responseType": "LoggingConfig", + "options": { + "(google.api.http).get": "/v2alpha/{name=projects/*/loggingConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{name=projects/*/loggingConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, - "setTime": { - "type": "google.protobuf.Timestamp", - "id": 3 + "UpdateLoggingConfig": { + "requestType": "UpdateLoggingConfigRequest", + "responseType": "LoggingConfig", + "options": { + "(google.api.http).patch": "/v2alpha/{logging_config.name=projects/*/loggingConfig}", + "(google.api.http).body": "logging_config", + "(google.api.method_signature)": "logging_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2alpha/{logging_config.name=projects/*/loggingConfig}", + "body": "logging_config" + } + }, + { + "(google.api.method_signature)": "logging_config,update_mask" + } + ] }, - "allowMissing": { - "type": "bool", - "id": 4 + "GetAlertConfig": { + "requestType": "GetAlertConfigRequest", + "responseType": "AlertConfig", + "options": { + "(google.api.http).get": "/v2alpha/{name=projects/*/alertConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2alpha/{name=projects/*/alertConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAlertConfig": { + "requestType": "UpdateAlertConfigRequest", + "responseType": "AlertConfig", + "options": { + "(google.api.http).patch": "/v2alpha/{alert_config.name=projects/*/alertConfig}", + "(google.api.http).body": "alert_config", + "(google.api.method_signature)": "alert_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2alpha/{alert_config.name=projects/*/alertConfig}", + "body": "alert_config" + } + }, + { + "(google.api.method_signature)": "alert_config,update_mask" + } + ] } } }, - "SetInventoryMetadata": { - "fields": {} - }, - "SetInventoryResponse": { - "fields": {} - }, - "AddFulfillmentPlacesRequest": { + "GetProjectRequest": { "fields": { - "product": { + "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.resource_reference).type": "retail.googleapis.com/RetailProject" } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "placeIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "addTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "allowMissing": { - "type": "bool", - "id": 5 } } }, - "AddFulfillmentPlacesMetadata": { - "fields": {} - }, - "AddFulfillmentPlacesResponse": { - "fields": {} - }, - "AddLocalInventoriesRequest": { + "AcceptTermsRequest": { "fields": { - "product": { + "project": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.resource_reference).type": "retail.googleapis.com/RetailProject" } - }, - "localInventories": { - "rule": "repeated", - "type": "LocalInventory", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "addMask": { - "type": "google.protobuf.FieldMask", - "id": 4 - }, - "addTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "allowMissing": { - "type": "bool", - "id": 6 } } }, - "AddLocalInventoriesMetadata": { - "fields": {} - }, - "AddLocalInventoriesResponse": { - "fields": {} - }, - "RemoveLocalInventoriesRequest": { + "EnrollSolutionRequest": { "fields": { - "product": { + "project": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" } }, - "placeIds": { - "rule": "repeated", - "type": "string", + "solution": { + "type": "SolutionType", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } - }, - "removeTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "allowMissing": { - "type": "bool", - "id": 3 } } }, - "RemoveLocalInventoriesMetadata": { - "fields": {} + "EnrollSolutionResponse": { + "fields": { + "enrolledSolution": { + "type": "SolutionType", + "id": 1 + } + } }, - "RemoveLocalInventoriesResponse": { + "EnrollSolutionMetadata": { "fields": {} }, - "RemoveFulfillmentPlacesRequest": { + "ListEnrolledSolutionsRequest": { "fields": { - "product": { + "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Product" - } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "placeIds": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" } - }, - "removeTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "allowMissing": { - "type": "bool", - "id": 5 } } }, - "RemoveFulfillmentPlacesMetadata": { - "fields": {} - }, - "RemoveFulfillmentPlacesResponse": { - "fields": {} - }, - "PurgeMetadata": { - "fields": {} - }, - "PurgeProductsMetadata": { + "ListEnrolledSolutionsResponse": { "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", + "enrolledSolutions": { + "rule": "repeated", + "type": "SolutionType", "id": 1 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "successCount": { - "type": "int64", - "id": 3 - }, - "failureCount": { - "type": "int64", - "id": 4 } } }, - "PurgeProductsRequest": { + "GetLoggingConfigRequest": { "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + "(google.api.resource_reference).type": "retail.googleapis.com/LoggingConfig" } - }, - "filter": { - "type": "string", - "id": 2, + } + } + }, + "UpdateLoggingConfigRequest": { + "fields": { + "loggingConfig": { + "type": "LoggingConfig", + "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "force": { - "type": "bool", - "id": 3 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } }, - "PurgeProductsResponse": { + "GetAlertConfigRequest": { "fields": { - "purgeCount": { - "type": "int64", - "id": 1 - }, - "purgeSample": { - "rule": "repeated", + "name": { "type": "string", - "id": 2, + "id": 1, "options": { - "(google.api.resource_reference).type": "retail.googleapis.com/Product" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/AlertConfig" } } } }, - "PurgeUserEventsRequest": { + "UpdateAlertConfigRequest": { "fields": { - "parent": { - "type": "string", + "alertConfig": { + "type": "AlertConfig", "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "retail.googleapis.com/Catalog" - } - }, - "filter": { - "type": "string", - "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "force": { - "type": "bool", - "id": 3 - } - } - }, - "PurgeUserEventsResponse": { - "fields": { - "purgedEventsCount": { - "type": "int64", - "id": 1 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } }, @@ -9701,6 +10790,10 @@ "type": "string", "id": 16 }, + "ignoreRecsDenylist": { + "type": "bool", + "id": 24 + }, "personalizationSpec": { "type": "SearchRequest.PersonalizationSpec", "id": 21 @@ -10514,9 +11607,93 @@ "retrievableOption": { "type": "RetrievableOption", "id": 12 + }, + "facetConfig": { + "type": "FacetConfig", + "id": 13 } }, "nested": { + "FacetConfig": { + "fields": { + "facetIntervals": { + "rule": "repeated", + "type": "Interval", + "id": 1 + }, + "ignoredFacetValues": { + "rule": "repeated", + "type": "IgnoredFacetValues", + "id": 2 + }, + "mergedFacetValues": { + "rule": "repeated", + "type": "MergedFacetValue", + "id": 3 + }, + "mergedFacet": { + "type": "MergedFacet", + "id": 4 + }, + "rerankConfig": { + "type": "RerankConfig", + "id": 5 + } + }, + "nested": { + "IgnoredFacetValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "MergedFacetValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "mergedValue": { + "type": "string", + "id": 2 + } + } + }, + "MergedFacet": { + "fields": { + "mergedFacetKey": { + "type": "string", + "id": 1 + } + } + }, + "RerankConfig": { + "fields": { + "rerankFacet": { + "type": "bool", + "id": 1 + }, + "facetValues": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, "AttributeType": { "values": { "UNKNOWN": 0, @@ -10787,6 +11964,11 @@ "rule": "repeated", "type": "TimeRange", "id": 3 + }, + "pageCategories": { + "rule": "repeated", + "type": "string", + "id": 4 } }, "nested": { @@ -10827,7 +12009,9 @@ "replacementAction", "ignoreAction", "filterAction", - "twowaySynonymsAction" + "twowaySynonymsAction", + "forceReturnFacetAction", + "removeFacetAction" ] } }, @@ -10864,6 +12048,14 @@ "type": "TwowaySynonymsAction", "id": 11 }, + "forceReturnFacetAction": { + "type": "ForceReturnFacetAction", + "id": 12 + }, + "removeFacetAction": { + "type": "RemoveFacetAction", + "id": 13 + }, "condition": { "type": "Condition", "id": 1, @@ -10973,6 +12165,38 @@ "id": 1 } } + }, + "ForceReturnFacetAction": { + "fields": { + "facetPositionAdjustments": { + "rule": "repeated", + "type": "FacetPositionAdjustment", + "id": 1 + } + }, + "nested": { + "FacetPositionAdjustment": { + "fields": { + "attributeName": { + "type": "string", + "id": 1 + }, + "position": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "RemoveFacetAction": { + "fields": { + "attributeNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, @@ -12512,6 +13736,10 @@ "type": "int32", "id": 5 }, + "enableAttributeSuggestions": { + "type": "bool", + "id": 9 + }, "entity": { "type": "string", "id": 10 @@ -12532,7 +13760,10 @@ "recentSearchResults": { "rule": "repeated", "type": "RecentSearchResult", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } } }, "nested": { @@ -12550,6 +13781,9 @@ } }, "RecentSearchResult": { + "options": { + "deprecated": true + }, "fields": { "recentSearch": { "type": "string", @@ -13468,6 +14702,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "modelFeaturesConfig": { + "type": "ModelFeaturesConfig", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -13483,6 +14724,32 @@ } } }, + "FrequentlyBoughtTogetherFeaturesConfig": { + "fields": { + "contextProductsType": { + "type": "ContextProductsType", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelFeaturesConfig": { + "oneofs": { + "typeDedicatedConfig": { + "oneof": [ + "frequentlyBoughtTogetherConfig" + ] + } + }, + "fields": { + "frequentlyBoughtTogetherConfig": { + "type": "FrequentlyBoughtTogetherFeaturesConfig", + "id": 1 + } + } + }, "ServingState": { "values": { "SERVING_STATE_UNSPECIFIED": 0, @@ -13512,6 +14779,13 @@ "DATA_OK": 1, "DATA_ERROR": 2 } + }, + "ContextProductsType": { + "values": { + "CONTEXT_PRODUCTS_TYPE_UNSPECIFIED": 0, + "SINGLE_CONTEXT_PRODUCT": 1, + "MULTIPLE_CONTEXT_PRODUCTS": 2 + } } } }, @@ -14068,6 +15342,30 @@ } ] }, + "PurgeProducts": { + "requestType": "PurgeProductsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.retail.v2beta.PurgeProductsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.retail.v2beta.PurgeProductsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=projects/*/locations/*/catalogs/*/branches/*}/products:purge", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.retail.v2beta.PurgeProductsResponse", + "metadata_type": "google.cloud.retail.v2beta.PurgeProductsMetadata" + } + } + ] + }, "ImportProducts": { "requestType": "ImportProductsRequest", "responseType": "google.longrunning.Operation", @@ -14530,6 +15828,65 @@ "PurgeMetadata": { "fields": {} }, + "PurgeProductsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "successCount": { + "type": "int64", + "id": 3 + }, + "failureCount": { + "type": "int64", + "id": 4 + } + } + }, + "PurgeProductsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "retail.googleapis.com/Branch" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "PurgeProductsResponse": { + "fields": { + "purgeCount": { + "type": "int64", + "id": 1 + }, + "purgeSample": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "retail.googleapis.com/Product" + } + } + } + }, "PurgeUserEventsRequest": { "fields": { "parent": { @@ -14650,6 +16007,10 @@ "type": "string", "id": 16 }, + "ignoreRecsDenylist": { + "type": "bool", + "id": 24 + }, "personalizationSpec": { "type": "SearchRequest.PersonalizationSpec", "id": 21 diff --git a/packages/google-cloud-retail/samples/README.md b/packages/google-cloud-retail/samples/README.md index 5839485e8d8..c55989ece46 100644 --- a/packages/google-cloud-retail/samples/README.md +++ b/packages/google-cloud-retail/samples/README.md @@ -47,6 +47,7 @@ * [Product_service.get_product](#product_service.get_product) * [Product_service.import_products](#product_service.import_products) * [Product_service.list_products](#product_service.list_products) + * [Product_service.purge_products](#product_service.purge_products) * [Product_service.remove_fulfillment_places](#product_service.remove_fulfillment_places) * [Product_service.remove_local_inventories](#product_service.remove_local_inventories) * [Product_service.set_inventory](#product_service.set_inventory) @@ -65,6 +66,8 @@ * [User_event_service.rejoin_user_events](#user_event_service.rejoin_user_events) * [User_event_service.write_user_event](#user_event_service.write_user_event) * [Analytics_service.export_analytics_metrics](#analytics_service.export_analytics_metrics) + * [Branch_service.get_branch](#branch_service.get_branch) + * [Branch_service.list_branches](#branch_service.list_branches) * [Catalog_service.add_catalog_attribute](#catalog_service.add_catalog_attribute) * [Catalog_service.batch_remove_catalog_attributes](#catalog_service.batch_remove_catalog_attributes) * [Catalog_service.get_attributes_config](#catalog_service.get_attributes_config) @@ -108,6 +111,14 @@ * [Product_service.remove_local_inventories](#product_service.remove_local_inventories) * [Product_service.set_inventory](#product_service.set_inventory) * [Product_service.update_product](#product_service.update_product) + * [Project_service.accept_terms](#project_service.accept_terms) + * [Project_service.enroll_solution](#project_service.enroll_solution) + * [Project_service.get_alert_config](#project_service.get_alert_config) + * [Project_service.get_logging_config](#project_service.get_logging_config) + * [Project_service.get_project](#project_service.get_project) + * [Project_service.list_enrolled_solutions](#project_service.list_enrolled_solutions) + * [Project_service.update_alert_config](#project_service.update_alert_config) + * [Project_service.update_logging_config](#project_service.update_logging_config) * [Search_service.search](#search_service.search) * [Serving_config_service.add_control](#serving_config_service.add_control) * [Serving_config_service.create_serving_config](#serving_config_service.create_serving_config) @@ -157,6 +168,7 @@ * [Product_service.get_product](#product_service.get_product) * [Product_service.import_products](#product_service.import_products) * [Product_service.list_products](#product_service.list_products) + * [Product_service.purge_products](#product_service.purge_products) * [Product_service.remove_fulfillment_places](#product_service.remove_fulfillment_places) * [Product_service.remove_local_inventories](#product_service.remove_local_inventories) * [Product_service.set_inventory](#product_service.set_inventory) @@ -786,6 +798,23 @@ __Usage:__ +### Product_service.purge_products + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js` + + +----- + + + + ### Product_service.remove_fulfillment_places View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2/product_service.remove_fulfillment_places.js). @@ -1092,6 +1121,40 @@ __Usage:__ +### Branch_service.get_branch + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js` + + +----- + + + + +### Branch_service.list_branches + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js` + + +----- + + + + ### Catalog_service.add_catalog_attribute View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/catalog_service.add_catalog_attribute.js). @@ -1823,6 +1886,142 @@ __Usage:__ +### Project_service.accept_terms + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js` + + +----- + + + + +### Project_service.enroll_solution + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js` + + +----- + + + + +### Project_service.get_alert_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_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-retail/samples/generated/v2alpha/project_service.get_alert_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_config.js` + + +----- + + + + +### Project_service.get_logging_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_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-retail/samples/generated/v2alpha/project_service.get_logging_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_config.js` + + +----- + + + + +### Project_service.get_project + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js` + + +----- + + + + +### Project_service.list_enrolled_solutions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js` + + +----- + + + + +### Project_service.update_alert_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_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-retail/samples/generated/v2alpha/project_service.update_alert_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_config.js` + + +----- + + + + +### Project_service.update_logging_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_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-retail/samples/generated/v2alpha/project_service.update_logging_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_config.js` + + +----- + + + + ### Search_service.search View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js). @@ -2656,6 +2855,23 @@ __Usage:__ +### Product_service.purge_products + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js` + + +----- + + + + ### Product_service.remove_fulfillment_places View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-retail/samples/generated/v2beta/product_service.remove_fulfillment_places.js). diff --git a/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js index 44aae27296d..d6d12edf194 100644 --- a/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2/completion_service.complete_query.js @@ -94,10 +94,15 @@ function main(catalog, query) { */ // const maxSuggestions = 1234 /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + */ + // const enableAttributeSuggestions = true + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * UserEvent.entity google.cloud.retail.v2.UserEvent.entity to get * per-entity autocomplete results. */ diff --git a/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js index 16b660f6c18..c8d33af94c2 100644 --- a/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.import_products.js @@ -45,7 +45,8 @@ function main(parent, inputConfig) { // const errorsConfig = {} /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. */ // const updateMask = {} /** @@ -62,9 +63,13 @@ function main(parent, inputConfig) { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * ImportProductsRequest.parent google.cloud.retail.v2.ImportProductsRequest.parent. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode + * is set to `FULL`. */ // const notificationPubsubTopic = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js b/packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js new file mode 100644 index 00000000000..53a98254c88 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2/product_service.purge_products.js @@ -0,0 +1,103 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2_generated_ProductService_PurgeProducts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + */ + // const parent = 'abc123' + /** + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * Product.availability google.cloud.retail.v2.Product.availability string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + */ + // const filter = 'abc123' + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + */ + // const force = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callPurgeProducts() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const [operation] = await retailClient.purgeProducts(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPurgeProducts(); + // [END retail_v2_generated_ProductService_PurgeProducts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2/search_service.search.js index be35763d69a..247a457c0ab 100644 --- a/packages/google-cloud-retail/samples/generated/v2/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2/search_service.search.js @@ -34,7 +34,7 @@ function main(placement, visitorId) { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. */ // const placement = 'abc123' /** @@ -98,8 +98,8 @@ function main(placement, visitorId) { /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * Filter (https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const filter = 'abc123' @@ -107,21 +107,21 @@ function main(placement, visitorId) { * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * SearchRequest.canonical_filter google.cloud.retail.v2.SearchRequest.canonical_filter - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See SearchRequest.filter google.cloud.retail.v2.SearchRequest.filter for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * SearchRequest.filter google.cloud.retail.v2.SearchRequest.filter. */ // const canonicalFilter = 'abc123' /** * The order in which products are returned. Products can be ordered by * a field in an Product google.cloud.retail.v2.Product object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * Order (https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const orderBy = 'abc123' @@ -132,8 +132,8 @@ function main(placement, visitorId) { */ // const facetSpecs = [1,2,3,4] /** - * Boost specification to boost certain products. See more details at this - * user guide (https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * Boost results (https://cloud.google.com/retail/docs/boosting). * Notice that if both * ServingConfig.boost_control_ids google.cloud.retail.v2.ServingConfig.boost_control_ids * and @@ -145,8 +145,8 @@ function main(placement, visitorId) { // const boostSpec = {} /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this user - * guide (https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see Query + * expansion (https://cloud.google.com/retail/docs/result-size#query_expansion). */ // const queryExpansionSpec = {} /** @@ -219,7 +219,7 @@ function main(placement, visitorId) { */ // const variantRollupKeys = ['abc','def'] /** - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * UserEvent.page_categories google.cloud.retail.v2.UserEvent.page_categories; @@ -261,9 +261,9 @@ function main(placement, visitorId) { * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See Google Cloud - * Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see Requirements for + * labels (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. */ // const labels = [1,2,3,4] /** diff --git a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json index 594b5c44c79..a1e2821ae0e 100644 --- a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json +++ b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata.google.cloud.retail.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata_google.cloud.retail.v2.json b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata_google.cloud.retail.v2.json index 3bbf11a9db5..0a70b788024 100644 --- a/packages/google-cloud-retail/samples/generated/v2/snippet_metadata_google.cloud.retail.v2.json +++ b/packages/google-cloud-retail/samples/generated/v2/snippet_metadata_google.cloud.retail.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 124, + "end": 129, "type": "FULL" } ], @@ -595,6 +595,10 @@ "name": "max_suggestions", "type": "TYPE_INT32" }, + { + "name": "enable_attribute_suggestions", + "type": "TYPE_BOOL" + }, { "name": "entity", "type": "TYPE_STRING" @@ -1527,6 +1531,54 @@ } } }, + { + "regionTag": "retail_v2_generated_ProductService_PurgeProducts_async", + "title": "AnalyticsService purgeProducts Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] to false.", + "canonical": true, + "file": "product_service.purge_products.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PurgeProducts", + "fullName": "google.cloud.retail.v2.ProductService.PurgeProducts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2.ProductServiceClient" + }, + "method": { + "shortName": "PurgeProducts", + "fullName": "google.cloud.retail.v2.ProductService.PurgeProducts", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2.ProductService" + } + } + } + }, { "regionTag": "retail_v2_generated_ProductService_ImportProducts_async", "title": "AnalyticsService importProducts Sample", @@ -1538,7 +1590,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 95, "type": "FULL" } ], @@ -1647,7 +1699,7 @@ "regionTag": "retail_v2_generated_ProductService_AddFulfillmentPlaces_async", "title": "AnalyticsService addFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.add_fulfillment_places.js", "language": "JAVASCRIPT", @@ -1703,7 +1755,7 @@ "regionTag": "retail_v2_generated_ProductService_RemoveFulfillmentPlaces_async", "title": "AnalyticsService removeFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.remove_fulfillment_places.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js b/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js new file mode 100644 index 00000000000..b294c918733 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.get_branch.js @@ -0,0 +1,73 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_BranchService_GetBranch_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 branch to retrieve. + * Format: + * `projects/* /locations/global/catalogs/default_catalog/branches/some_branch_id`. + * "default_branch" can be used as a special branch_id, it returns the + * default branch that has been set for the catalog. + */ + // const name = 'abc123' + /** + * The view to apply to the returned + * Branch google.cloud.retail.v2alpha.Branch. Defaults to + * Branch.BranchView.BASIC if unspecified. + * See documentation of fields of Branch google.cloud.retail.v2alpha.Branch + * to find what fields are excluded from BASIC view. + */ + // const view = {} + + // Imports the Retail library + const {BranchServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new BranchServiceClient(); + + async function callGetBranch() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getBranch(request); + console.log(response); + } + + callGetBranch(); + // [END retail_v2alpha_generated_BranchService_GetBranch_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js b/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js new file mode 100644 index 00000000000..a1459752c44 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/branch_service.list_branches.js @@ -0,0 +1,69 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_BranchService_ListBranches_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 catalog resource name. + */ + // const parent = 'abc123' + /** + * The view to apply to the returned + * Branch google.cloud.retail.v2alpha.Branch. Defaults to + * Branch.BranchView.BASIC if unspecified. + * See documentation of fields of Branch google.cloud.retail.v2alpha.Branch + * to find what fields are excluded from BASIC view. + */ + // const view = {} + + // Imports the Retail library + const {BranchServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new BranchServiceClient(); + + async function callListBranches() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await retailClient.listBranches(request); + console.log(response); + } + + callListBranches(); + // [END retail_v2alpha_generated_BranchService_ListBranches_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js index bacbb0a09e4..1fbaa848e4e 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/completion_service.complete_query.js @@ -99,10 +99,10 @@ function main(catalog, query) { */ // const enableAttributeSuggestions = true /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * UserEvent.entity google.cloud.retail.v2alpha.UserEvent.entity to get * per-entity autocomplete results. */ diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.create_merchant_center_account_link.js b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.create_merchant_center_account_link.js index aed93f12218..d2c8223e816 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.create_merchant_center_account_link.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.create_merchant_center_account_link.js @@ -31,7 +31,7 @@ function main(parent, merchantCenterAccountLink) { /** * Required. The branch resource where this MerchantCenterAccountLink will be * created. Format: - * projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}} + * `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}` */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.delete_merchant_center_account_link.js b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.delete_merchant_center_account_link.js index 00ddd201527..cf08e7a9d4f 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.delete_merchant_center_account_link.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.delete_merchant_center_account_link.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Full resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id}` */ // const name = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.list_merchant_center_account_links.js b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.list_merchant_center_account_links.js index faffd70e024..2cbca65e35a 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.list_merchant_center_account_links.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/merchant_center_account_link_service.list_merchant_center_account_links.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. The parent Catalog of the resource. * It must match this format: - * projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID} + * `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}` */ // const parent = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js index 4d6ba64543d..903e441edb2 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/product_service.import_products.js @@ -45,7 +45,8 @@ function main(parent, inputConfig) { // const errorsConfig = {} /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. */ // const updateMask = {} /** @@ -62,9 +63,13 @@ function main(parent, inputConfig) { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * ImportProductsRequest.parent google.cloud.retail.v2alpha.ImportProductsRequest.parent. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode + * is set to `FULL`. */ // const notificationPubsubTopic = 'abc123' /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js new file mode 100644 index 00000000000..b6206ac11f5 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.accept_terms.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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) { + // [START retail_v2alpha_generated_ProjectService_AcceptTerms_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of the project. Format: + * `projects/{project_number_or_id}/retailProject` + */ + // const project = 'my-project' + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callAcceptTerms() { + // Construct request + const request = { + project, + }; + + // Run request + const response = await retailClient.acceptTerms(request); + console.log(response); + } + + callAcceptTerms(); + // [END retail_v2alpha_generated_ProjectService_AcceptTerms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js new file mode 100644 index 00000000000..266474a0730 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.enroll_solution.js @@ -0,0 +1,68 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, solution) { + // [START retail_v2alpha_generated_ProjectService_EnrollSolution_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of parent. Format: + * `projects/{project_number_or_id}` + */ + // const project = 'my-project' + /** + * Required. Solution to enroll. + */ + // const solution = {} + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callEnrollSolution() { + // Construct request + const request = { + project, + solution, + }; + + // Run request + const [operation] = await retailClient.enrollSolution(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnrollSolution(); + // [END retail_v2alpha_generated_ProjectService_EnrollSolution_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_config.js new file mode 100644 index 00000000000..741db79af2d --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_alert_config.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_ProjectService_GetAlertConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full AlertConfig resource name. Format: + * projects/{project_number}/alertConfig + */ + // const name = 'abc123' + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callGetAlertConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getAlertConfig(request); + console.log(response); + } + + callGetAlertConfig(); + // [END retail_v2alpha_generated_ProjectService_GetAlertConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_config.js new file mode 100644 index 00000000000..8f16f4e786e --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_logging_config.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_ProjectService_GetLoggingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full LoggingConfig resource name. Format: + * projects/{project_number}/loggingConfig + */ + // const name = 'abc123' + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callGetLoggingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getLoggingConfig(request); + console.log(response); + } + + callGetLoggingConfig(); + // [END retail_v2alpha_generated_ProjectService_GetLoggingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js new file mode 100644 index 00000000000..4f407903f83 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.get_project.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_ProjectService_GetProject_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of the project. Format: + * `projects/{project_number_or_id}/retailProject` + */ + // const name = 'abc123' + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callGetProject() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await retailClient.getProject(request); + console.log(response); + } + + callGetProject(); + // [END retail_v2alpha_generated_ProjectService_GetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js new file mode 100644 index 00000000000..e8a987d3d38 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.list_enrolled_solutions.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2alpha_generated_ProjectService_ListEnrolledSolutions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Full resource name of parent. Format: + * `projects/{project_number_or_id}` + */ + // const parent = 'abc123' + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callListEnrolledSolutions() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await retailClient.listEnrolledSolutions(request); + console.log(response); + } + + callListEnrolledSolutions(); + // [END retail_v2alpha_generated_ProjectService_ListEnrolledSolutions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_config.js new file mode 100644 index 00000000000..3fd555615b9 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_alert_config.js @@ -0,0 +1,73 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(alertConfig) { + // [START retail_v2alpha_generated_ProjectService_UpdateAlertConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 AlertConfig google.cloud.retail.v2alpha.AlertConfig to + * update. + * If the caller does not have permission to update the + * AlertConfig google.cloud.retail.v2alpha.AlertConfig, then a + * PERMISSION_DENIED error is returned. + * If the AlertConfig google.cloud.retail.v2alpha.AlertConfig to update + * does not exist, a NOT_FOUND error is returned. + */ + // const alertConfig = {} + /** + * Indicates which fields in the provided + * AlertConfig google.cloud.retail.v2alpha.AlertConfig to update. If not + * set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callUpdateAlertConfig() { + // Construct request + const request = { + alertConfig, + }; + + // Run request + const response = await retailClient.updateAlertConfig(request); + console.log(response); + } + + callUpdateAlertConfig(); + // [END retail_v2alpha_generated_ProjectService_UpdateAlertConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_config.js b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_config.js new file mode 100644 index 00000000000..77516ee91e1 --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2alpha/project_service.update_logging_config.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(loggingConfig) { + // [START retail_v2alpha_generated_ProjectService_UpdateLoggingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 LoggingConfig google.cloud.retail.v2alpha.LoggingConfig to + * update. + * If the caller does not have permission to update the + * LoggingConfig google.cloud.retail.v2alpha.LoggingConfig, then a + * PERMISSION_DENIED error is returned. + * If the LoggingConfig google.cloud.retail.v2alpha.LoggingConfig to update + * does not exist, a NOT_FOUND error is returned. + */ + // const loggingConfig = {} + /** + * Indicates which fields in the provided + * LoggingConfig google.cloud.retail.v2alpha.LoggingConfig to update. The + * following are the only supported fields: + * * LoggingConfig.default_log_generation_rule google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule + * * LoggingConfig.service_log_generation_rules google.cloud.retail.v2alpha.LoggingConfig.service_log_generation_rules + * If not set, all supported fields are updated. + */ + // const updateMask = {} + + // Imports the Retail library + const {ProjectServiceClient} = require('@google-cloud/retail').v2alpha; + + // Instantiates a client + const retailClient = new ProjectServiceClient(); + + async function callUpdateLoggingConfig() { + // Construct request + const request = { + loggingConfig, + }; + + // Run request + const response = await retailClient.updateLoggingConfig(request); + console.log(response); + } + + callUpdateLoggingConfig(); + // [END retail_v2alpha_generated_ProjectService_UpdateLoggingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js index 038f20a6a39..c0431b909e1 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2alpha/search_service.search.js @@ -34,7 +34,7 @@ function main(placement, visitorId) { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. */ // const placement = 'abc123' /** @@ -99,8 +99,8 @@ function main(placement, visitorId) { /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * Filter (https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const filter = 'abc123' @@ -108,22 +108,21 @@ function main(placement, visitorId) { * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * SearchRequest.canonical_filter google.cloud.retail.v2alpha.SearchRequest.canonical_filter - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See - * SearchRequest.filter google.cloud.retail.v2alpha.SearchRequest.filter - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * SearchRequest.filter google.cloud.retail.v2alpha.SearchRequest.filter. */ // const canonicalFilter = 'abc123' /** * The order in which products are returned. Products can be ordered by * a field in an Product google.cloud.retail.v2alpha.Product object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * Order (https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const orderBy = 'abc123' @@ -134,8 +133,8 @@ function main(placement, visitorId) { */ // const facetSpecs = [1,2,3,4] /** - * Boost specification to boost certain products. See more details at this - * user guide (https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * Boost results (https://cloud.google.com/retail/docs/boosting). * Notice that if both * ServingConfig.boost_control_ids google.cloud.retail.v2alpha.ServingConfig.boost_control_ids * and @@ -147,8 +146,8 @@ function main(placement, visitorId) { // const boostSpec = {} /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this user - * guide (https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see Query + * expansion (https://cloud.google.com/retail/docs/result-size#query_expansion). */ // const queryExpansionSpec = {} /** @@ -156,8 +155,8 @@ function main(placement, visitorId) { * Defaults to * RelevanceThreshold.HIGH google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH, * which means only the most relevant results are shown, and the least number - * of results are returned. See more details at this user - * guide (https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + * of results are returned. For more information, see Adjust result + * size (https://cloud.google.com/retail/docs/result-size#relevance_thresholding). */ // const relevanceThreshold = {} /** @@ -281,9 +280,9 @@ function main(placement, visitorId) { * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See Google Cloud - * Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see Requirements for + * labels (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. */ // const labels = [1,2,3,4] /** diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json index 40b0172357e..7089b5a7277 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json +++ b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata.google.cloud.retail.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata_google.cloud.retail.v2alpha.json b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata_google.cloud.retail.v2alpha.json index f60cb2c65ef..1307c26bea4 100644 --- a/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata_google.cloud.retail.v2alpha.json +++ b/packages/google-cloud-retail/samples/generated/v2alpha/snippet_metadata_google.cloud.retail.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { @@ -59,6 +59,94 @@ } } }, + { + "regionTag": "retail_v2alpha_generated_BranchService_ListBranches_async", + "title": "AnalyticsService listBranches Sample", + "origin": "API_DEFINITION", + "description": " Lists all [Branch][google.cloud.retail.v2alpha.Branch]s under the specified parent [Catalog][google.cloud.retail.v2alpha.Catalog].", + "canonical": true, + "file": "branch_service.list_branches.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBranches", + "fullName": "google.cloud.retail.v2alpha.BranchService.ListBranches", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.retail.v2alpha.BranchView" + } + ], + "resultType": ".google.cloud.retail.v2alpha.ListBranchesResponse", + "client": { + "shortName": "BranchServiceClient", + "fullName": "google.cloud.retail.v2alpha.BranchServiceClient" + }, + "method": { + "shortName": "ListBranches", + "fullName": "google.cloud.retail.v2alpha.BranchService.ListBranches", + "service": { + "shortName": "BranchService", + "fullName": "google.cloud.retail.v2alpha.BranchService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_BranchService_GetBranch_async", + "title": "AnalyticsService getBranch Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a [Branch][google.cloud.retail.v2alpha.Branch].", + "canonical": true, + "file": "branch_service.get_branch.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBranch", + "fullName": "google.cloud.retail.v2alpha.BranchService.GetBranch", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.retail.v2alpha.BranchView" + } + ], + "resultType": ".google.cloud.retail.v2alpha.Branch", + "client": { + "shortName": "BranchServiceClient", + "fullName": "google.cloud.retail.v2alpha.BranchServiceClient" + }, + "method": { + "shortName": "GetBranch", + "fullName": "google.cloud.retail.v2alpha.BranchService.GetBranch", + "service": { + "shortName": "BranchService", + "fullName": "google.cloud.retail.v2alpha.BranchService" + } + } + } + }, { "regionTag": "retail_v2alpha_generated_CatalogService_ListCatalogs_async", "title": "AnalyticsService listCatalogs Sample", @@ -1766,7 +1854,7 @@ "segments": [ { "start": 25, - "end": 99, + "end": 104, "type": "FULL" } ], @@ -1879,7 +1967,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_AddFulfillmentPlaces_async", "title": "AnalyticsService addFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.add_fulfillment_places.js", "language": "JAVASCRIPT", @@ -1935,7 +2023,7 @@ "regionTag": "retail_v2alpha_generated_ProductService_RemoveFulfillmentPlaces_async", "title": "AnalyticsService removeFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.remove_fulfillment_places.js", "language": "JAVASCRIPT", @@ -2095,6 +2183,338 @@ } } }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_GetProject_async", + "title": "AnalyticsService getProject Sample", + "origin": "API_DEFINITION", + "description": " Gets the project. Throws `NOT_FOUND` if the project wasn't initialized for the Retail API service.", + "canonical": true, + "file": "project_service.get_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProject", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2alpha.Project", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "GetProject", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetProject", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_AcceptTerms_async", + "title": "AnalyticsService acceptTerms Sample", + "origin": "API_DEFINITION", + "description": " Accepts service terms for this project. By making requests to this API, you agree to the terms of service linked below. https://cloud.google.com/retail/data-use-terms", + "canonical": true, + "file": "project_service.accept_terms.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcceptTerms", + "fullName": "google.cloud.retail.v2alpha.ProjectService.AcceptTerms", + "async": true, + "parameters": [ + { + "name": "project", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2alpha.Project", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "AcceptTerms", + "fullName": "google.cloud.retail.v2alpha.ProjectService.AcceptTerms", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_EnrollSolution_async", + "title": "AnalyticsService enrollSolution Sample", + "origin": "API_DEFINITION", + "description": " The method enrolls a solution of type [Retail Search][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH] into a project. The [Recommendations AI solution type][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION] is enrolled by default when your project enables Retail API, so you don't need to call the enrollSolution method for recommendations.", + "canonical": true, + "file": "project_service.enroll_solution.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnrollSolution", + "fullName": "google.cloud.retail.v2alpha.ProjectService.EnrollSolution", + "async": true, + "parameters": [ + { + "name": "project", + "type": "TYPE_STRING" + }, + { + "name": "solution", + "type": ".google.cloud.retail.v2alpha.SolutionType" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "EnrollSolution", + "fullName": "google.cloud.retail.v2alpha.ProjectService.EnrollSolution", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_ListEnrolledSolutions_async", + "title": "AnalyticsService listEnrolledSolutions Sample", + "origin": "API_DEFINITION", + "description": " Lists all the retail API solutions the project has enrolled.", + "canonical": true, + "file": "project_service.list_enrolled_solutions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEnrolledSolutions", + "fullName": "google.cloud.retail.v2alpha.ProjectService.ListEnrolledSolutions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "ListEnrolledSolutions", + "fullName": "google.cloud.retail.v2alpha.ProjectService.ListEnrolledSolutions", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_GetLoggingConfig_async", + "title": "AnalyticsService getLoggingConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of the requested project.", + "canonical": true, + "file": "project_service.get_logging_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetLoggingConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetLoggingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2alpha.LoggingConfig", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "GetLoggingConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetLoggingConfig", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_UpdateLoggingConfig_async", + "title": "AnalyticsService updateLoggingConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the [LoggingConfig][google.cloud.retail.v2alpha.LoggingConfig] of the requested project.", + "canonical": true, + "file": "project_service.update_logging_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateLoggingConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfig", + "async": true, + "parameters": [ + { + "name": "logging_config", + "type": ".google.cloud.retail.v2alpha.LoggingConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.retail.v2alpha.LoggingConfig", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "UpdateLoggingConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.UpdateLoggingConfig", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_GetAlertConfig_async", + "title": "AnalyticsService getAlertConfig Sample", + "origin": "API_DEFINITION", + "description": " Get the [AlertConfig][google.cloud.retail.v2alpha.AlertConfig] of the requested project.", + "canonical": true, + "file": "project_service.get_alert_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAlertConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetAlertConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.retail.v2alpha.AlertConfig", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "GetAlertConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.GetAlertConfig", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, + { + "regionTag": "retail_v2alpha_generated_ProjectService_UpdateAlertConfig_async", + "title": "AnalyticsService updateAlertConfig Sample", + "origin": "API_DEFINITION", + "description": " Update the alert config of the requested project.", + "canonical": true, + "file": "project_service.update_alert_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAlertConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfig", + "async": true, + "parameters": [ + { + "name": "alert_config", + "type": ".google.cloud.retail.v2alpha.AlertConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.retail.v2alpha.AlertConfig", + "client": { + "shortName": "ProjectServiceClient", + "fullName": "google.cloud.retail.v2alpha.ProjectServiceClient" + }, + "method": { + "shortName": "UpdateAlertConfig", + "fullName": "google.cloud.retail.v2alpha.ProjectService.UpdateAlertConfig", + "service": { + "shortName": "ProjectService", + "fullName": "google.cloud.retail.v2alpha.ProjectService" + } + } + } + }, { "regionTag": "retail_v2alpha_generated_SearchService_Search_async", "title": "AnalyticsService search Sample", @@ -2106,7 +2526,7 @@ "segments": [ { "start": 25, - "end": 324, + "end": 323, "type": "FULL" } ], diff --git a/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js b/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js index e31a490f781..49e054fbce3 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/completion_service.complete_query.js @@ -94,10 +94,15 @@ function main(catalog, query) { */ // const maxSuggestions = 1234 /** - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * If true, attribute suggestions are enabled and provided in response. + * This field is only available for "cloud-retail" dataset. + */ + // const enableAttributeSuggestions = true + /** + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * UserEvent.entity google.cloud.retail.v2beta.UserEvent.entity to get * per-entity autocomplete results. */ diff --git a/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js index 1f6c0b82efc..bc070253a5f 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.import_products.js @@ -45,7 +45,8 @@ function main(parent, inputConfig) { // const errorsConfig = {} /** * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. */ // const updateMask = {} /** @@ -62,9 +63,13 @@ function main(parent, inputConfig) { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * ImportProductsRequest.parent google.cloud.retail.v2beta.ImportProductsRequest.parent. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * Only supported when + * ImportProductsRequest.reconciliation_mode google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode + * is set to `FULL`. */ // const notificationPubsubTopic = 'abc123' diff --git a/packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js b/packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js new file mode 100644 index 00000000000..94d1b0efdca --- /dev/null +++ b/packages/google-cloud-retail/samples/generated/v2beta/product_service.purge_products.js @@ -0,0 +1,104 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 retail_v2beta_generated_ProductService_PurgeProducts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + */ + // const parent = 'abc123' + /** + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * The eligible fields for filtering are: + * * `availability`: Double quoted + * Product.availability google.cloud.retail.v2beta.Product.availability + * string. + * * `create_time` : in ISO 8601 "zulu" format. + * Supported syntax: + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + */ + // const filter = 'abc123' + /** + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + */ + // const force = true + + // Imports the Retail library + const {ProductServiceClient} = require('@google-cloud/retail').v2beta; + + // Instantiates a client + const retailClient = new ProductServiceClient(); + + async function callPurgeProducts() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const [operation] = await retailClient.purgeProducts(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPurgeProducts(); + // [END retail_v2beta_generated_ProductService_PurgeProducts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js b/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js index ff9daac1b56..d562dea2cb1 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js +++ b/packages/google-cloud-retail/samples/generated/v2beta/search_service.search.js @@ -34,7 +34,7 @@ function main(placement, visitorId) { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. */ // const placement = 'abc123' /** @@ -98,8 +98,8 @@ function main(placement, visitorId) { /** * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * Filter (https://cloud.google.com/retail/docs/filter-and-order#filter). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const filter = 'abc123' @@ -107,21 +107,21 @@ function main(placement, visitorId) { * The default filter that is applied when a user performs a search without * checking any filters on the search page. * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * SearchRequest.canonical_filter google.cloud.retail.v2beta.SearchRequest.canonical_filter - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * See SearchRequest.filter google.cloud.retail.v2beta.SearchRequest.filter - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * For more information about filter syntax, see + * SearchRequest.filter google.cloud.retail.v2beta.SearchRequest.filter. */ // const canonicalFilter = 'abc123' /** * The order in which products are returned. Products can be ordered by * a field in an Product google.cloud.retail.v2beta.Product object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this user - * guide (https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * Order (https://cloud.google.com/retail/docs/filter-and-order#order). * If this field is unrecognizable, an INVALID_ARGUMENT is returned. */ // const orderBy = 'abc123' @@ -132,8 +132,8 @@ function main(placement, visitorId) { */ // const facetSpecs = [1,2,3,4] /** - * Boost specification to boost certain products. See more details at this - * user guide (https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * Boost results (https://cloud.google.com/retail/docs/boosting). * Notice that if both * ServingConfig.boost_control_ids google.cloud.retail.v2beta.ServingConfig.boost_control_ids * and @@ -145,8 +145,8 @@ function main(placement, visitorId) { // const boostSpec = {} /** * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this user - * guide (https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see Query + * expansion (https://cloud.google.com/retail/docs/result-size#query_expansion). */ // const queryExpansionSpec = {} /** @@ -261,9 +261,9 @@ function main(placement, visitorId) { * * The key portion of a label must be unique. However, you can use the same * key with multiple resources. * * Keys must start with a lowercase letter or international character. - * See Google Cloud - * Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see Requirements for + * labels (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. */ // const labels = [1,2,3,4] /** diff --git a/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json index 8b5ed1a3f8f..5f10a3fb35c 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json +++ b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata.google.cloud.retail.v2beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata_google.cloud.retail.v2beta.json b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata_google.cloud.retail.v2beta.json index bd0a708de86..761c2616176 100644 --- a/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata_google.cloud.retail.v2beta.json +++ b/packages/google-cloud-retail/samples/generated/v2beta/snippet_metadata_google.cloud.retail.v2beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-retail", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { @@ -602,7 +602,7 @@ "segments": [ { "start": 25, - "end": 124, + "end": 129, "type": "FULL" } ], @@ -639,6 +639,10 @@ "name": "max_suggestions", "type": "TYPE_INT32" }, + { + "name": "enable_attribute_suggestions", + "type": "TYPE_BOOL" + }, { "name": "entity", "type": "TYPE_STRING" @@ -1571,6 +1575,54 @@ } } }, + { + "regionTag": "retail_v2beta_generated_ProductService_PurgeProducts_async", + "title": "AnalyticsService purgeProducts Sample", + "origin": "API_DEFINITION", + "description": " Permanently deletes all selected [Product][google.cloud.retail.v2beta.Product]s under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2beta.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2beta.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. Depending on the number of [Product][google.cloud.retail.v2beta.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2beta.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2beta.PurgeProductsRequest.force] to false.", + "canonical": true, + "file": "product_service.purge_products.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PurgeProducts", + "fullName": "google.cloud.retail.v2beta.ProductService.PurgeProducts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProductServiceClient", + "fullName": "google.cloud.retail.v2beta.ProductServiceClient" + }, + "method": { + "shortName": "PurgeProducts", + "fullName": "google.cloud.retail.v2beta.ProductService.PurgeProducts", + "service": { + "shortName": "ProductService", + "fullName": "google.cloud.retail.v2beta.ProductService" + } + } + } + }, { "regionTag": "retail_v2beta_generated_ProductService_ImportProducts_async", "title": "AnalyticsService importProducts Sample", @@ -1582,7 +1634,7 @@ "segments": [ { "start": 25, - "end": 90, + "end": 95, "type": "FULL" } ], @@ -1691,7 +1743,7 @@ "regionTag": "retail_v2beta_generated_ProductService_AddFulfillmentPlaces_async", "title": "AnalyticsService addFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.add_fulfillment_places.js", "language": "JAVASCRIPT", @@ -1747,7 +1799,7 @@ "regionTag": "retail_v2beta_generated_ProductService_RemoveFulfillmentPlaces_async", "title": "AnalyticsService removeFulfillmentPlaces Sample", "origin": "API_DEFINITION", - "description": " It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", + "description": " We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.", "canonical": true, "file": "product_service.remove_fulfillment_places.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-retail/samples/package.json b/packages/google-cloud-retail/samples/package.json index 3cba92e49ff..b8deb3800c7 100644 --- a/packages/google-cloud-retail/samples/package.json +++ b/packages/google-cloud-retail/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha" }, "dependencies": { - "@google-cloud/retail": "^3.4.0", + "@google-cloud/retail": "^3.5.0", "@google-cloud/bigquery": "^7.0.0", "@google-cloud/storage": "^7.0.0" }, diff --git a/packages/google-cloud-retail/src/v2/completion_service_client.ts b/packages/google-cloud-retail/src/v2/completion_service_client.ts index 66d8ff6d20c..d82deee764b 100644 --- a/packages/google-cloud-retail/src/v2/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2/completion_service_client.ts @@ -522,11 +522,15 @@ export class CompletionServiceClient { * * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. + * @param {boolean} request.enableAttributeSuggestions + * If true, attribute suggestions are enabled and provided in response. + * + * This field is only available for "cloud-retail" dataset. * @param {string} request.entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * {@link protos.google.cloud.retail.v2.UserEvent.entity|UserEvent.entity} to get * per-entity autocomplete results. * @param {object} [options] diff --git a/packages/google-cloud-retail/src/v2/gapic_metadata.json b/packages/google-cloud-retail/src/v2/gapic_metadata.json index 67732385f14..d593e2fde40 100644 --- a/packages/google-cloud-retail/src/v2/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2/gapic_metadata.json @@ -406,6 +406,11 @@ "deleteProduct" ] }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, "ImportProducts": { "methods": [ "importProducts" @@ -468,6 +473,11 @@ "deleteProduct" ] }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, "ImportProducts": { "methods": [ "importProducts" diff --git a/packages/google-cloud-retail/src/v2/product_service_client.ts b/packages/google-cloud-retail/src/v2/product_service_client.ts index 50543f64c5a..82a7d96df1d 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2/product_service_client.ts @@ -282,6 +282,12 @@ export class ProductServiceClient { this.operationsClient = this._gaxModule .lro(lroOptions) .operationsClient(opts); + const purgeProductsResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2.PurgeProductsResponse' + ) as gax.protobuf.Type; + const purgeProductsMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2.PurgeProductsMetadata' + ) as gax.protobuf.Type; const importProductsResponse = protoFilesRoot.lookup( '.google.cloud.retail.v2.ImportProductsResponse' ) as gax.protobuf.Type; @@ -320,6 +326,11 @@ export class ProductServiceClient { ) as gax.protobuf.Type; this.descriptors.longrunning = { + purgeProducts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeProductsResponse.decode.bind(purgeProductsResponse), + purgeProductsMetadata.decode.bind(purgeProductsMetadata) + ), importProducts: new this._gaxModule.LongrunningDescriptor( this.operationsClient, importProductsResponse.decode.bind(importProductsResponse), @@ -415,6 +426,7 @@ export class ProductServiceClient { 'listProducts', 'updateProduct', 'deleteProduct', + 'purgeProducts', 'importProducts', 'setInventory', 'addFulfillmentPlaces', @@ -947,6 +959,204 @@ export class ProductServiceClient { return this.innerApiCalls.deleteProduct(request, options, callback); } + /** + * Permanently deletes all selected {@link protos.google.cloud.retail.v2.Product|Product}s + * under a branch. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed offline. Depending on the number of + * {@link protos.google.cloud.retail.v2.Product|Product}s, this operation could take hours + * to complete. Before the operation completes, some + * {@link protos.google.cloud.retail.v2.Product|Product}s may still be returned by + * {@link protos.google.cloud.retail.v2.ProductService.GetProduct|ProductService.GetProduct} + * or + * {@link protos.google.cloud.retail.v2.ProductService.ListProducts|ProductService.ListProducts}. + * + * Depending on the number of {@link protos.google.cloud.retail.v2.Product|Product}s, this + * operation could take hours to complete. To get a sample of + * {@link protos.google.cloud.retail.v2.Product|Product}s that would be deleted, set + * {@link protos.google.cloud.retail.v2.PurgeProductsRequest.force|PurgeProductsRequest.force} + * to false. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * @param {string} request.filter + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * + * The eligible fields for filtering are: + * + * * `availability`: Double quoted + * {@link protos.google.cloud.retail.v2.Product.availability|Product.availability} string. + * * `create_time` : in ISO 8601 "zulu" format. + * + * Supported syntax: + * + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * @param {boolean} request.force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/product_service.purge_products.js + * region_tag:retail_v2_generated_ProductService_PurgeProducts_async + */ + purgeProducts( + request?: protos.google.cloud.retail.v2.IPurgeProductsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + purgeProducts( + request: protos.google.cloud.retail.v2.IPurgeProductsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeProducts( + request: protos.google.cloud.retail.v2.IPurgeProductsRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeProducts( + request?: protos.google.cloud.retail.v2.IPurgeProductsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >, + 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.purgeProducts(request, options, callback); + } + /** + * Check the status of the long running operation returned by `purgeProducts()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/product_service.purge_products.js + * region_tag:retail_v2_generated_ProductService_PurgeProducts_async + */ + async checkPurgeProductsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2.PurgeProductsResponse, + protos.google.cloud.retail.v2.PurgeProductsMetadata + > + > { + 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.purgeProducts, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2.PurgeProductsResponse, + protos.google.cloud.retail.v2.PurgeProductsMetadata + >; + } /** * Bulk import of multiple {@link protos.google.cloud.retail.v2.Product|Product}s. * @@ -972,7 +1182,8 @@ export class ProductServiceClient { * The desired location of errors incurred during the Import. * @param {google.protobuf.FieldMask} request.updateMask * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * @param {google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode} request.reconciliationMode * The mode of reconciliation between existing products and the products to be * imported. Defaults to @@ -986,9 +1197,14 @@ export class ProductServiceClient { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * {@link protos.google.cloud.retail.v2.ImportProductsRequest.parent|ImportProductsRequest.parent}. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * + * Only supported when + * {@link protos.google.cloud.retail.v2.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} + * is set to `FULL`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1379,10 +1595,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2.ProductService.AddLocalInventories|ProductService.AddLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2.ProductService.AddLocalInventories|ProductService.AddLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -1597,10 +1814,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/packages/google-cloud-retail/src/v2/product_service_client_config.json b/packages/google-cloud-retail/src/v2/product_service_client_config.json index 32245ac6134..4d90adbfa4c 100644 --- a/packages/google-cloud-retail/src/v2/product_service_client_config.json +++ b/packages/google-cloud-retail/src/v2/product_service_client_config.json @@ -63,6 +63,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, + "PurgeProducts": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, "ImportProducts": { "timeout_millis": 300000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-retail/src/v2/search_service_client.ts b/packages/google-cloud-retail/src/v2/search_service_client.ts index 63b20af2331..058247ed5eb 100644 --- a/packages/google-cloud-retail/src/v2/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2/search_service_client.ts @@ -467,7 +467,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -522,8 +522,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -531,20 +531,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter} for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2.Product|Product} object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -559,8 +559,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -571,8 +571,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2.Product.Type.VARIANT|variant} @@ -645,7 +645,7 @@ export class SearchServiceClient { * If this field is set to an invalid value other than these, an * INVALID_ARGUMENT error is returned. * @param {string[]} request.pageCategories - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * {@link protos.google.cloud.retail.v2.UserEvent.page_categories|UserEvent.page_categories}; @@ -686,9 +686,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -788,7 +788,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -843,8 +843,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -852,20 +852,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter} for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2.Product|Product} object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -880,8 +880,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -892,8 +892,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2.Product.Type.VARIANT|variant} @@ -966,7 +966,7 @@ export class SearchServiceClient { * If this field is set to an invalid value other than these, an * INVALID_ARGUMENT error is returned. * @param {string[]} request.pageCategories - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * {@link protos.google.cloud.retail.v2.UserEvent.page_categories|UserEvent.page_categories}; @@ -1007,9 +1007,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -1065,7 +1065,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -1120,8 +1120,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -1129,20 +1129,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter} for - * more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2.Product|Product} object. Leave it - * unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -1157,8 +1157,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -1169,8 +1169,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2.Product.Type.VARIANT|variant} @@ -1243,7 +1243,7 @@ export class SearchServiceClient { * If this field is set to an invalid value other than these, an * INVALID_ARGUMENT error is returned. * @param {string[]} request.pageCategories - * The categories associated with a category page. Required for category + * The categories associated with a category page. Must be set for category * navigation queries to achieve good search quality. The format should be * the same as * {@link protos.google.cloud.retail.v2.UserEvent.page_categories|UserEvent.page_categories}; @@ -1284,9 +1284,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. diff --git a/packages/google-cloud-retail/src/v2/user_event_service_client_config.json b/packages/google-cloud-retail/src/v2/user_event_service_client_config.json index a3938b37468..aad8b4c9f5b 100644 --- a/packages/google-cloud-retail/src/v2/user_event_service_client_config.json +++ b/packages/google-cloud-retail/src/v2/user_event_service_client_config.json @@ -48,12 +48,12 @@ }, "methods": { "WriteUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, "CollectUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, @@ -68,7 +68,7 @@ "retry_params_name": "49abb7cadc111ff8dd551b61fcad123362c8d090" }, "RejoinUserEvents": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" } diff --git a/packages/google-cloud-retail/src/v2alpha/analytics_service_client.ts b/packages/google-cloud-retail/src/v2alpha/analytics_service_client.ts index e28abebef2f..070bf371f21 100644 --- a/packages/google-cloud-retail/src/v2alpha/analytics_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/analytics_service_client.ts @@ -208,9 +208,15 @@ export class AnalyticsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -220,6 +226,9 @@ export class AnalyticsServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -229,6 +238,9 @@ export class AnalyticsServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -876,6 +888,30 @@ export class AnalyticsServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -931,6 +967,73 @@ export class AnalyticsServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1102,6 +1205,30 @@ export class AnalyticsServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1328,6 +1455,30 @@ export class AnalyticsServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/analytics_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/analytics_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/analytics_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/analytics_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/branch_service_client.ts b/packages/google-cloud-retail/src/v2alpha/branch_service_client.ts new file mode 100644 index 00000000000..7b1ec09ee55 --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/branch_service_client.ts @@ -0,0 +1,1586 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v2alpha/branch_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './branch_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for {@link protos.google.cloud.retail.v2alpha.Branch|Branch} Management + * + * {@link protos.google.cloud.retail.v2alpha.Branch|Branch}es are automatically created when + * a {@link protos.google.cloud.retail.v2alpha.Catalog|Catalog} is created. There are fixed + * three branches in each catalog, and may use + * {@link protos.google.cloud.retail.v2alpha.BranchService.ListBranches|ListBranches} method + * to get the details of all branches. + * @class + * @memberof v2alpha + */ +export class BranchServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + 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; + branchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BranchServiceClient. + * + * @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 BranchServiceClient({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 BranchServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'retail.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), + catalogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}' + ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), + merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' + ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), + }; + + 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: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', + }, + {get: '/v2alpha/{name=projects/*/locations/*/operations/*}'}, + {get: '/v2alpha/{name=projects/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*}/operations', + additional_bindings: [ + {get: '/v2alpha/{name=projects/*/locations/*}/operations'}, + {get: '/v2alpha/{name=projects/*}/operations'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + + this.descriptors.longrunning = {}; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.retail.v2alpha.BranchService', + 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.branchServiceStub) { + return this.branchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.retail.v2alpha.BranchService. + this.branchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.retail.v2alpha.BranchService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.retail.v2alpha.BranchService, + 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 branchServiceStubMethods = ['listBranches', 'getBranch']; + for (const methodName of branchServiceStubMethods) { + const callPromise = this.branchServiceStub.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.branchServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Lists all {@link protos.google.cloud.retail.v2alpha.Branch|Branch}s under the specified + * parent {@link protos.google.cloud.retail.v2alpha.Catalog|Catalog}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent catalog resource name. + * @param {google.cloud.retail.v2alpha.BranchView} request.view + * The view to apply to the returned + * {@link protos.google.cloud.retail.v2alpha.Branch|Branch}. Defaults to + * [Branch.BranchView.BASIC] if unspecified. + * See documentation of fields of {@link protos.google.cloud.retail.v2alpha.Branch|Branch} + * to find what fields are excluded from 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.retail.v2alpha.ListBranchesResponse|ListBranchesResponse}. + * 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/v2alpha/branch_service.list_branches.js + * region_tag:retail_v2alpha_generated_BranchService_ListBranches_async + */ + listBranches( + request?: protos.google.cloud.retail.v2alpha.IListBranchesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + protos.google.cloud.retail.v2alpha.IListBranchesRequest | undefined, + {} | undefined, + ] + >; + listBranches( + request: protos.google.cloud.retail.v2alpha.IListBranchesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + | protos.google.cloud.retail.v2alpha.IListBranchesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listBranches( + request: protos.google.cloud.retail.v2alpha.IListBranchesRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + | protos.google.cloud.retail.v2alpha.IListBranchesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listBranches( + request?: protos.google.cloud.retail.v2alpha.IListBranchesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + | protos.google.cloud.retail.v2alpha.IListBranchesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + | protos.google.cloud.retail.v2alpha.IListBranchesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IListBranchesResponse, + protos.google.cloud.retail.v2alpha.IListBranchesRequest | 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.listBranches(request, options, callback); + } + /** + * Retrieves a {@link protos.google.cloud.retail.v2alpha.Branch|Branch}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the branch to retrieve. + * Format: + * `projects/* /locations/global/catalogs/default_catalog/branches/some_branch_id`. + * + * "default_branch" can be used as a special branch_id, it returns the + * default branch that has been set for the catalog. + * @param {google.cloud.retail.v2alpha.BranchView} request.view + * The view to apply to the returned + * {@link protos.google.cloud.retail.v2alpha.Branch|Branch}. Defaults to + * [Branch.BranchView.BASIC] if unspecified. + * See documentation of fields of {@link protos.google.cloud.retail.v2alpha.Branch|Branch} + * to find what fields are excluded from 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.retail.v2alpha.Branch|Branch}. + * 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/v2alpha/branch_service.get_branch.js + * region_tag:retail_v2alpha_generated_BranchService_GetBranch_async + */ + getBranch( + request?: protos.google.cloud.retail.v2alpha.IGetBranchRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IBranch, + protos.google.cloud.retail.v2alpha.IGetBranchRequest | undefined, + {} | undefined, + ] + >; + getBranch( + request: protos.google.cloud.retail.v2alpha.IGetBranchRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IBranch, + protos.google.cloud.retail.v2alpha.IGetBranchRequest | null | undefined, + {} | null | undefined + > + ): void; + getBranch( + request: protos.google.cloud.retail.v2alpha.IGetBranchRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IBranch, + protos.google.cloud.retail.v2alpha.IGetBranchRequest | null | undefined, + {} | null | undefined + > + ): void; + getBranch( + request?: protos.google.cloud.retail.v2alpha.IGetBranchRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IBranch, + | protos.google.cloud.retail.v2alpha.IGetBranchRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IBranch, + protos.google.cloud.retail.v2alpha.IGetBranchRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IBranch, + protos.google.cloud.retail.v2alpha.IGetBranchRequest | 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.getBranch(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 alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + + /** + * Return a fully-qualified catalog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + catalogPath(project: string, location: string, catalog: string) { + return this.pathTemplates.catalogPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).project; + } + + /** + * Parse the location from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).location; + } + + /** + * Parse the catalog from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; + } + + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + + /** + * Return a fully-qualified merchantCenterAccountLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} merchant_center_account_link + * @returns {string} Resource name string. + */ + merchantCenterAccountLinkPath( + project: string, + location: string, + catalog: string, + merchantCenterAccountLink: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + merchant_center_account_link: merchantCenterAccountLink, + }); + } + + /** + * Parse the project from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).project; + } + + /** + * Parse the location from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).location; + } + + /** + * Parse the catalog from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).catalog; + } + + /** + * Parse the merchant_center_account_link from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the merchant_center_account_link. + */ + matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).merchant_center_account_link; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, catalog: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + 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 catalog from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).catalog; + } + + /** + * 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 product resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @param {string} product + * @returns {string} Resource name string. + */ + productPath( + project: string, + location: string, + catalog: string, + branch: string, + product: string + ) { + return this.pathTemplates.productPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + product: product, + }); + } + + /** + * Parse the project from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).project; + } + + /** + * Parse the location from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).location; + } + + /** + * Parse the catalog from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).catalog; + } + + /** + * Parse the branch from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).branch; + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + + /** + * 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.branchServiceStub && !this._terminated) { + return this.branchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-retail/src/v2alpha/branch_service_client_config.json b/packages/google-cloud-retail/src/v2alpha/branch_service_client_config.json new file mode 100644 index 00000000000..92fe8a070c6 --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/branch_service_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.retail.v2alpha.BranchService": { + "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 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListBranches": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetBranch": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + } + } + } + } +} diff --git a/packages/google-cloud-retail/src/v2alpha/branch_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/branch_service_proto_list.json new file mode 100644 index 00000000000..4bc966a9a7f --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/branch_service_proto_list.json @@ -0,0 +1,29 @@ +[ + "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", + "../../protos/google/cloud/retail/v2alpha/catalog.proto", + "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", + "../../protos/google/cloud/retail/v2alpha/common.proto", + "../../protos/google/cloud/retail/v2alpha/completion_service.proto", + "../../protos/google/cloud/retail/v2alpha/control.proto", + "../../protos/google/cloud/retail/v2alpha/control_service.proto", + "../../protos/google/cloud/retail/v2alpha/export_config.proto", + "../../protos/google/cloud/retail/v2alpha/import_config.proto", + "../../protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto", + "../../protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto", + "../../protos/google/cloud/retail/v2alpha/model.proto", + "../../protos/google/cloud/retail/v2alpha/model_service.proto", + "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", + "../../protos/google/cloud/retail/v2alpha/product.proto", + "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", + "../../protos/google/cloud/retail/v2alpha/promotion.proto", + "../../protos/google/cloud/retail/v2alpha/purge_config.proto", + "../../protos/google/cloud/retail/v2alpha/search_service.proto", + "../../protos/google/cloud/retail/v2alpha/serving_config.proto", + "../../protos/google/cloud/retail/v2alpha/serving_config_service.proto", + "../../protos/google/cloud/retail/v2alpha/user_event.proto", + "../../protos/google/cloud/retail/v2alpha/user_event_service.proto" +] diff --git a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts index c7740d33fe5..2f5f7a6b67c 100644 --- a/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/catalog_service_client.ts @@ -208,6 +208,9 @@ export class CatalogServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), @@ -226,6 +229,9 @@ export class CatalogServiceClient { locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -235,6 +241,9 @@ export class CatalogServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -2178,6 +2187,30 @@ export class CatalogServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -2507,6 +2540,30 @@ export class CatalogServiceClient { return this.pathTemplates.locationPathTemplate.match(locationName).location; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -2733,6 +2790,30 @@ export class CatalogServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/catalog_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/catalog_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/catalog_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/catalog_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts b/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts index fe4a9176aa6..dad2b2f2a9a 100644 --- a/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/completion_service_client.ts @@ -210,9 +210,15 @@ export class CompletionServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -222,6 +228,9 @@ export class CompletionServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -231,6 +240,9 @@ export class CompletionServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -533,10 +545,10 @@ export class CompletionServiceClient { * * This field is only available for "cloud-retail" dataset. * @param {string} request.entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * {@link protos.google.cloud.retail.v2alpha.UserEvent.entity|UserEvent.entity} to get * per-entity autocomplete results. * @param {object} [options] @@ -1034,6 +1046,30 @@ export class CompletionServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1089,6 +1125,73 @@ export class CompletionServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1260,6 +1363,30 @@ export class CompletionServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1486,6 +1613,30 @@ export class CompletionServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/completion_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/completion_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/completion_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/completion_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/control_service_client.ts b/packages/google-cloud-retail/src/v2alpha/control_service_client.ts index a2475adc0a3..3fdc7aede2a 100644 --- a/packages/google-cloud-retail/src/v2alpha/control_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/control_service_client.ts @@ -208,9 +208,15 @@ export class ControlServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -220,6 +226,9 @@ export class ControlServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -229,6 +238,9 @@ export class ControlServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -1314,6 +1326,30 @@ export class ControlServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1369,6 +1405,73 @@ export class ControlServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1540,6 +1643,30 @@ export class ControlServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1766,6 +1893,30 @@ export class ControlServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/control_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/control_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/control_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/control_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json b/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json index 52e27615c2e..9bcff77712e 100644 --- a/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2alpha/gapic_metadata.json @@ -29,6 +29,40 @@ } } }, + "BranchService": { + "clients": { + "grpc": { + "libraryClient": "BranchServiceClient", + "rpcs": { + "ListBranches": { + "methods": [ + "listBranches" + ] + }, + "GetBranch": { + "methods": [ + "getBranch" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BranchServiceClient", + "rpcs": { + "ListBranches": { + "methods": [ + "listBranches" + ] + }, + "GetBranch": { + "methods": [ + "getBranch" + ] + } + } + } + } + }, "CatalogService": { "clients": { "grpc": { @@ -573,6 +607,100 @@ } } }, + "ProjectService": { + "clients": { + "grpc": { + "libraryClient": "ProjectServiceClient", + "rpcs": { + "GetProject": { + "methods": [ + "getProject" + ] + }, + "AcceptTerms": { + "methods": [ + "acceptTerms" + ] + }, + "ListEnrolledSolutions": { + "methods": [ + "listEnrolledSolutions" + ] + }, + "GetLoggingConfig": { + "methods": [ + "getLoggingConfig" + ] + }, + "UpdateLoggingConfig": { + "methods": [ + "updateLoggingConfig" + ] + }, + "GetAlertConfig": { + "methods": [ + "getAlertConfig" + ] + }, + "UpdateAlertConfig": { + "methods": [ + "updateAlertConfig" + ] + }, + "EnrollSolution": { + "methods": [ + "enrollSolution" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProjectServiceClient", + "rpcs": { + "GetProject": { + "methods": [ + "getProject" + ] + }, + "AcceptTerms": { + "methods": [ + "acceptTerms" + ] + }, + "ListEnrolledSolutions": { + "methods": [ + "listEnrolledSolutions" + ] + }, + "GetLoggingConfig": { + "methods": [ + "getLoggingConfig" + ] + }, + "UpdateLoggingConfig": { + "methods": [ + "updateLoggingConfig" + ] + }, + "GetAlertConfig": { + "methods": [ + "getAlertConfig" + ] + }, + "UpdateAlertConfig": { + "methods": [ + "updateAlertConfig" + ] + }, + "EnrollSolution": { + "methods": [ + "enrollSolution" + ] + } + } + } + } + }, "SearchService": { "clients": { "grpc": { diff --git a/packages/google-cloud-retail/src/v2alpha/index.ts b/packages/google-cloud-retail/src/v2alpha/index.ts index 245594cb986..50de4c92775 100644 --- a/packages/google-cloud-retail/src/v2alpha/index.ts +++ b/packages/google-cloud-retail/src/v2alpha/index.ts @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** export {AnalyticsServiceClient} from './analytics_service_client'; +export {BranchServiceClient} from './branch_service_client'; export {CatalogServiceClient} from './catalog_service_client'; export {CompletionServiceClient} from './completion_service_client'; export {ControlServiceClient} from './control_service_client'; @@ -24,6 +25,7 @@ export {MerchantCenterAccountLinkServiceClient} from './merchant_center_account_ export {ModelServiceClient} from './model_service_client'; export {PredictionServiceClient} from './prediction_service_client'; export {ProductServiceClient} from './product_service_client'; +export {ProjectServiceClient} from './project_service_client'; export {SearchServiceClient} from './search_service_client'; export {ServingConfigServiceClient} from './serving_config_service_client'; export {UserEventServiceClient} from './user_event_service_client'; diff --git a/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_client.ts b/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_client.ts index 6ccedb74164..09ddf48797b 100644 --- a/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_client.ts @@ -208,9 +208,15 @@ export class MerchantCenterAccountLinkServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -220,6 +226,9 @@ export class MerchantCenterAccountLinkServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -229,6 +238,9 @@ export class MerchantCenterAccountLinkServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -470,7 +482,7 @@ export class MerchantCenterAccountLinkServiceClient { * @param {string} request.parent * Required. The parent Catalog of the resource. * It must match this format: - * projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID} + * `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_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. @@ -575,7 +587,7 @@ export class MerchantCenterAccountLinkServiceClient { * The request object that will be sent. * @param {string} request.name * Required. Full resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/merchantCenterAccountLinks/{merchant_center_account_link_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. @@ -679,7 +691,7 @@ export class MerchantCenterAccountLinkServiceClient { * @param {string} request.parent * Required. The branch resource where this MerchantCenterAccountLink will be * created. Format: - * projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}} + * `projects/{PROJECT_NUMBER}/locations/global/catalogs/{CATALOG_ID}` * @param {google.cloud.retail.v2alpha.MerchantCenterAccountLink} request.merchantCenterAccountLink * Required. The * {@link protos.google.cloud.retail.v2alpha.MerchantCenterAccountLink|MerchantCenterAccountLink} @@ -1079,6 +1091,30 @@ export class MerchantCenterAccountLinkServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1134,6 +1170,73 @@ export class MerchantCenterAccountLinkServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1305,6 +1408,30 @@ export class MerchantCenterAccountLinkServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1531,6 +1658,30 @@ export class MerchantCenterAccountLinkServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/merchant_center_account_link_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/model_service_client.ts b/packages/google-cloud-retail/src/v2alpha/model_service_client.ts index d59d30cfeae..8cf1724faf6 100644 --- a/packages/google-cloud-retail/src/v2alpha/model_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/model_service_client.ts @@ -220,9 +220,15 @@ export class ModelServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -232,6 +238,9 @@ export class ModelServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -241,6 +250,9 @@ export class ModelServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -1662,6 +1674,30 @@ export class ModelServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1717,6 +1753,73 @@ export class ModelServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1888,6 +1991,30 @@ export class ModelServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -2114,6 +2241,30 @@ export class ModelServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/model_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/model_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/model_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/model_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts index f0404e14fa5..e0164ba5e4a 100644 --- a/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/prediction_service_client.ts @@ -206,9 +206,15 @@ export class PredictionServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -218,6 +224,9 @@ export class PredictionServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -227,6 +236,9 @@ export class PredictionServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -902,6 +914,30 @@ export class PredictionServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -957,6 +993,73 @@ export class PredictionServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1128,6 +1231,30 @@ export class PredictionServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1354,6 +1481,30 @@ export class PredictionServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/prediction_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/prediction_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/prediction_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/prediction_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts index b88df6867ed..0fce49dfaff 100644 --- a/packages/google-cloud-retail/src/v2alpha/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/product_service_client.ts @@ -210,6 +210,9 @@ export class ProductServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), @@ -225,6 +228,9 @@ export class ProductServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -234,6 +240,9 @@ export class ProductServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -1219,7 +1228,8 @@ export class ProductServiceClient { * The desired location of errors incurred during the Import. * @param {google.protobuf.FieldMask} request.updateMask * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * @param {google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode} request.reconciliationMode * The mode of reconciliation between existing products and the products to be * imported. Defaults to @@ -1233,9 +1243,14 @@ export class ProductServiceClient { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * {@link protos.google.cloud.retail.v2alpha.ImportProductsRequest.parent|ImportProductsRequest.parent}. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * + * Only supported when + * {@link protos.google.cloud.retail.v2alpha.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} + * is set to `FULL`. * @param {boolean} request.skipDefaultBranchProtection * If true, this performs the FULL import even if it would delete a large * proportion of the products in the default branch, which could potentially @@ -1634,10 +1649,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2alpha.ProductService.AddLocalInventories|ProductService.AddLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2alpha.ProductService.AddLocalInventories|ProductService.AddLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -1852,10 +1868,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -3127,6 +3144,30 @@ export class ProductServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -3420,6 +3461,30 @@ export class ProductServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -3646,6 +3711,30 @@ export class ProductServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/product_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/product_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/product_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/product_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/project_service_client.ts b/packages/google-cloud-retail/src/v2alpha/project_service_client.ts new file mode 100644 index 00000000000..28140cece7f --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/project_service_client.ts @@ -0,0 +1,2255 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v2alpha/project_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './project_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for settings at Project level. + * @class + * @memberof v2alpha + */ +export class ProjectServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + 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; + projectServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProjectServiceClient. + * + * @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 ProjectServiceClient({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 ProjectServiceClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'retail.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), + attributesConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' + ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), + catalogPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}' + ), + completionConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/completionConfig' + ), + controlPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' + ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), + merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), + servingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' + ), + }; + + 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: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}', + additional_bindings: [ + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}', + }, + { + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}', + }, + {get: '/v2alpha/{name=projects/*/locations/*/operations/*}'}, + {get: '/v2alpha/{name=projects/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v2alpha/{name=projects/*/locations/*/catalogs/*}/operations', + additional_bindings: [ + {get: '/v2alpha/{name=projects/*/locations/*}/operations'}, + {get: '/v2alpha/{name=projects/*}/operations'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const enrollSolutionResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2alpha.EnrollSolutionResponse' + ) as gax.protobuf.Type; + const enrollSolutionMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2alpha.EnrollSolutionMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + enrollSolution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + enrollSolutionResponse.decode.bind(enrollSolutionResponse), + enrollSolutionMetadata.decode.bind(enrollSolutionMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.retail.v2alpha.ProjectService', + 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.projectServiceStub) { + return this.projectServiceStub; + } + + // Put together the "service stub" for + // google.cloud.retail.v2alpha.ProjectService. + this.projectServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.retail.v2alpha.ProjectService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.retail.v2alpha.ProjectService, + 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 projectServiceStubMethods = [ + 'getProject', + 'acceptTerms', + 'enrollSolution', + 'listEnrolledSolutions', + 'getLoggingConfig', + 'updateLoggingConfig', + 'getAlertConfig', + 'updateAlertConfig', + ]; + for (const methodName of projectServiceStubMethods) { + const callPromise = this.projectServiceStub.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.projectServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'retail.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets the project. + * + * Throws `NOT_FOUND` if the project wasn't initialized for the Retail API + * service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full resource name of the project. Format: + * `projects/{project_number_or_id}/retailProject` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.retail.v2alpha.Project|Project}. + * 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/v2alpha/project_service.get_project.js + * region_tag:retail_v2alpha_generated_ProjectService_GetProject_async + */ + getProject( + request?: protos.google.cloud.retail.v2alpha.IGetProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IGetProjectRequest | undefined, + {} | undefined, + ] + >; + getProject( + request: protos.google.cloud.retail.v2alpha.IGetProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + getProject( + request: protos.google.cloud.retail.v2alpha.IGetProjectRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + getProject( + request?: protos.google.cloud.retail.v2alpha.IGetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IProject, + | protos.google.cloud.retail.v2alpha.IGetProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IGetProjectRequest | 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.getProject(request, options, callback); + } + /** + * Accepts service terms for this project. + * By making requests to this API, you agree to the terms of service linked + * below. + * https://cloud.google.com/retail/data-use-terms + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. Full resource name of the project. Format: + * `projects/{project_number_or_id}/retailProject` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.retail.v2alpha.Project|Project}. + * 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/v2alpha/project_service.accept_terms.js + * region_tag:retail_v2alpha_generated_ProjectService_AcceptTerms_async + */ + acceptTerms( + request?: protos.google.cloud.retail.v2alpha.IAcceptTermsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IAcceptTermsRequest | undefined, + {} | undefined, + ] + >; + acceptTerms( + request: protos.google.cloud.retail.v2alpha.IAcceptTermsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IAcceptTermsRequest | null | undefined, + {} | null | undefined + > + ): void; + acceptTerms( + request: protos.google.cloud.retail.v2alpha.IAcceptTermsRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IAcceptTermsRequest | null | undefined, + {} | null | undefined + > + ): void; + acceptTerms( + request?: protos.google.cloud.retail.v2alpha.IAcceptTermsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IProject, + | protos.google.cloud.retail.v2alpha.IAcceptTermsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IAcceptTermsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IProject, + protos.google.cloud.retail.v2alpha.IAcceptTermsRequest | 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({ + project: request.project ?? '', + }); + this.initialize(); + return this.innerApiCalls.acceptTerms(request, options, callback); + } + /** + * Lists all the retail API solutions the project has enrolled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Full resource name of parent. Format: + * `projects/{project_number_or_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.retail.v2alpha.ListEnrolledSolutionsResponse|ListEnrolledSolutionsResponse}. + * 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/v2alpha/project_service.list_enrolled_solutions.js + * region_tag:retail_v2alpha_generated_ProjectService_ListEnrolledSolutions_async + */ + listEnrolledSolutions( + request?: protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + ( + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | undefined + ), + {} | undefined, + ] + >; + listEnrolledSolutions( + request: protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listEnrolledSolutions( + request: protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listEnrolledSolutions( + request?: protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse, + ( + | protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsRequest + | 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.listEnrolledSolutions(request, options, callback); + } + /** + * Gets the {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig} of the + * requested project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full LoggingConfig resource name. Format: + * projects/{project_number}/loggingConfig + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.retail.v2alpha.LoggingConfig|LoggingConfig}. + * 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/v2alpha/project_service.get_logging_config.js + * region_tag:retail_v2alpha_generated_ProjectService_GetLoggingConfig_async + */ + getLoggingConfig( + request?: protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.ILoggingConfig, + protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest | undefined, + {} | undefined, + ] + >; + getLoggingConfig( + request: protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getLoggingConfig( + request: protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getLoggingConfig( + request?: protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.ILoggingConfig, + protos.google.cloud.retail.v2alpha.IGetLoggingConfigRequest | 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.getLoggingConfig(request, options, callback); + } + /** + * Updates the {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig} of + * the requested project. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2alpha.LoggingConfig} request.loggingConfig + * Required. The {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig} to + * update. + * + * If the caller does not have permission to update the + * {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig}, then a + * PERMISSION_DENIED error is returned. + * + * If the {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig} to update + * does not exist, a NOT_FOUND error is returned. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig} to update. The + * following are the only supported fields: + * + * * {@link protos.google.cloud.retail.v2alpha.LoggingConfig.default_log_generation_rule|LoggingConfig.default_log_generation_rule} + * * {@link protos.google.cloud.retail.v2alpha.LoggingConfig.service_log_generation_rules|LoggingConfig.service_log_generation_rules} + * + * If not set, all supported fields are updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.retail.v2alpha.LoggingConfig|LoggingConfig}. + * 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/v2alpha/project_service.update_logging_config.js + * region_tag:retail_v2alpha_generated_ProjectService_UpdateLoggingConfig_async + */ + updateLoggingConfig( + request?: protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.ILoggingConfig, + ( + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | undefined + ), + {} | undefined, + ] + >; + updateLoggingConfig( + request: protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateLoggingConfig( + request: protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateLoggingConfig( + request?: protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.ILoggingConfig, + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.ILoggingConfig, + ( + | protos.google.cloud.retail.v2alpha.IUpdateLoggingConfigRequest + | 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({ + 'logging_config.name': request.loggingConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateLoggingConfig(request, options, callback); + } + /** + * Get the {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig} of the + * requested project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Full AlertConfig resource name. Format: + * projects/{project_number}/alertConfig + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.retail.v2alpha.AlertConfig|AlertConfig}. + * 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/v2alpha/project_service.get_alert_config.js + * region_tag:retail_v2alpha_generated_ProjectService_GetAlertConfig_async + */ + getAlertConfig( + request?: protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IAlertConfig, + protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest | undefined, + {} | undefined, + ] + >; + getAlertConfig( + request: protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAlertConfig( + request: protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAlertConfig( + request?: protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IAlertConfig, + protos.google.cloud.retail.v2alpha.IGetAlertConfigRequest | 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.getAlertConfig(request, options, callback); + } + /** + * Update the alert config of the requested project. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.retail.v2alpha.AlertConfig} request.alertConfig + * Required. The {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig} to + * update. + * + * If the caller does not have permission to update the + * {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig}, then a + * PERMISSION_DENIED error is returned. + * + * If the {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig} to update + * does not exist, a NOT_FOUND error is returned. + * @param {google.protobuf.FieldMask} request.updateMask + * Indicates which fields in the provided + * {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig} to update. If not + * set, all supported fields are updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.retail.v2alpha.AlertConfig|AlertConfig}. + * 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/v2alpha/project_service.update_alert_config.js + * region_tag:retail_v2alpha_generated_ProjectService_UpdateAlertConfig_async + */ + updateAlertConfig( + request?: protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IAlertConfig, + protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest | undefined, + {} | undefined, + ] + >; + updateAlertConfig( + request: protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAlertConfig( + request: protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, + callback: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAlertConfig( + request?: protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.retail.v2alpha.IAlertConfig, + | protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.retail.v2alpha.IAlertConfig, + protos.google.cloud.retail.v2alpha.IUpdateAlertConfigRequest | 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({ + 'alert_config.name': request.alertConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAlertConfig(request, options, callback); + } + + /** + * The method enrolls a solution of type [Retail + * Search][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_SEARCH] + * into a project. + * + * The [Recommendations AI solution + * type][google.cloud.retail.v2alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION] + * is enrolled by default when your project enables Retail API, so you don't + * need to call the enrollSolution method for recommendations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Required. Full resource name of parent. Format: + * `projects/{project_number_or_id}` + * @param {google.cloud.retail.v2alpha.SolutionType} request.solution + * Required. Solution to enroll. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2alpha/project_service.enroll_solution.js + * region_tag:retail_v2alpha_generated_ProjectService_EnrollSolution_async + */ + enrollSolution( + request?: protos.google.cloud.retail.v2alpha.IEnrollSolutionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + enrollSolution( + request: protos.google.cloud.retail.v2alpha.IEnrollSolutionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + enrollSolution( + request: protos.google.cloud.retail.v2alpha.IEnrollSolutionRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + enrollSolution( + request?: protos.google.cloud.retail.v2alpha.IEnrollSolutionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >, + 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({ + project: request.project ?? '', + }); + this.initialize(); + return this.innerApiCalls.enrollSolution(request, options, callback); + } + /** + * Check the status of the long running operation returned by `enrollSolution()`. + * @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/v2alpha/project_service.enroll_solution.js + * region_tag:retail_v2alpha_generated_ProjectService_EnrollSolution_async + */ + async checkEnrollSolutionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2alpha.EnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.EnrollSolutionMetadata + > + > { + 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.enrollSolution, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2alpha.EnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.EnrollSolutionMetadata + >; + } + /** + * 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 alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + + /** + * Return a fully-qualified attributesConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + attributesConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.attributesConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).project; + } + + /** + * Parse the location from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).location; + } + + /** + * Parse the catalog from AttributesConfig resource. + * + * @param {string} attributesConfigName + * A fully-qualified path representing AttributesConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromAttributesConfigName(attributesConfigName: string) { + return this.pathTemplates.attributesConfigPathTemplate.match( + attributesConfigName + ).catalog; + } + + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + + /** + * Return a fully-qualified catalog resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + catalogPath(project: string, location: string, catalog: string) { + return this.pathTemplates.catalogPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).project; + } + + /** + * Parse the location from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).location; + } + + /** + * Parse the catalog from Catalog resource. + * + * @param {string} catalogName + * A fully-qualified path representing Catalog resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCatalogName(catalogName: string) { + return this.pathTemplates.catalogPathTemplate.match(catalogName).catalog; + } + + /** + * Return a fully-qualified completionConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @returns {string} Resource name string. + */ + completionConfigPath(project: string, location: string, catalog: string) { + return this.pathTemplates.completionConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + }); + } + + /** + * Parse the project from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).project; + } + + /** + * Parse the location from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).location; + } + + /** + * Parse the catalog from CompletionConfig resource. + * + * @param {string} completionConfigName + * A fully-qualified path representing CompletionConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromCompletionConfigName(completionConfigName: string) { + return this.pathTemplates.completionConfigPathTemplate.match( + completionConfigName + ).catalog; + } + + /** + * Return a fully-qualified control resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} control + * @returns {string} Resource name string. + */ + controlPath( + project: string, + location: string, + catalog: string, + control: string + ) { + return this.pathTemplates.controlPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + control: control, + }); + } + + /** + * Parse the project from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the project. + */ + matchProjectFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).project; + } + + /** + * Parse the location from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the location. + */ + matchLocationFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).location; + } + + /** + * Parse the catalog from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).catalog; + } + + /** + * Parse the control from Control resource. + * + * @param {string} controlName + * A fully-qualified path representing Control resource. + * @returns {string} A string representing the control. + */ + matchControlFromControlName(controlName: string) { + return this.pathTemplates.controlPathTemplate.match(controlName).control; + } + + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + + /** + * Return a fully-qualified merchantCenterAccountLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} merchant_center_account_link + * @returns {string} Resource name string. + */ + merchantCenterAccountLinkPath( + project: string, + location: string, + catalog: string, + merchantCenterAccountLink: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + merchant_center_account_link: merchantCenterAccountLink, + }); + } + + /** + * Parse the project from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).project; + } + + /** + * Parse the location from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).location; + } + + /** + * Parse the catalog from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).catalog; + } + + /** + * Parse the merchant_center_account_link from MerchantCenterAccountLink resource. + * + * @param {string} merchantCenterAccountLinkName + * A fully-qualified path representing MerchantCenterAccountLink resource. + * @returns {string} A string representing the merchant_center_account_link. + */ + matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName( + merchantCenterAccountLinkName: string + ) { + return this.pathTemplates.merchantCenterAccountLinkPathTemplate.match( + merchantCenterAccountLinkName + ).merchant_center_account_link; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, catalog: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + 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 catalog from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).catalog; + } + + /** + * 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 product resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @param {string} product + * @returns {string} Resource name string. + */ + productPath( + project: string, + location: string, + catalog: string, + branch: string, + product: string + ) { + return this.pathTemplates.productPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + product: product, + }); + } + + /** + * Parse the project from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).project; + } + + /** + * Parse the location from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).location; + } + + /** + * Parse the catalog from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).catalog; + } + + /** + * Parse the branch from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).branch; + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * 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 retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + + /** + * Return a fully-qualified servingConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} serving_config + * @returns {string} Resource name string. + */ + servingConfigPath( + project: string, + location: string, + catalog: string, + servingConfig: string + ) { + return this.pathTemplates.servingConfigPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + serving_config: servingConfig, + }); + } + + /** + * Parse the project from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .project; + } + + /** + * Parse the location from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .location; + } + + /** + * Parse the catalog from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .catalog; + } + + /** + * Parse the serving_config from ServingConfig resource. + * + * @param {string} servingConfigName + * A fully-qualified path representing ServingConfig resource. + * @returns {string} A string representing the serving_config. + */ + matchServingConfigFromServingConfigName(servingConfigName: string) { + return this.pathTemplates.servingConfigPathTemplate.match(servingConfigName) + .serving_config; + } + + /** + * 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.projectServiceStub && !this._terminated) { + return this.projectServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-retail/src/v2alpha/project_service_client_config.json b/packages/google-cloud-retail/src/v2alpha/project_service_client_config.json new file mode 100644 index 00000000000..9360e98eed0 --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/project_service_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.retail.v2alpha.ProjectService": { + "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 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetProject": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "AcceptTerms": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "EnrollSolution": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "ListEnrolledSolutions": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetLoggingConfig": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "UpdateLoggingConfig": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "GetAlertConfig": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, + "UpdateAlertConfig": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + } + } + } + } +} diff --git a/packages/google-cloud-retail/src/v2alpha/project_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/project_service_proto_list.json new file mode 100644 index 00000000000..4bc966a9a7f --- /dev/null +++ b/packages/google-cloud-retail/src/v2alpha/project_service_proto_list.json @@ -0,0 +1,29 @@ +[ + "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", + "../../protos/google/cloud/retail/v2alpha/catalog.proto", + "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", + "../../protos/google/cloud/retail/v2alpha/common.proto", + "../../protos/google/cloud/retail/v2alpha/completion_service.proto", + "../../protos/google/cloud/retail/v2alpha/control.proto", + "../../protos/google/cloud/retail/v2alpha/control_service.proto", + "../../protos/google/cloud/retail/v2alpha/export_config.proto", + "../../protos/google/cloud/retail/v2alpha/import_config.proto", + "../../protos/google/cloud/retail/v2alpha/merchant_center_account_link.proto", + "../../protos/google/cloud/retail/v2alpha/merchant_center_account_link_service.proto", + "../../protos/google/cloud/retail/v2alpha/model.proto", + "../../protos/google/cloud/retail/v2alpha/model_service.proto", + "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", + "../../protos/google/cloud/retail/v2alpha/product.proto", + "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", + "../../protos/google/cloud/retail/v2alpha/promotion.proto", + "../../protos/google/cloud/retail/v2alpha/purge_config.proto", + "../../protos/google/cloud/retail/v2alpha/search_service.proto", + "../../protos/google/cloud/retail/v2alpha/serving_config.proto", + "../../protos/google/cloud/retail/v2alpha/serving_config_service.proto", + "../../protos/google/cloud/retail/v2alpha/user_event.proto", + "../../protos/google/cloud/retail/v2alpha/user_event_service.proto" +] diff --git a/packages/google-cloud-retail/src/v2alpha/search_service_client.ts b/packages/google-cloud-retail/src/v2alpha/search_service_client.ts index 81c366f6b9c..f06c0cc1bb7 100644 --- a/packages/google-cloud-retail/src/v2alpha/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/search_service_client.ts @@ -211,6 +211,9 @@ export class SearchServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), @@ -229,6 +232,9 @@ export class SearchServiceClient { experimentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/experiments/{experiment}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -238,6 +244,9 @@ export class SearchServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -473,7 +482,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -529,8 +538,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -538,21 +547,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2alpha.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -567,8 +575,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2alpha.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -579,16 +587,16 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} request.relevanceThreshold * The relevance threshold of the search results. * * Defaults to * {@link protos.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH|RelevanceThreshold.HIGH}, * which means only the most relevant results are shown, and the least number - * of results are returned. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + * of results are returned. For more information, see [Adjust result + * size](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2alpha.Product.Type.VARIANT|variant} @@ -711,9 +719,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -813,7 +821,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -869,8 +877,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -878,21 +886,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2alpha.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -907,8 +914,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2alpha.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -919,16 +926,16 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} request.relevanceThreshold * The relevance threshold of the search results. * * Defaults to * {@link protos.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH|RelevanceThreshold.HIGH}, * which means only the most relevant results are shown, and the least number - * of results are returned. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + * of results are returned. For more information, see [Adjust result + * size](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2alpha.Product.Type.VARIANT|variant} @@ -1051,9 +1058,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -1109,7 +1116,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -1165,8 +1172,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -1174,21 +1181,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See - * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2alpha.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2alpha.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -1203,8 +1209,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2alpha.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2alpha.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -1215,16 +1221,16 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold} request.relevanceThreshold * The relevance threshold of the search results. * * Defaults to * {@link protos.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold.HIGH|RelevanceThreshold.HIGH}, * which means only the most relevant results are shown, and the least number - * of results are returned. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). + * of results are returned. For more information, see [Adjust result + * size](https://cloud.google.com/retail/docs/result-size#relevance_thresholding). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2alpha.Product.Type.VARIANT|variant} @@ -1347,9 +1353,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -1650,6 +1656,30 @@ export class SearchServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -2014,6 +2044,30 @@ export class SearchServiceClient { .experiment; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -2240,6 +2294,30 @@ export class SearchServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/search_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/search_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/search_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/search_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts b/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts index 2e17417e74e..29a64fdb9cf 100644 --- a/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/serving_config_service_client.ts @@ -208,9 +208,15 @@ export class ServingConfigServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -220,6 +226,9 @@ export class ServingConfigServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -229,6 +238,9 @@ export class ServingConfigServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -1511,6 +1523,30 @@ export class ServingConfigServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1566,6 +1602,73 @@ export class ServingConfigServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1737,6 +1840,30 @@ export class ServingConfigServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1963,6 +2090,30 @@ export class ServingConfigServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/serving_config_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/serving_config_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/serving_config_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/serving_config_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts index a4bc34bc971..53f88781c0c 100644 --- a/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts +++ b/packages/google-cloud-retail/src/v2alpha/user_event_service_client.ts @@ -207,9 +207,15 @@ export class UserEventServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + alertConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/alertConfig' + ), attributesConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/attributesConfig' ), + branchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}' + ), catalogPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}' ), @@ -219,6 +225,9 @@ export class UserEventServiceClient { controlPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}' ), + loggingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/loggingConfig' + ), merchantCenterAccountLinkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/merchantCenterAccountLinks/{merchant_center_account_link}' ), @@ -228,6 +237,9 @@ export class UserEventServiceClient { productPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/branches/{branch}/products/{product}' ), + retailProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/retailProject' + ), servingConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}' ), @@ -1414,6 +1426,30 @@ export class UserEventServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified alertConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + alertConfigPath(project: string) { + return this.pathTemplates.alertConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from AlertConfig resource. + * + * @param {string} alertConfigName + * A fully-qualified path representing AlertConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAlertConfigName(alertConfigName: string) { + return this.pathTemplates.alertConfigPathTemplate.match(alertConfigName) + .project; + } + /** * Return a fully-qualified attributesConfig resource name string. * @@ -1469,6 +1505,73 @@ export class UserEventServiceClient { ).catalog; } + /** + * Return a fully-qualified branch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} catalog + * @param {string} branch + * @returns {string} Resource name string. + */ + branchPath( + project: string, + location: string, + catalog: string, + branch: string + ) { + return this.pathTemplates.branchPathTemplate.render({ + project: project, + location: location, + catalog: catalog, + branch: branch, + }); + } + + /** + * Parse the project from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).project; + } + + /** + * Parse the location from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).location; + } + + /** + * Parse the catalog from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the catalog. + */ + matchCatalogFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).catalog; + } + + /** + * Parse the branch from Branch resource. + * + * @param {string} branchName + * A fully-qualified path representing Branch resource. + * @returns {string} A string representing the branch. + */ + matchBranchFromBranchName(branchName: string) { + return this.pathTemplates.branchPathTemplate.match(branchName).branch; + } + /** * Return a fully-qualified catalog resource name string. * @@ -1640,6 +1743,30 @@ export class UserEventServiceClient { return this.pathTemplates.controlPathTemplate.match(controlName).control; } + /** + * Return a fully-qualified loggingConfig resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + loggingConfigPath(project: string) { + return this.pathTemplates.loggingConfigPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from LoggingConfig resource. + * + * @param {string} loggingConfigName + * A fully-qualified path representing LoggingConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLoggingConfigName(loggingConfigName: string) { + return this.pathTemplates.loggingConfigPathTemplate.match(loggingConfigName) + .project; + } + /** * Return a fully-qualified merchantCenterAccountLink resource name string. * @@ -1866,6 +1993,30 @@ export class UserEventServiceClient { return this.pathTemplates.productPathTemplate.match(productName).product; } + /** + * Return a fully-qualified retailProject resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + retailProjectPath(project: string) { + return this.pathTemplates.retailProjectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from RetailProject resource. + * + * @param {string} retailProjectName + * A fully-qualified path representing RetailProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRetailProjectName(retailProjectName: string) { + return this.pathTemplates.retailProjectPathTemplate.match(retailProjectName) + .project; + } + /** * Return a fully-qualified servingConfig resource name string. * diff --git a/packages/google-cloud-retail/src/v2alpha/user_event_service_client_config.json b/packages/google-cloud-retail/src/v2alpha/user_event_service_client_config.json index 21dfac2e12b..59f44b86215 100644 --- a/packages/google-cloud-retail/src/v2alpha/user_event_service_client_config.json +++ b/packages/google-cloud-retail/src/v2alpha/user_event_service_client_config.json @@ -48,12 +48,12 @@ }, "methods": { "WriteUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, "CollectUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, @@ -68,7 +68,7 @@ "retry_params_name": "49abb7cadc111ff8dd551b61fcad123362c8d090" }, "RejoinUserEvents": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" } diff --git a/packages/google-cloud-retail/src/v2alpha/user_event_service_proto_list.json b/packages/google-cloud-retail/src/v2alpha/user_event_service_proto_list.json index e0598b0158e..4bc966a9a7f 100644 --- a/packages/google-cloud-retail/src/v2alpha/user_event_service_proto_list.json +++ b/packages/google-cloud-retail/src/v2alpha/user_event_service_proto_list.json @@ -1,5 +1,7 @@ [ "../../protos/google/cloud/retail/v2alpha/analytics_service.proto", + "../../protos/google/cloud/retail/v2alpha/branch.proto", + "../../protos/google/cloud/retail/v2alpha/branch_service.proto", "../../protos/google/cloud/retail/v2alpha/catalog.proto", "../../protos/google/cloud/retail/v2alpha/catalog_service.proto", "../../protos/google/cloud/retail/v2alpha/common.proto", @@ -15,6 +17,8 @@ "../../protos/google/cloud/retail/v2alpha/prediction_service.proto", "../../protos/google/cloud/retail/v2alpha/product.proto", "../../protos/google/cloud/retail/v2alpha/product_service.proto", + "../../protos/google/cloud/retail/v2alpha/project.proto", + "../../protos/google/cloud/retail/v2alpha/project_service.proto", "../../protos/google/cloud/retail/v2alpha/promotion.proto", "../../protos/google/cloud/retail/v2alpha/purge_config.proto", "../../protos/google/cloud/retail/v2alpha/search_service.proto", diff --git a/packages/google-cloud-retail/src/v2beta/completion_service_client.ts b/packages/google-cloud-retail/src/v2beta/completion_service_client.ts index cb99c5a0cb5..f22ddcd17b8 100644 --- a/packages/google-cloud-retail/src/v2beta/completion_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/completion_service_client.ts @@ -522,11 +522,15 @@ export class CompletionServiceClient { * * The maximum allowed max suggestions is 20. If it is set higher, it will be * capped by 20. + * @param {boolean} request.enableAttributeSuggestions + * If true, attribute suggestions are enabled and provided in response. + * + * This field is only available for "cloud-retail" dataset. * @param {string} request.entity - * The entity for customers that may run multiple different entities, domains, - * sites or regions, for example, `Google US`, `Google Ads`, `Waymo`, + * The entity for customers who run multiple entities, domains, sites, or + * regions, for example, `Google US`, `Google Ads`, `Waymo`, * `google.com`, `youtube.com`, etc. - * If this is set, it should be exactly matched with + * If this is set, it must be an exact match with * {@link protos.google.cloud.retail.v2beta.UserEvent.entity|UserEvent.entity} to get * per-entity autocomplete results. * @param {object} [options] diff --git a/packages/google-cloud-retail/src/v2beta/gapic_metadata.json b/packages/google-cloud-retail/src/v2beta/gapic_metadata.json index 3fc44ab9e36..03140badfcd 100644 --- a/packages/google-cloud-retail/src/v2beta/gapic_metadata.json +++ b/packages/google-cloud-retail/src/v2beta/gapic_metadata.json @@ -416,6 +416,11 @@ "deleteProduct" ] }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, "ImportProducts": { "methods": [ "importProducts" @@ -478,6 +483,11 @@ "deleteProduct" ] }, + "PurgeProducts": { + "methods": [ + "purgeProducts" + ] + }, "ImportProducts": { "methods": [ "importProducts" diff --git a/packages/google-cloud-retail/src/v2beta/product_service_client.ts b/packages/google-cloud-retail/src/v2beta/product_service_client.ts index e213a73929a..b7601d1a285 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/product_service_client.ts @@ -282,6 +282,12 @@ export class ProductServiceClient { this.operationsClient = this._gaxModule .lro(lroOptions) .operationsClient(opts); + const purgeProductsResponse = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.PurgeProductsResponse' + ) as gax.protobuf.Type; + const purgeProductsMetadata = protoFilesRoot.lookup( + '.google.cloud.retail.v2beta.PurgeProductsMetadata' + ) as gax.protobuf.Type; const importProductsResponse = protoFilesRoot.lookup( '.google.cloud.retail.v2beta.ImportProductsResponse' ) as gax.protobuf.Type; @@ -320,6 +326,11 @@ export class ProductServiceClient { ) as gax.protobuf.Type; this.descriptors.longrunning = { + purgeProducts: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + purgeProductsResponse.decode.bind(purgeProductsResponse), + purgeProductsMetadata.decode.bind(purgeProductsMetadata) + ), importProducts: new this._gaxModule.LongrunningDescriptor( this.operationsClient, importProductsResponse.decode.bind(importProductsResponse), @@ -415,6 +426,7 @@ export class ProductServiceClient { 'listProducts', 'updateProduct', 'deleteProduct', + 'purgeProducts', 'importProducts', 'setInventory', 'addFulfillmentPlaces', @@ -968,6 +980,205 @@ export class ProductServiceClient { return this.innerApiCalls.deleteProduct(request, options, callback); } + /** + * Permanently deletes all selected + * {@link protos.google.cloud.retail.v2beta.Product|Product}s under a branch. + * + * This process is asynchronous. If the request is valid, the removal will be + * enqueued and processed offline. Depending on the number of + * {@link protos.google.cloud.retail.v2beta.Product|Product}s, this operation could take + * hours to complete. Before the operation completes, some + * {@link protos.google.cloud.retail.v2beta.Product|Product}s may still be returned by + * {@link protos.google.cloud.retail.v2beta.ProductService.GetProduct|ProductService.GetProduct} + * or + * {@link protos.google.cloud.retail.v2beta.ProductService.ListProducts|ProductService.ListProducts}. + * + * Depending on the number of {@link protos.google.cloud.retail.v2beta.Product|Product}s, + * this operation could take hours to complete. To get a sample of + * {@link protos.google.cloud.retail.v2beta.Product|Product}s that would be deleted, set + * {@link protos.google.cloud.retail.v2beta.PurgeProductsRequest.force|PurgeProductsRequest.force} + * to false. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the branch under which the products are + * created. The format is + * `projects/${projectId}/locations/global/catalogs/${catalogId}/branches/${branchId}` + * @param {string} request.filter + * Required. The filter string to specify the products to be deleted with a + * length limit of 5,000 characters. + * + * Empty string filter is not allowed. "*" implies delete all items in a + * branch. + * + * The eligible fields for filtering are: + * + * * `availability`: Double quoted + * {@link protos.google.cloud.retail.v2beta.Product.availability|Product.availability} + * string. + * * `create_time` : in ISO 8601 "zulu" format. + * + * Supported syntax: + * + * * Comparators (">", "<", ">=", "<=", "="). + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" + * * availability = "IN_STOCK" + * + * * Conjunctions ("AND") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER" + * + * * Disjunctions ("OR") + * Examples: + * * create_time <= "2015-02-13T17:05:46Z" OR availability = "IN_STOCK" + * + * * Can support nested queries. + * Examples: + * * (create_time <= "2015-02-13T17:05:46Z" AND availability = "PREORDER") + * OR (create_time >= "2015-02-14T13:03:32Z" AND availability = "IN_STOCK") + * + * * Filter Limits: + * * Filter should not contain more than 6 conditions. + * * Max nesting depth should not exceed 2 levels. + * + * Examples queries: + * * Delete back order products created before a timestamp. + * create_time <= "2015-02-13T17:05:46Z" OR availability = "BACKORDER" + * @param {boolean} request.force + * Actually perform the purge. + * If `force` is set to false, the method will return the expected purge count + * without deleting any products. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2beta/product_service.purge_products.js + * region_tag:retail_v2beta_generated_ProductService_PurgeProducts_async + */ + purgeProducts( + request?: protos.google.cloud.retail.v2beta.IPurgeProductsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + purgeProducts( + request: protos.google.cloud.retail.v2beta.IPurgeProductsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeProducts( + request: protos.google.cloud.retail.v2beta.IPurgeProductsRequest, + callback: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + purgeProducts( + request?: protos.google.cloud.retail.v2beta.IPurgeProductsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >, + 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.purgeProducts(request, options, callback); + } + /** + * Check the status of the long running operation returned by `purgeProducts()`. + * @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/v2beta/product_service.purge_products.js + * region_tag:retail_v2beta_generated_ProductService_PurgeProducts_async + */ + async checkPurgeProductsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.retail.v2beta.PurgeProductsResponse, + protos.google.cloud.retail.v2beta.PurgeProductsMetadata + > + > { + 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.purgeProducts, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.retail.v2beta.PurgeProductsResponse, + protos.google.cloud.retail.v2beta.PurgeProductsMetadata + >; + } /** * Bulk import of multiple {@link protos.google.cloud.retail.v2beta.Product|Product}s. * @@ -993,7 +1204,8 @@ export class ProductServiceClient { * The desired location of errors incurred during the Import. * @param {google.protobuf.FieldMask} request.updateMask * Indicates which fields in the provided imported `products` to update. If - * not set, all fields are updated. + * not set, all fields are updated. If provided, only the existing product + * fields are updated. Missing products will not be created. * @param {google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode} request.reconciliationMode * The mode of reconciliation between existing products and the products to be * imported. Defaults to @@ -1007,9 +1219,14 @@ export class ProductServiceClient { * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has * to be within the same project as * {@link protos.google.cloud.retail.v2beta.ImportProductsRequest.parent|ImportProductsRequest.parent}. - * Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the - * `pubsub.topics.publish` IAM permission on the topic. + * Make sure that both + * `cloud-retail-customer-data-access@system.gserviceaccount.com` and + * `service-@gcp-sa-retail.iam.gserviceaccount.com` + * have the `pubsub.topics.publish` IAM permission on the topic. + * + * Only supported when + * {@link protos.google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode|ImportProductsRequest.reconciliation_mode} + * is set to `FULL`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1400,10 +1617,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2beta.ProductService.AddLocalInventories|ProductService.AddLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces|ProductService.AddFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2beta.ProductService.AddLocalInventories|ProductService.AddLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. @@ -1618,10 +1836,11 @@ export class ProductServiceClient { >; } /** - * It is recommended to use the + * We recommend that you use the * {@link protos.google.cloud.retail.v2beta.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} - * method instead of - * {@link protos.google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces}. + * method instead of the + * {@link protos.google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces|ProductService.RemoveFulfillmentPlaces} + * method. * {@link protos.google.cloud.retail.v2beta.ProductService.RemoveLocalInventories|ProductService.RemoveLocalInventories} * achieves the same results but provides more fine-grained control over * ingesting local inventory data. diff --git a/packages/google-cloud-retail/src/v2beta/product_service_client_config.json b/packages/google-cloud-retail/src/v2beta/product_service_client_config.json index 459b579d7a8..172142bcb8b 100644 --- a/packages/google-cloud-retail/src/v2beta/product_service_client_config.json +++ b/packages/google-cloud-retail/src/v2beta/product_service_client_config.json @@ -63,6 +63,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, + "PurgeProducts": { + "timeout_millis": 30000, + "retry_codes_name": "idempotent", + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" + }, "ImportProducts": { "timeout_millis": 300000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-retail/src/v2beta/search_service_client.ts b/packages/google-cloud-retail/src/v2beta/search_service_client.ts index 9c9907ace5e..b89704f2e05 100644 --- a/packages/google-cloud-retail/src/v2beta/search_service_client.ts +++ b/packages/google-cloud-retail/src/v2beta/search_service_client.ts @@ -467,7 +467,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -522,8 +522,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -531,20 +531,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2beta.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2beta.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -559,8 +559,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2beta.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -571,8 +571,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2beta.Product.Type.VARIANT|variant} @@ -686,9 +686,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -788,7 +788,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -843,8 +843,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -852,20 +852,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2beta.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2beta.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -880,8 +880,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2beta.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -892,8 +892,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2beta.Product.Type.VARIANT|variant} @@ -1007,9 +1007,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. @@ -1065,7 +1065,7 @@ export class SearchServiceClient { * or the name of the legacy placement resource, such as * `projects/* /locations/global/catalogs/default_catalog/placements/default_search`. * This field is used to identify the serving config name and the set - * of models that will be used to make the search. + * of models that are used to make the search. * @param {string} request.branch * The branch resource name, such as * `projects/* /locations/global/catalogs/default_catalog/branches/0`. @@ -1120,8 +1120,8 @@ export class SearchServiceClient { * @param {string} request.filter * The filter syntax consists of an expression language for constructing a * predicate from one or more fields of the products being filtered. Filter - * expression is case-sensitive. See more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#filter). + * expression is case-sensitive. For more information, see + * [Filter](https://cloud.google.com/retail/docs/filter-and-order#filter). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {string} request.canonicalFilter @@ -1129,20 +1129,20 @@ export class SearchServiceClient { * checking any filters on the search page. * * The filter applied to every search request when quality improvement such as - * query expansion is needed. For example, if a query does not have enough - * results, an expanded query with - * {@link protos.google.cloud.retail.v2beta.SearchRequest.canonical_filter|SearchRequest.canonical_filter} - * will be returned as a supplement of the original query. This field is - * strongly recommended to achieve high search quality. - * - * See {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter} - * for more details about filter syntax. + * query expansion is needed. In the case a query does not have a sufficient + * amount of results this filter will be used to determine whether or not to + * enable the query expansion flow. The original filter will still be used for + * the query expanded search. + * This field is strongly recommended to achieve high search quality. + * + * For more information about filter syntax, see + * {@link protos.google.cloud.retail.v2beta.SearchRequest.filter|SearchRequest.filter}. * @param {string} request.orderBy * The order in which products are returned. Products can be ordered by * a field in an {@link protos.google.cloud.retail.v2beta.Product|Product} object. Leave - * it unset if ordered by relevance. OrderBy expression is case-sensitive. See - * more details at this [user - * guide](https://cloud.google.com/retail/docs/filter-and-order#order). + * it unset if ordered by relevance. OrderBy expression is case-sensitive. For + * more information, see + * [Order](https://cloud.google.com/retail/docs/filter-and-order#order). * * If this field is unrecognizable, an INVALID_ARGUMENT is returned. * @param {number[]} request.facetSpecs @@ -1157,8 +1157,8 @@ export class SearchServiceClient { * The specification for dynamically generated facets. Notice that only * textual facets can be dynamically generated. * @param {google.cloud.retail.v2beta.SearchRequest.BoostSpec} request.boostSpec - * Boost specification to boost certain products. See more details at this - * [user guide](https://cloud.google.com/retail/docs/boosting). + * Boost specification to boost certain products. For more information, see + * [Boost results](https://cloud.google.com/retail/docs/boosting). * * Notice that if both * {@link protos.google.cloud.retail.v2beta.ServingConfig.boost_control_ids|ServingConfig.boost_control_ids} @@ -1169,8 +1169,8 @@ export class SearchServiceClient { * to the sum of the boost scores from all matched boost conditions. * @param {google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec} request.queryExpansionSpec * The query expansion specification that specifies the conditions under which - * query expansion will occur. See more details at this [user - * guide](https://cloud.google.com/retail/docs/result-size#query_expansion). + * query expansion occurs. For more information, see [Query + * expansion](https://cloud.google.com/retail/docs/result-size#query_expansion). * @param {string[]} request.variantRollupKeys * The keys to fetch and rollup the matching * {@link protos.google.cloud.retail.v2beta.Product.Type.VARIANT|variant} @@ -1284,9 +1284,9 @@ export class SearchServiceClient { * key with multiple resources. * * Keys must start with a lowercase letter or international character. * - * See [Google Cloud - * Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - * for more details. + * For more information, see [Requirements for + * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + * in the Resource Manager documentation. * @param {google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec} request.spellCorrectionSpec * The spell correction specification that specifies the mode under * which spell correction will take effect. diff --git a/packages/google-cloud-retail/src/v2beta/user_event_service_client_config.json b/packages/google-cloud-retail/src/v2beta/user_event_service_client_config.json index f5bd2baedcc..ab05934e29b 100644 --- a/packages/google-cloud-retail/src/v2beta/user_event_service_client_config.json +++ b/packages/google-cloud-retail/src/v2beta/user_event_service_client_config.json @@ -48,12 +48,12 @@ }, "methods": { "WriteUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, "CollectUserEvent": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" }, @@ -68,7 +68,7 @@ "retry_params_name": "49abb7cadc111ff8dd551b61fcad123362c8d090" }, "RejoinUserEvents": { - "timeout_millis": 5000, + "timeout_millis": 10000, "retry_codes_name": "idempotent", "retry_params_name": "319f27672a8be83550d842a373549dd84649a57e" } diff --git a/packages/google-cloud-retail/test/gapic_analytics_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_analytics_service_v2alpha.ts index 3c712c0a414..e77cbc07b83 100644 --- a/packages/google-cloud-retail/test/gapic_analytics_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_analytics_service_v2alpha.ts @@ -999,6 +999,44 @@ describe('v2alpha.AnalyticsServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new analyticsserviceModule.v2alpha.AnalyticsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1066,6 +1104,82 @@ describe('v2alpha.AnalyticsServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new analyticsserviceModule.v2alpha.AnalyticsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1273,6 +1387,44 @@ describe('v2alpha.AnalyticsServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new analyticsserviceModule.v2alpha.AnalyticsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -1534,6 +1686,44 @@ describe('v2alpha.AnalyticsServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new analyticsserviceModule.v2alpha.AnalyticsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_branch_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_branch_service_v2alpha.ts new file mode 100644 index 00000000000..3207386576a --- /dev/null +++ b/packages/google-cloud-retail/test/gapic_branch_service_v2alpha.ts @@ -0,0 +1,1830 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 branchserviceModule from '../src'; + +import {protobuf, 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 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('v2alpha.BranchServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'retail.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + branchserviceModule.v2alpha.BranchServiceClient.servicePath; + assert.strictEqual(servicePath, 'retail.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + branchserviceModule.v2alpha.BranchServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'retail.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new branchserviceModule.v2alpha.BranchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new branchserviceModule.v2alpha.BranchServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = branchserviceModule.v2alpha.BranchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.branchServiceStub, undefined); + await client.initialize(); + assert(client.branchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.branchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.branchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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('listBranches', () => { + it('invokes listBranches without error', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListBranchesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesResponse() + ); + client.innerApiCalls.listBranches = stubSimpleCall(expectedResponse); + const [response] = await client.listBranches(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBranches without error using callback', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListBranchesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesResponse() + ); + client.innerApiCalls.listBranches = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBranches( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IListBranchesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBranches with error', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListBranchesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBranches = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBranches(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBranches as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBranches with closed client', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListBranchesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListBranchesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listBranches(request), expectedError); + }); + }); + + describe('getBranch', () => { + it('invokes getBranch without error', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetBranchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetBranchRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Branch() + ); + client.innerApiCalls.getBranch = stubSimpleCall(expectedResponse); + const [response] = await client.getBranch(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBranch without error using callback', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetBranchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetBranchRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Branch() + ); + client.innerApiCalls.getBranch = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBranch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IBranch | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBranch with error', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetBranchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetBranchRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBranch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBranch(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBranch as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBranch with closed client', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetBranchRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetBranchRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBranch(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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 branchserviceModule.v2alpha.BranchServiceClient({ + 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('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('catalog', () => { + const fakePath = '/rendered/path/catalog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.catalogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.catalogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('catalogPath', () => { + const result = client.catalogPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.catalogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCatalogName', () => { + const result = client.matchProjectFromCatalogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCatalogName', () => { + const result = client.matchLocationFromCatalogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCatalogName', () => { + const result = client.matchCatalogFromCatalogName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('merchantCenterAccountLink', () => { + const fakePath = '/rendered/path/merchantCenterAccountLink'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + merchant_center_account_link: 'merchantCenterAccountLinkValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.merchantCenterAccountLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.merchantCenterAccountLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('merchantCenterAccountLinkPath', () => { + const result = client.merchantCenterAccountLinkPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'merchantCenterAccountLinkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMerchantCenterAccountLinkName', () => { + const result = + client.matchProjectFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMerchantCenterAccountLinkName', () => { + const result = + client.matchLocationFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromMerchantCenterAccountLinkName', () => { + const result = + client.matchCatalogFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName', () => { + const result = + client.matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName( + fakePath + ); + assert.strictEqual(result, 'merchantCenterAccountLinkValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + model: 'modelValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + 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', + 'catalogValue', + '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('matchCatalogFromModelName', () => { + const result = client.matchCatalogFromModelName(fakePath); + assert.strictEqual(result, 'catalogValue'); + 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('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + product: 'productValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue', + 'productValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProductName', () => { + const result = client.matchProjectFromProductName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProductName', () => { + const result = client.matchLocationFromProductName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromProductName', () => { + const result = client.matchCatalogFromProductName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProductName', () => { + const result = client.matchBranchFromProductName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new branchserviceModule.v2alpha.BranchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts index b033ecd147f..b2183724b4f 100644 --- a/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_catalog_service_v2alpha.ts @@ -2593,6 +2593,44 @@ describe('v2alpha.CatalogServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -2992,6 +3030,44 @@ describe('v2alpha.CatalogServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -3253,6 +3329,44 @@ describe('v2alpha.CatalogServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new catalogserviceModule.v2alpha.CatalogServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_completion_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_completion_service_v2alpha.ts index b1e78e00070..c34c8dce32e 100644 --- a/packages/google-cloud-retail/test/gapic_completion_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_completion_service_v2alpha.ts @@ -1169,6 +1169,45 @@ describe('v2alpha.CompletionServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new completionserviceModule.v2alpha.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1237,6 +1276,83 @@ describe('v2alpha.CompletionServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = + new completionserviceModule.v2alpha.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1447,6 +1563,45 @@ describe('v2alpha.CompletionServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new completionserviceModule.v2alpha.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -1711,6 +1866,45 @@ describe('v2alpha.CompletionServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new completionserviceModule.v2alpha.CompletionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_control_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_control_service_v2alpha.ts index 85348ac430b..f7bb1fd6c6a 100644 --- a/packages/google-cloud-retail/test/gapic_control_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_control_service_v2alpha.ts @@ -1637,6 +1637,44 @@ describe('v2alpha.ControlServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new controlserviceModule.v2alpha.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1704,6 +1742,82 @@ describe('v2alpha.ControlServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new controlserviceModule.v2alpha.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1911,6 +2025,44 @@ describe('v2alpha.ControlServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new controlserviceModule.v2alpha.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -2172,6 +2324,44 @@ describe('v2alpha.ControlServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new controlserviceModule.v2alpha.ControlServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_merchant_center_account_link_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_merchant_center_account_link_service_v2alpha.ts index ee2975d5366..86327d3a193 100644 --- a/packages/google-cloud-retail/test/gapic_merchant_center_account_link_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_merchant_center_account_link_service_v2alpha.ts @@ -1397,6 +1397,47 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new merchantcenteraccountlinkserviceModule.v2alpha.MerchantCenterAccountLinkServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1467,6 +1508,85 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = + new merchantcenteraccountlinkserviceModule.v2alpha.MerchantCenterAccountLinkServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1683,6 +1803,47 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new merchantcenteraccountlinkserviceModule.v2alpha.MerchantCenterAccountLinkServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -1953,6 +2114,47 @@ describe('v2alpha.MerchantCenterAccountLinkServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new merchantcenteraccountlinkserviceModule.v2alpha.MerchantCenterAccountLinkServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_model_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_model_service_v2alpha.ts index 1b2ed41acc5..1cdaf503ca1 100644 --- a/packages/google-cloud-retail/test/gapic_model_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_model_service_v2alpha.ts @@ -2182,6 +2182,44 @@ describe('v2alpha.ModelServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new modelserviceModule.v2alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -2249,6 +2287,82 @@ describe('v2alpha.ModelServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new modelserviceModule.v2alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -2456,6 +2570,44 @@ describe('v2alpha.ModelServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new modelserviceModule.v2alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -2717,6 +2869,44 @@ describe('v2alpha.ModelServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new modelserviceModule.v2alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts index 896318b955e..f926d048270 100644 --- a/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_prediction_service_v2alpha.ts @@ -929,6 +929,45 @@ describe('v2alpha.PredictionServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -997,6 +1036,83 @@ describe('v2alpha.PredictionServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1207,6 +1323,45 @@ describe('v2alpha.PredictionServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -1471,6 +1626,45 @@ describe('v2alpha.PredictionServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new predictionserviceModule.v2alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2.ts b/packages/google-cloud-retail/test/gapic_product_service_v2.ts index d8deb5dc5de..cb1576d605f 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2.ts @@ -866,6 +866,200 @@ describe('v2.ProductServiceClient', () => { }); }); + describe('purgeProducts', () => { + it('invokes purgeProducts without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeProducts = + stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeProducts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts without error using callback', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeProducts = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeProducts( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2.IPurgeProductsResponse, + protos.google.cloud.retail.v2.IPurgeProductsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts with call error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeProducts = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.purgeProducts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts with LRO error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeProducts = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.purgeProducts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPurgeProductsProgress without error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + 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.checkPurgeProductsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeProductsProgress with error', async () => { + const client = new productserviceModule.v2.ProductServiceClient({ + 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.checkPurgeProductsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('importProducts', () => { it('invokes importProducts without error', async () => { const client = new productserviceModule.v2.ProductServiceClient({ diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts index 2f259a20f4a..2a6cb724b70 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2alpha.ts @@ -3039,6 +3039,44 @@ describe('v2alpha.ProductServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new productserviceModule.v2alpha.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -3389,6 +3427,44 @@ describe('v2alpha.ProductServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new productserviceModule.v2alpha.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -3650,6 +3726,44 @@ describe('v2alpha.ProductServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new productserviceModule.v2alpha.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts index b97e11aec4a..b939c6ae959 100644 --- a/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts +++ b/packages/google-cloud-retail/test/gapic_product_service_v2beta.ts @@ -866,6 +866,200 @@ describe('v2beta.ProductServiceClient', () => { }); }); + describe('purgeProducts', () => { + it('invokes purgeProducts without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2beta.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeProducts = + stubLongRunningCall(expectedResponse); + const [operation] = await client.purgeProducts(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts without error using callback', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2beta.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.purgeProducts = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.purgeProducts( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2beta.IPurgeProductsResponse, + protos.google.cloud.retail.v2beta.IPurgeProductsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts with call error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2beta.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeProducts = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.purgeProducts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes purgeProducts with LRO error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2beta.PurgeProductsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2beta.PurgeProductsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeProducts = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.purgeProducts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeProducts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPurgeProductsProgress without error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + 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.checkPurgeProductsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPurgeProductsProgress with error', async () => { + const client = new productserviceModule.v2beta.ProductServiceClient({ + 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.checkPurgeProductsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('importProducts', () => { it('invokes importProducts without error', async () => { const client = new productserviceModule.v2beta.ProductServiceClient({ diff --git a/packages/google-cloud-retail/test/gapic_project_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_project_service_v2alpha.ts new file mode 100644 index 00000000000..f15c5e78a18 --- /dev/null +++ b/packages/google-cloud-retail/test/gapic_project_service_v2alpha.ts @@ -0,0 +1,2769 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 projectserviceModule from '../src'; + +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 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('v2alpha.ProjectServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'retail.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + projectserviceModule.v2alpha.ProjectServiceClient.servicePath; + assert.strictEqual(servicePath, 'retail.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + projectserviceModule.v2alpha.ProjectServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'retail.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = + new projectserviceModule.v2alpha.ProjectServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'retail.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new projectserviceModule.v2alpha.ProjectServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = projectserviceModule.v2alpha.ProjectServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.projectServiceStub, undefined); + await client.initialize(); + assert(client.projectServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.projectServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.projectServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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('getProject', () => { + it('invokes getProject without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Project() + ); + client.innerApiCalls.getProject = stubSimpleCall(expectedResponse); + const [response] = await client.getProject(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Project() + ); + client.innerApiCalls.getProject = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProject( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProject = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProject with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProject(request), expectedError); + }); + }); + + describe('acceptTerms', () => { + it('invokes acceptTerms without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AcceptTermsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.AcceptTermsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Project() + ); + client.innerApiCalls.acceptTerms = stubSimpleCall(expectedResponse); + const [response] = await client.acceptTerms(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTerms without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AcceptTermsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.AcceptTermsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.Project() + ); + client.innerApiCalls.acceptTerms = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acceptTerms( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTerms with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AcceptTermsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.AcceptTermsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acceptTerms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.acceptTerms(request), expectedError); + const actualRequest = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptTerms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTerms with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AcceptTermsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.AcceptTermsRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acceptTerms(request), expectedError); + }); + }); + + describe('listEnrolledSolutions', () => { + it('invokes listEnrolledSolutions without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse() + ); + client.innerApiCalls.listEnrolledSolutions = + stubSimpleCall(expectedResponse); + const [response] = await client.listEnrolledSolutions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnrolledSolutions without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsResponse() + ); + client.innerApiCalls.listEnrolledSolutions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnrolledSolutions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IListEnrolledSolutionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnrolledSolutions with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnrolledSolutions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listEnrolledSolutions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEnrolledSolutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnrolledSolutions with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.ListEnrolledSolutionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.listEnrolledSolutions(request), + expectedError + ); + }); + }); + + describe('getLoggingConfig', () => { + it('invokes getLoggingConfig without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetLoggingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetLoggingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.LoggingConfig() + ); + client.innerApiCalls.getLoggingConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getLoggingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoggingConfig without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetLoggingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetLoggingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.LoggingConfig() + ); + client.innerApiCalls.getLoggingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLoggingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.ILoggingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoggingConfig with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetLoggingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetLoggingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLoggingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getLoggingConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLoggingConfig with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetLoggingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetLoggingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getLoggingConfig(request), expectedError); + }); + }); + + describe('updateLoggingConfig', () => { + it('invokes updateLoggingConfig without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest() + ); + request.loggingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest', + ['loggingConfig', 'name'] + ); + request.loggingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `logging_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.LoggingConfig() + ); + client.innerApiCalls.updateLoggingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateLoggingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLoggingConfig without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest() + ); + request.loggingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest', + ['loggingConfig', 'name'] + ); + request.loggingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `logging_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.LoggingConfig() + ); + client.innerApiCalls.updateLoggingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateLoggingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.ILoggingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLoggingConfig with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest() + ); + request.loggingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest', + ['loggingConfig', 'name'] + ); + request.loggingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `logging_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLoggingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateLoggingConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLoggingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLoggingConfig with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest() + ); + request.loggingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateLoggingConfigRequest', + ['loggingConfig', 'name'] + ); + request.loggingConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateLoggingConfig(request), expectedError); + }); + }); + + describe('getAlertConfig', () => { + it('invokes getAlertConfig without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetAlertConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetAlertConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AlertConfig() + ); + client.innerApiCalls.getAlertConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getAlertConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAlertConfig without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetAlertConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetAlertConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AlertConfig() + ); + client.innerApiCalls.getAlertConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAlertConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IAlertConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAlertConfig with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetAlertConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetAlertConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAlertConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAlertConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAlertConfig with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.GetAlertConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.GetAlertConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAlertConfig(request), expectedError); + }); + }); + + describe('updateAlertConfig', () => { + it('invokes updateAlertConfig without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateAlertConfigRequest() + ); + request.alertConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateAlertConfigRequest', + ['alertConfig', 'name'] + ); + request.alertConfig.name = defaultValue1; + const expectedHeaderRequestParams = `alert_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AlertConfig() + ); + client.innerApiCalls.updateAlertConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateAlertConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAlertConfig without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateAlertConfigRequest() + ); + request.alertConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateAlertConfigRequest', + ['alertConfig', 'name'] + ); + request.alertConfig.name = defaultValue1; + const expectedHeaderRequestParams = `alert_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.AlertConfig() + ); + client.innerApiCalls.updateAlertConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAlertConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.retail.v2alpha.IAlertConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAlertConfig with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateAlertConfigRequest() + ); + request.alertConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateAlertConfigRequest', + ['alertConfig', 'name'] + ); + request.alertConfig.name = defaultValue1; + const expectedHeaderRequestParams = `alert_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAlertConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAlertConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAlertConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAlertConfig with closed client', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.UpdateAlertConfigRequest() + ); + request.alertConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.UpdateAlertConfigRequest', + ['alertConfig', 'name'] + ); + request.alertConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAlertConfig(request), expectedError); + }); + }); + + describe('enrollSolution', () => { + it('invokes enrollSolution without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.EnrollSolutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.EnrollSolutionRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enrollSolution = + stubLongRunningCall(expectedResponse); + const [operation] = await client.enrollSolution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollSolution without error using callback', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.EnrollSolutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.EnrollSolutionRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enrollSolution = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enrollSolution( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.retail.v2alpha.IEnrollSolutionResponse, + protos.google.cloud.retail.v2alpha.IEnrollSolutionMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollSolution with call error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.EnrollSolutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.EnrollSolutionRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enrollSolution = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.enrollSolution(request), expectedError); + const actualRequest = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enrollSolution with LRO error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.retail.v2alpha.EnrollSolutionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.retail.v2alpha.EnrollSolutionRequest', + ['project'] + ); + request.project = defaultValue1; + const expectedHeaderRequestParams = `project=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enrollSolution = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.enrollSolution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.enrollSolution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEnrollSolutionProgress without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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.checkEnrollSolutionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEnrollSolutionProgress with error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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.checkEnrollSolutionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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 projectserviceModule.v2alpha.ProjectServiceClient({ + 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('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('attributesConfig', () => { + const fakePath = '/rendered/path/attributesConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.attributesConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.attributesConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('attributesConfigPath', () => { + const result = client.attributesConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.attributesConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAttributesConfigName', () => { + const result = client.matchProjectFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAttributesConfigName', () => { + const result = client.matchLocationFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromAttributesConfigName', () => { + const result = client.matchCatalogFromAttributesConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.attributesConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('catalog', () => { + const fakePath = '/rendered/path/catalog'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.catalogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.catalogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('catalogPath', () => { + const result = client.catalogPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.catalogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCatalogName', () => { + const result = client.matchProjectFromCatalogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCatalogName', () => { + const result = client.matchLocationFromCatalogName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCatalogName', () => { + const result = client.matchCatalogFromCatalogName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.catalogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('completionConfig', () => { + const fakePath = '/rendered/path/completionConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.completionConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.completionConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('completionConfigPath', () => { + const result = client.completionConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.completionConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCompletionConfigName', () => { + const result = client.matchProjectFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCompletionConfigName', () => { + const result = client.matchLocationFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromCompletionConfigName', () => { + const result = client.matchCatalogFromCompletionConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.completionConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('control', () => { + const fakePath = '/rendered/path/control'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + control: 'controlValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.controlPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.controlPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('controlPath', () => { + const result = client.controlPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'controlValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.controlPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromControlName', () => { + const result = client.matchProjectFromControlName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromControlName', () => { + const result = client.matchLocationFromControlName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromControlName', () => { + const result = client.matchCatalogFromControlName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchControlFromControlName', () => { + const result = client.matchControlFromControlName(fakePath); + assert.strictEqual(result, 'controlValue'); + assert( + (client.pathTemplates.controlPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('merchantCenterAccountLink', () => { + const fakePath = '/rendered/path/merchantCenterAccountLink'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + merchant_center_account_link: 'merchantCenterAccountLinkValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.merchantCenterAccountLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.merchantCenterAccountLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('merchantCenterAccountLinkPath', () => { + const result = client.merchantCenterAccountLinkPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'merchantCenterAccountLinkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMerchantCenterAccountLinkName', () => { + const result = + client.matchProjectFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMerchantCenterAccountLinkName', () => { + const result = + client.matchLocationFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromMerchantCenterAccountLinkName', () => { + const result = + client.matchCatalogFromMerchantCenterAccountLinkName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName', () => { + const result = + client.matchMerchantCenterAccountLinkFromMerchantCenterAccountLinkName( + fakePath + ); + assert.strictEqual(result, 'merchantCenterAccountLinkValue'); + assert( + ( + client.pathTemplates.merchantCenterAccountLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + model: 'modelValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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', + 'catalogValue', + '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('matchCatalogFromModelName', () => { + const result = client.matchCatalogFromModelName(fakePath); + assert.strictEqual(result, 'catalogValue'); + 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('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + product: 'productValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue', + 'productValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProductName', () => { + const result = client.matchProjectFromProductName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProductName', () => { + const result = client.matchLocationFromProductName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromProductName', () => { + const result = client.matchCatalogFromProductName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromProductName', () => { + const result = client.matchBranchFromProductName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + 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('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('servingConfig', () => { + const fakePath = '/rendered/path/servingConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + serving_config: 'servingConfigValue', + }; + const client = new projectserviceModule.v2alpha.ProjectServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.servingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('servingConfigPath', () => { + const result = client.servingConfigPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'servingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.servingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServingConfigName', () => { + const result = client.matchProjectFromServingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServingConfigName', () => { + const result = client.matchLocationFromServingConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromServingConfigName', () => { + const result = client.matchCatalogFromServingConfigName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServingConfigFromServingConfigName', () => { + const result = client.matchServingConfigFromServingConfigName(fakePath); + assert.strictEqual(result, 'servingConfigValue'); + assert( + (client.pathTemplates.servingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-retail/test/gapic_search_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_search_service_v2alpha.ts index 15a637f32d5..b47e49ea5ef 100644 --- a/packages/google-cloud-retail/test/gapic_search_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_search_service_v2alpha.ts @@ -1143,6 +1143,44 @@ describe('v2alpha.SearchServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new searchserviceModule.v2alpha.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1569,6 +1607,44 @@ describe('v2alpha.SearchServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new searchserviceModule.v2alpha.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -1830,6 +1906,44 @@ describe('v2alpha.SearchServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new searchserviceModule.v2alpha.SearchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_serving_config_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_serving_config_service_v2alpha.ts index 8da94231eeb..ae4b57a277d 100644 --- a/packages/google-cloud-retail/test/gapic_serving_config_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_serving_config_service_v2alpha.ts @@ -1988,6 +1988,45 @@ describe('v2alpha.ServingConfigServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new servingconfigserviceModule.v2alpha.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -2056,6 +2095,83 @@ describe('v2alpha.ServingConfigServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = + new servingconfigserviceModule.v2alpha.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -2266,6 +2382,45 @@ describe('v2alpha.ServingConfigServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new servingconfigserviceModule.v2alpha.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -2530,6 +2685,45 @@ describe('v2alpha.ServingConfigServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new servingconfigserviceModule.v2alpha.ServingConfigServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts b/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts index b27b61bfdef..9776aea7401 100644 --- a/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts +++ b/packages/google-cloud-retail/test/gapic_user_event_service_v2alpha.ts @@ -1650,6 +1650,44 @@ describe('v2alpha.UserEventServiceClient', () => { }); describe('Path templates', () => { + describe('alertConfig', () => { + const fakePath = '/rendered/path/alertConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new usereventserviceModule.v2alpha.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.alertConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.alertConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('alertConfigPath', () => { + const result = client.alertConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.alertConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAlertConfigName', () => { + const result = client.matchProjectFromAlertConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.alertConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('attributesConfig', () => { const fakePath = '/rendered/path/attributesConfig'; const expectedParameters = { @@ -1717,6 +1755,82 @@ describe('v2alpha.UserEventServiceClient', () => { }); }); + describe('branch', () => { + const fakePath = '/rendered/path/branch'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + catalog: 'catalogValue', + branch: 'branchValue', + }; + const client = new usereventserviceModule.v2alpha.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.branchPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.branchPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('branchPath', () => { + const result = client.branchPath( + 'projectValue', + 'locationValue', + 'catalogValue', + 'branchValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.branchPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBranchName', () => { + const result = client.matchProjectFromBranchName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBranchName', () => { + const result = client.matchLocationFromBranchName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCatalogFromBranchName', () => { + const result = client.matchCatalogFromBranchName(fakePath); + assert.strictEqual(result, 'catalogValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBranchFromBranchName', () => { + const result = client.matchBranchFromBranchName(fakePath); + assert.strictEqual(result, 'branchValue'); + assert( + (client.pathTemplates.branchPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('catalog', () => { const fakePath = '/rendered/path/catalog'; const expectedParameters = { @@ -1924,6 +2038,44 @@ describe('v2alpha.UserEventServiceClient', () => { }); }); + describe('loggingConfig', () => { + const fakePath = '/rendered/path/loggingConfig'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new usereventserviceModule.v2alpha.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.loggingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.loggingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('loggingConfigPath', () => { + const result = client.loggingConfigPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.loggingConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLoggingConfigName', () => { + const result = client.matchProjectFromLoggingConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.loggingConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('merchantCenterAccountLink', () => { const fakePath = '/rendered/path/merchantCenterAccountLink'; const expectedParameters = { @@ -2185,6 +2337,44 @@ describe('v2alpha.UserEventServiceClient', () => { }); }); + describe('retailProject', () => { + const fakePath = '/rendered/path/retailProject'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new usereventserviceModule.v2alpha.UserEventServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.retailProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.retailProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('retailProjectPath', () => { + const result = client.retailProjectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.retailProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRetailProjectName', () => { + const result = client.matchProjectFromRetailProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.retailProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('servingConfig', () => { const fakePath = '/rendered/path/servingConfig'; const expectedParameters = { diff --git a/packages/google-cloud-securitycenter/CHANGELOG.md b/packages/google-cloud-securitycenter/CHANGELOG.md index 4f084773d2a..585ae5ee36f 100644 --- a/packages/google-cloud-securitycenter/CHANGELOG.md +++ b/packages/google-cloud-securitycenter/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/security-center?activeTab=versions +## [8.9.0](https://github.com/googleapis/google-cloud-node/compare/security-center-v8.8.0...security-center-v8.9.0) (2024-06-26) + + +### Features + +* [securitycenter] Add toxic_combination and group_memberships fields to finding ([#5495](https://github.com/googleapis/google-cloud-node/issues/5495)) ([41a96b4](https://github.com/googleapis/google-cloud-node/commit/41a96b4231d6b98fac2c06ea8686597789ef6b1c)) + ## [8.8.0](https://github.com/googleapis/google-cloud-node/compare/security-center-v8.7.0...security-center-v8.8.0) (2024-05-21) diff --git a/packages/google-cloud-securitycenter/package.json b/packages/google-cloud-securitycenter/package.json index 9a99ebabad4..f1aa66b5267 100644 --- a/packages/google-cloud-securitycenter/package.json +++ b/packages/google-cloud-securitycenter/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/security-center", "description": "Cloud Security Command Center API client for Node.js", - "version": "8.8.0", + "version": "8.9.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto index 1ed2d4bdf3c..8cf1857bc7b 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/finding.proto @@ -32,6 +32,7 @@ import "google/cloud/securitycenter/v1/database.proto"; import "google/cloud/securitycenter/v1/exfiltration.proto"; import "google/cloud/securitycenter/v1/external_system.proto"; import "google/cloud/securitycenter/v1/file.proto"; +import "google/cloud/securitycenter/v1/group_membership.proto"; import "google/cloud/securitycenter/v1/iam_binding.proto"; import "google/cloud/securitycenter/v1/indicator.proto"; import "google/cloud/securitycenter/v1/kernel_rootkit.proto"; @@ -44,6 +45,7 @@ import "google/cloud/securitycenter/v1/org_policy.proto"; import "google/cloud/securitycenter/v1/process.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/security_posture.proto"; +import "google/cloud/securitycenter/v1/toxic_combination.proto"; import "google/cloud/securitycenter/v1/vulnerability.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -183,6 +185,12 @@ message Finding { // Describes a potential security risk due to a change in the security // posture. POSTURE_VIOLATION = 6; + + // Describes a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + TOXIC_COMBINATION = 7; } // The [relative resource @@ -395,4 +403,16 @@ message Finding { // Notebook associated with the finding. Notebook notebook = 63; + + // Contains details about a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + // This field cannot be updated. Its value is ignored in all update requests. + ToxicCombination toxic_combination = 64; + + // Contains details about groups of which this finding is a member. A group is + // a collection of findings that are related in some way. + // This field cannot be updated. Its value is ignored in all update requests. + repeated GroupMembership group_memberships = 65; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto new file mode 100644 index 00000000000..da364378a57 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/group_membership.proto @@ -0,0 +1,44 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "GroupMembershipProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains details about groups of which this finding is a member. A group is a +// collection of findings that are related in some way. +message GroupMembership { + // Possible types of groups. + enum GroupType { + // Default value. + GROUP_TYPE_UNSPECIFIED = 0; + + // Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1; + } + + // Type of group. + GroupType group_type = 1; + + // ID of the group. + string group_id = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto new file mode 100644 index 00000000000..46e765ab1c0 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v1/toxic_combination.proto @@ -0,0 +1,41 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.securitycenter.v1; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ToxicCombinationProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Contains details about a group of security issues that, when the issues +// occur together, represent a greater risk than when the issues occur +// independently. A group of such issues is referred to as a toxic combination. +message ToxicCombination { + // The + // [Attack exposure + // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + // of this toxic combination. The score is a measure of how much this toxic + // combination exposes one or more high-value resources to potential attack. + double attack_exposure_score = 1; + + // List of resource names of findings associated with this toxic combination. + // For example, `organizations/123/sources/456/findings/789`. + repeated string related_findings = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto index 644ef36668c..f14c6d69f67 100644 --- a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/finding.proto @@ -32,6 +32,7 @@ import "google/cloud/securitycenter/v2/database.proto"; import "google/cloud/securitycenter/v2/exfiltration.proto"; import "google/cloud/securitycenter/v2/external_system.proto"; import "google/cloud/securitycenter/v2/file.proto"; +import "google/cloud/securitycenter/v2/group_membership.proto"; import "google/cloud/securitycenter/v2/iam_binding.proto"; import "google/cloud/securitycenter/v2/indicator.proto"; import "google/cloud/securitycenter/v2/kernel_rootkit.proto"; @@ -43,6 +44,7 @@ import "google/cloud/securitycenter/v2/org_policy.proto"; import "google/cloud/securitycenter/v2/process.proto"; import "google/cloud/securitycenter/v2/security_marks.proto"; import "google/cloud/securitycenter/v2/security_posture.proto"; +import "google/cloud/securitycenter/v2/toxic_combination.proto"; import "google/cloud/securitycenter/v2/vulnerability.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -188,6 +190,10 @@ message Finding { // Describes a potential security risk due to a change in the security // posture. POSTURE_VIOLATION = 6; + + // Describes a combination of security issues that represent a more severe + // security problem when taken together. + TOXIC_COMBINATION = 7; } // The [relative resource @@ -424,4 +430,16 @@ message Finding { // The load balancers associated with the finding. repeated LoadBalancer load_balancers = 50; + + // Contains details about a group of security issues that, when the issues + // occur together, represent a greater risk than when the issues occur + // independently. A group of such issues is referred to as a toxic + // combination. + // This field cannot be updated. Its value is ignored in all update requests. + ToxicCombination toxic_combination = 56; + + // Contains details about groups of which this finding is a member. A group is + // a collection of findings that are related in some way. + // This field cannot be updated. Its value is ignored in all update requests. + repeated GroupMembership group_memberships = 57; } diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto new file mode 100644 index 00000000000..4db02d2f2bd --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/group_membership.proto @@ -0,0 +1,44 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.securitycenter.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "GroupMembershipProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains details about groups of which this finding is a member. A group is a +// collection of findings that are related in some way. +message GroupMembership { + // Possible types of groups. + enum GroupType { + // Default value. + GROUP_TYPE_UNSPECIFIED = 0; + + // Group represents a toxic combination. + GROUP_TYPE_TOXIC_COMBINATION = 1; + } + + // Type of group. + GroupType group_type = 1; + + // ID of the group. + string group_id = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto new file mode 100644 index 00000000000..bef08e01540 --- /dev/null +++ b/packages/google-cloud-securitycenter/protos/google/cloud/securitycenter/v2/toxic_combination.proto @@ -0,0 +1,42 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.securitycenter.v2; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V2"; +option go_package = "cloud.google.com/go/securitycenter/apiv2/securitycenterpb;securitycenterpb"; +option java_multiple_files = true; +option java_outer_classname = "ToxicCombinationProto"; +option java_package = "com.google.cloud.securitycenter.v2"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V2"; +option ruby_package = "Google::Cloud::SecurityCenter::V2"; + +// Contains details about a group of security issues that, when the issues +// occur together, represent a greater risk than when the issues occur +// independently. A group of such issues is referred to as a toxic +// combination. +message ToxicCombination { + // The + // [Attack exposure + // score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores) + // of this toxic combination. The score is a measure of how much this toxic + // combination exposes one or more high-value resources to potential attack. + double attack_exposure_score = 1; + + // List of resource names of findings associated with this toxic combination. + // For example, `organizations/123/sources/456/findings/789`. + repeated string related_findings = 2; +} diff --git a/packages/google-cloud-securitycenter/protos/protos.d.ts b/packages/google-cloud-securitycenter/protos/protos.d.ts index e2c31ff1b12..ed40aba8c60 100644 --- a/packages/google-cloud-securitycenter/protos/protos.d.ts +++ b/packages/google-cloud-securitycenter/protos/protos.d.ts @@ -4387,6 +4387,12 @@ export namespace google { /** Finding notebook */ notebook?: (google.cloud.securitycenter.v1.INotebook|null); + + /** Finding toxicCombination */ + toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); + + /** Finding groupMemberships */ + groupMemberships?: (google.cloud.securitycenter.v1.IGroupMembership[]|null); } /** Represents a Finding. */ @@ -4536,6 +4542,12 @@ export namespace google { /** Finding notebook. */ public notebook?: (google.cloud.securitycenter.v1.INotebook|null); + /** Finding toxicCombination. */ + public toxicCombination?: (google.cloud.securitycenter.v1.IToxicCombination|null); + + /** Finding groupMemberships. */ + public groupMemberships: google.cloud.securitycenter.v1.IGroupMembership[]; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -4648,7 +4660,120 @@ export namespace google { MISCONFIGURATION = 3, OBSERVATION = 4, SCC_ERROR = 5, - POSTURE_VIOLATION = 6 + POSTURE_VIOLATION = 6, + TOXIC_COMBINATION = 7 + } + } + + /** Properties of a GroupMembership. */ + interface IGroupMembership { + + /** GroupMembership groupType */ + groupType?: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType|null); + + /** GroupMembership groupId */ + groupId?: (string|null); + } + + /** Represents a GroupMembership. */ + class GroupMembership implements IGroupMembership { + + /** + * Constructs a new GroupMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IGroupMembership); + + /** GroupMembership groupType. */ + public groupType: (google.cloud.securitycenter.v1.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v1.GroupMembership.GroupType); + + /** GroupMembership groupId. */ + public groupId: string; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupMembership instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IGroupMembership): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Verifies a GroupMembership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.GroupMembership; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @param message GroupMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroupMembership { + + /** GroupType enum. */ + enum GroupType { + GROUP_TYPE_UNSPECIFIED = 0, + GROUP_TYPE_TOXIC_COMBINATION = 1 } } @@ -7756,6 +7881,109 @@ export namespace google { } } + /** Properties of a ToxicCombination. */ + interface IToxicCombination { + + /** ToxicCombination attackExposureScore */ + attackExposureScore?: (number|null); + + /** ToxicCombination relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a ToxicCombination. */ + class ToxicCombination implements IToxicCombination { + + /** + * Constructs a new ToxicCombination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v1.IToxicCombination); + + /** ToxicCombination attackExposureScore. */ + public attackExposureScore: number; + + /** ToxicCombination relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @param [properties] Properties to set + * @returns ToxicCombination instance + */ + public static create(properties?: google.cloud.securitycenter.v1.IToxicCombination): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v1.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Verifies a ToxicCombination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToxicCombination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v1.ToxicCombination; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @param message ToxicCombination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v1.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToxicCombination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToxicCombination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Vulnerability. */ interface IVulnerability { @@ -30032,6 +30260,12 @@ export namespace google { /** Finding loadBalancers */ loadBalancers?: (google.cloud.securitycenter.v2.ILoadBalancer[]|null); + + /** Finding toxicCombination */ + toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); + + /** Finding groupMemberships */ + groupMemberships?: (google.cloud.securitycenter.v2.IGroupMembership[]|null); } /** Represents a Finding. */ @@ -30178,6 +30412,12 @@ export namespace google { /** Finding loadBalancers. */ public loadBalancers: google.cloud.securitycenter.v2.ILoadBalancer[]; + /** Finding toxicCombination. */ + public toxicCombination?: (google.cloud.securitycenter.v2.IToxicCombination|null); + + /** Finding groupMemberships. */ + public groupMemberships: google.cloud.securitycenter.v2.IGroupMembership[]; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -30290,7 +30530,120 @@ export namespace google { MISCONFIGURATION = 3, OBSERVATION = 4, SCC_ERROR = 5, - POSTURE_VIOLATION = 6 + POSTURE_VIOLATION = 6, + TOXIC_COMBINATION = 7 + } + } + + /** Properties of a GroupMembership. */ + interface IGroupMembership { + + /** GroupMembership groupType */ + groupType?: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType|null); + + /** GroupMembership groupId */ + groupId?: (string|null); + } + + /** Represents a GroupMembership. */ + class GroupMembership implements IGroupMembership { + + /** + * Constructs a new GroupMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IGroupMembership); + + /** GroupMembership groupType. */ + public groupType: (google.cloud.securitycenter.v2.GroupMembership.GroupType|keyof typeof google.cloud.securitycenter.v2.GroupMembership.GroupType); + + /** GroupMembership groupId. */ + public groupId: string; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns GroupMembership instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IGroupMembership): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @param message GroupMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IGroupMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Verifies a GroupMembership message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroupMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.GroupMembership; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @param message GroupMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.GroupMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroupMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroupMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GroupMembership { + + /** GroupType enum. */ + enum GroupType { + GROUP_TYPE_UNSPECIFIED = 0, + GROUP_TYPE_TOXIC_COMBINATION = 1 } } @@ -33392,6 +33745,109 @@ export namespace google { } } + /** Properties of a ToxicCombination. */ + interface IToxicCombination { + + /** ToxicCombination attackExposureScore */ + attackExposureScore?: (number|null); + + /** ToxicCombination relatedFindings */ + relatedFindings?: (string[]|null); + } + + /** Represents a ToxicCombination. */ + class ToxicCombination implements IToxicCombination { + + /** + * Constructs a new ToxicCombination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.securitycenter.v2.IToxicCombination); + + /** ToxicCombination attackExposureScore. */ + public attackExposureScore: number; + + /** ToxicCombination relatedFindings. */ + public relatedFindings: string[]; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @param [properties] Properties to set + * @returns ToxicCombination instance + */ + public static create(properties?: google.cloud.securitycenter.v2.IToxicCombination): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @param message ToxicCombination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.securitycenter.v2.IToxicCombination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Verifies a ToxicCombination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToxicCombination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.securitycenter.v2.ToxicCombination; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @param message ToxicCombination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.securitycenter.v2.ToxicCombination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToxicCombination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToxicCombination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Vulnerability. */ interface IVulnerability { diff --git a/packages/google-cloud-securitycenter/protos/protos.js b/packages/google-cloud-securitycenter/protos/protos.js index ccac787f030..e8378b0cd6d 100644 --- a/packages/google-cloud-securitycenter/protos/protos.js +++ b/packages/google-cloud-securitycenter/protos/protos.js @@ -10797,6 +10797,8 @@ * @property {Array.|null} [loadBalancers] Finding loadBalancers * @property {google.cloud.securitycenter.v1.ICloudArmor|null} [cloudArmor] Finding cloudArmor * @property {google.cloud.securitycenter.v1.INotebook|null} [notebook] Finding notebook + * @property {google.cloud.securitycenter.v1.IToxicCombination|null} [toxicCombination] Finding toxicCombination + * @property {Array.|null} [groupMemberships] Finding groupMemberships */ /** @@ -10820,6 +10822,7 @@ this.orgPolicies = []; this.logEntries = []; this.loadBalancers = []; + this.groupMemberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11194,6 +11197,22 @@ */ Finding.prototype.notebook = null; + /** + * Finding toxicCombination. + * @member {google.cloud.securitycenter.v1.IToxicCombination|null|undefined} toxicCombination + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.toxicCombination = null; + + /** + * Finding groupMemberships. + * @member {Array.} groupMemberships + * @memberof google.cloud.securitycenter.v1.Finding + * @instance + */ + Finding.prototype.groupMemberships = $util.emptyArray; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -11328,6 +11347,11 @@ $root.google.cloud.securitycenter.v1.CloudArmor.encode(message.cloudArmor, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); if (message.notebook != null && Object.hasOwnProperty.call(message, "notebook")) $root.google.cloud.securitycenter.v1.Notebook.encode(message.notebook, writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); + if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) + $root.google.cloud.securitycenter.v1.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + if (message.groupMemberships != null && message.groupMemberships.length) + for (var i = 0; i < message.groupMemberships.length; ++i) + $root.google.cloud.securitycenter.v1.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); return writer; }; @@ -11621,6 +11645,16 @@ message.notebook = $root.google.cloud.securitycenter.v1.Notebook.decode(reader, reader.uint32()); break; } + case 64: { + message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.decode(reader, reader.uint32()); + break; + } + case 65: { + if (!(message.groupMemberships && message.groupMemberships.length)) + message.groupMemberships = []; + message.groupMemberships.push($root.google.cloud.securitycenter.v1.GroupMembership.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -11740,6 +11774,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.indicator != null && message.hasOwnProperty("indicator")) { @@ -11938,6 +11973,20 @@ if (error) return "notebook." + error; } + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { + var error = $root.google.cloud.securitycenter.v1.ToxicCombination.verify(message.toxicCombination); + if (error) + return "toxicCombination." + error; + } + if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { + if (!Array.isArray(message.groupMemberships)) + return "groupMemberships: array expected"; + for (var i = 0; i < message.groupMemberships.length; ++i) { + var error = $root.google.cloud.securitycenter.v1.GroupMembership.verify(message.groupMemberships[i]); + if (error) + return "groupMemberships." + error; + } + } return null; }; @@ -12097,6 +12146,10 @@ case 6: message.findingClass = 6; break; + case "TOXIC_COMBINATION": + case 7: + message.findingClass = 7; + break; } if (object.indicator != null) { if (typeof object.indicator !== "object") @@ -12298,6 +12351,21 @@ throw TypeError(".google.cloud.securitycenter.v1.Finding.notebook: object expected"); message.notebook = $root.google.cloud.securitycenter.v1.Notebook.fromObject(object.notebook); } + if (object.toxicCombination != null) { + if (typeof object.toxicCombination !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.toxicCombination: object expected"); + message.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.fromObject(object.toxicCombination); + } + if (object.groupMemberships) { + if (!Array.isArray(object.groupMemberships)) + throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: array expected"); + message.groupMemberships = []; + for (var i = 0; i < object.groupMemberships.length; ++i) { + if (typeof object.groupMemberships[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v1.Finding.groupMemberships: object expected"); + message.groupMemberships[i] = $root.google.cloud.securitycenter.v1.GroupMembership.fromObject(object.groupMemberships[i]); + } + } return message; }; @@ -12324,6 +12392,7 @@ object.orgPolicies = []; object.logEntries = []; object.loadBalancers = []; + object.groupMemberships = []; } if (options.objects || options.defaults) { object.sourceProperties = {}; @@ -12365,6 +12434,7 @@ object.securityPosture = null; object.cloudArmor = null; object.notebook = null; + object.toxicCombination = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12495,6 +12565,13 @@ object.cloudArmor = $root.google.cloud.securitycenter.v1.CloudArmor.toObject(message.cloudArmor, options); if (message.notebook != null && message.hasOwnProperty("notebook")) object.notebook = $root.google.cloud.securitycenter.v1.Notebook.toObject(message.notebook, options); + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) + object.toxicCombination = $root.google.cloud.securitycenter.v1.ToxicCombination.toObject(message.toxicCombination, options); + if (message.groupMemberships && message.groupMemberships.length) { + object.groupMemberships = []; + for (var j = 0; j < message.groupMemberships.length; ++j) + object.groupMemberships[j] = $root.google.cloud.securitycenter.v1.GroupMembership.toObject(message.groupMemberships[j], options); + } return object; }; @@ -12589,6 +12666,7 @@ * @property {number} OBSERVATION=4 OBSERVATION value * @property {number} SCC_ERROR=5 SCC_ERROR value * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value + * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value */ Finding.FindingClass = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -12599,12 +12677,273 @@ values[valuesById[4] = "OBSERVATION"] = 4; values[valuesById[5] = "SCC_ERROR"] = 5; values[valuesById[6] = "POSTURE_VIOLATION"] = 6; + values[valuesById[7] = "TOXIC_COMBINATION"] = 7; return values; })(); return Finding; })(); + v1.GroupMembership = (function() { + + /** + * Properties of a GroupMembership. + * @memberof google.cloud.securitycenter.v1 + * @interface IGroupMembership + * @property {google.cloud.securitycenter.v1.GroupMembership.GroupType|null} [groupType] GroupMembership groupType + * @property {string|null} [groupId] GroupMembership groupId + */ + + /** + * Constructs a new GroupMembership. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a GroupMembership. + * @implements IGroupMembership + * @constructor + * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set + */ + function GroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMembership groupType. + * @member {google.cloud.securitycenter.v1.GroupMembership.GroupType} groupType + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + */ + GroupMembership.prototype.groupType = 0; + + /** + * GroupMembership groupId. + * @member {string} groupId + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + */ + GroupMembership.prototype.groupId = ""; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership instance + */ + GroupMembership.create = function create(properties) { + return new GroupMembership(properties); + }; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + return writer; + }; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.GroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.GroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.groupType = reader.int32(); + break; + } + case 2: { + message.groupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMembership message. + * @function verify + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupType != null && message.hasOwnProperty("groupType")) + switch (message.groupType) { + default: + return "groupType: enum value expected"; + case 0: + case 1: + break; + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + return null; + }; + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.GroupMembership} GroupMembership + */ + GroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.GroupMembership) + return object; + var message = new $root.google.cloud.securitycenter.v1.GroupMembership(); + switch (object.groupType) { + default: + if (typeof object.groupType === "number") { + message.groupType = object.groupType; + break; + } + break; + case "GROUP_TYPE_UNSPECIFIED": + case 0: + message.groupType = 0; + break; + case "GROUP_TYPE_TOXIC_COMBINATION": + case 1: + message.groupType = 1; + break; + } + if (object.groupId != null) + message.groupId = String(object.groupId); + return message; + }; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {google.cloud.securitycenter.v1.GroupMembership} message GroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; + object.groupId = ""; + } + if (message.groupType != null && message.hasOwnProperty("groupType")) + object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v1.GroupMembership.GroupType[message.groupType] : message.groupType; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + return object; + }; + + /** + * Converts this GroupMembership to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @instance + * @returns {Object.} JSON object + */ + GroupMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupMembership + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.GroupMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.GroupMembership"; + }; + + /** + * GroupType enum. + * @name google.cloud.securitycenter.v1.GroupMembership.GroupType + * @enum {number} + * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value + * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value + */ + GroupMembership.GroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; + return values; + })(); + + return GroupMembership; + })(); + v1.IamBinding = (function() { /** @@ -21309,6 +21648,249 @@ return SecurityPosture; })(); + v1.ToxicCombination = (function() { + + /** + * Properties of a ToxicCombination. + * @memberof google.cloud.securitycenter.v1 + * @interface IToxicCombination + * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore + * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings + */ + + /** + * Constructs a new ToxicCombination. + * @memberof google.cloud.securitycenter.v1 + * @classdesc Represents a ToxicCombination. + * @implements IToxicCombination + * @constructor + * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set + */ + function ToxicCombination(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToxicCombination attackExposureScore. + * @member {number} attackExposureScore + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + */ + ToxicCombination.prototype.attackExposureScore = 0; + + /** + * ToxicCombination relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + */ + ToxicCombination.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination instance + */ + ToxicCombination.create = function create(properties) { + return new ToxicCombination(properties); + }; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v1.ToxicCombination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attackExposureScore = reader.double(); + break; + } + case 2: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToxicCombination message. + * @function verify + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToxicCombination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + if (typeof message.attackExposureScore !== "number") + return "attackExposureScore: number expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v1.ToxicCombination} ToxicCombination + */ + ToxicCombination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v1.ToxicCombination) + return object; + var message = new $root.google.cloud.securitycenter.v1.ToxicCombination(); + if (object.attackExposureScore != null) + message.attackExposureScore = Number(object.attackExposureScore); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v1.ToxicCombination.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v1.ToxicCombination} message ToxicCombination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToxicCombination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (options.defaults) + object.attackExposureScore = 0; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this ToxicCombination to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @instance + * @returns {Object.} JSON object + */ + ToxicCombination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToxicCombination + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v1.ToxicCombination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v1.ToxicCombination"; + }; + + return ToxicCombination; + })(); + v1.Vulnerability = (function() { /** @@ -74622,6 +75204,8 @@ * @property {google.cloud.securitycenter.v2.ISecurityPosture|null} [securityPosture] Finding securityPosture * @property {Array.|null} [logEntries] Finding logEntries * @property {Array.|null} [loadBalancers] Finding loadBalancers + * @property {google.cloud.securitycenter.v2.IToxicCombination|null} [toxicCombination] Finding toxicCombination + * @property {Array.|null} [groupMemberships] Finding groupMemberships */ /** @@ -74645,6 +75229,7 @@ this.orgPolicies = []; this.logEntries = []; this.loadBalancers = []; + this.groupMemberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -75011,6 +75596,22 @@ */ Finding.prototype.loadBalancers = $util.emptyArray; + /** + * Finding toxicCombination. + * @member {google.cloud.securitycenter.v2.IToxicCombination|null|undefined} toxicCombination + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.toxicCombination = null; + + /** + * Finding groupMemberships. + * @member {Array.} groupMemberships + * @memberof google.cloud.securitycenter.v2.Finding + * @instance + */ + Finding.prototype.groupMemberships = $util.emptyArray; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -75143,6 +75744,11 @@ if (message.loadBalancers != null && message.loadBalancers.length) for (var i = 0; i < message.loadBalancers.length; ++i) $root.google.cloud.securitycenter.v2.LoadBalancer.encode(message.loadBalancers[i], writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.toxicCombination != null && Object.hasOwnProperty.call(message, "toxicCombination")) + $root.google.cloud.securitycenter.v2.ToxicCombination.encode(message.toxicCombination, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + if (message.groupMemberships != null && message.groupMemberships.length) + for (var i = 0; i < message.groupMemberships.length; ++i) + $root.google.cloud.securitycenter.v2.GroupMembership.encode(message.groupMemberships[i], writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); return writer; }; @@ -75432,6 +76038,16 @@ message.loadBalancers.push($root.google.cloud.securitycenter.v2.LoadBalancer.decode(reader, reader.uint32())); break; } + case 56: { + message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.decode(reader, reader.uint32()); + break; + } + case 57: { + if (!(message.groupMemberships && message.groupMemberships.length)) + message.groupMemberships = []; + message.groupMemberships.push($root.google.cloud.securitycenter.v2.GroupMembership.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -75551,6 +76167,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.indicator != null && message.hasOwnProperty("indicator")) { @@ -75744,6 +76361,20 @@ return "loadBalancers." + error; } } + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) { + var error = $root.google.cloud.securitycenter.v2.ToxicCombination.verify(message.toxicCombination); + if (error) + return "toxicCombination." + error; + } + if (message.groupMemberships != null && message.hasOwnProperty("groupMemberships")) { + if (!Array.isArray(message.groupMemberships)) + return "groupMemberships: array expected"; + for (var i = 0; i < message.groupMemberships.length; ++i) { + var error = $root.google.cloud.securitycenter.v2.GroupMembership.verify(message.groupMemberships[i]); + if (error) + return "groupMemberships." + error; + } + } return null; }; @@ -75903,6 +76534,10 @@ case 6: message.findingClass = 6; break; + case "TOXIC_COMBINATION": + case 7: + message.findingClass = 7; + break; } if (object.indicator != null) { if (typeof object.indicator !== "object") @@ -76099,6 +76734,21 @@ message.loadBalancers[i] = $root.google.cloud.securitycenter.v2.LoadBalancer.fromObject(object.loadBalancers[i]); } } + if (object.toxicCombination != null) { + if (typeof object.toxicCombination !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.toxicCombination: object expected"); + message.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.fromObject(object.toxicCombination); + } + if (object.groupMemberships) { + if (!Array.isArray(object.groupMemberships)) + throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: array expected"); + message.groupMemberships = []; + for (var i = 0; i < object.groupMemberships.length; ++i) { + if (typeof object.groupMemberships[i] !== "object") + throw TypeError(".google.cloud.securitycenter.v2.Finding.groupMemberships: object expected"); + message.groupMemberships[i] = $root.google.cloud.securitycenter.v2.GroupMembership.fromObject(object.groupMemberships[i]); + } + } return message; }; @@ -76125,6 +76775,7 @@ object.orgPolicies = []; object.logEntries = []; object.loadBalancers = []; + object.groupMemberships = []; } if (options.objects || options.defaults) { object.sourceProperties = {}; @@ -76165,6 +76816,7 @@ object.application = null; object.backupDisasterRecovery = null; object.securityPosture = null; + object.toxicCombination = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -76293,6 +76945,13 @@ for (var j = 0; j < message.loadBalancers.length; ++j) object.loadBalancers[j] = $root.google.cloud.securitycenter.v2.LoadBalancer.toObject(message.loadBalancers[j], options); } + if (message.toxicCombination != null && message.hasOwnProperty("toxicCombination")) + object.toxicCombination = $root.google.cloud.securitycenter.v2.ToxicCombination.toObject(message.toxicCombination, options); + if (message.groupMemberships && message.groupMemberships.length) { + object.groupMemberships = []; + for (var j = 0; j < message.groupMemberships.length; ++j) + object.groupMemberships[j] = $root.google.cloud.securitycenter.v2.GroupMembership.toObject(message.groupMemberships[j], options); + } return object; }; @@ -76387,6 +77046,7 @@ * @property {number} OBSERVATION=4 OBSERVATION value * @property {number} SCC_ERROR=5 SCC_ERROR value * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value + * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value */ Finding.FindingClass = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -76397,12 +77057,273 @@ values[valuesById[4] = "OBSERVATION"] = 4; values[valuesById[5] = "SCC_ERROR"] = 5; values[valuesById[6] = "POSTURE_VIOLATION"] = 6; + values[valuesById[7] = "TOXIC_COMBINATION"] = 7; return values; })(); return Finding; })(); + v2.GroupMembership = (function() { + + /** + * Properties of a GroupMembership. + * @memberof google.cloud.securitycenter.v2 + * @interface IGroupMembership + * @property {google.cloud.securitycenter.v2.GroupMembership.GroupType|null} [groupType] GroupMembership groupType + * @property {string|null} [groupId] GroupMembership groupId + */ + + /** + * Constructs a new GroupMembership. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a GroupMembership. + * @implements IGroupMembership + * @constructor + * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set + */ + function GroupMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupMembership groupType. + * @member {google.cloud.securitycenter.v2.GroupMembership.GroupType} groupType + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + */ + GroupMembership.prototype.groupType = 0; + + /** + * GroupMembership groupId. + * @member {string} groupId + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + */ + GroupMembership.prototype.groupId = ""; + + /** + * Creates a new GroupMembership instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership instance + */ + GroupMembership.create = function create(properties) { + return new GroupMembership(properties); + }; + + /** + * Encodes the specified GroupMembership message. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.groupType); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + return writer; + }; + + /** + * Encodes the specified GroupMembership message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.GroupMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.IGroupMembership} message GroupMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.GroupMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.groupType = reader.int32(); + break; + } + case 2: { + message.groupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupMembership message. + * @function verify + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groupType != null && message.hasOwnProperty("groupType")) + switch (message.groupType) { + default: + return "groupType: enum value expected"; + case 0: + case 1: + break; + } + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + return null; + }; + + /** + * Creates a GroupMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.GroupMembership} GroupMembership + */ + GroupMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.GroupMembership) + return object; + var message = new $root.google.cloud.securitycenter.v2.GroupMembership(); + switch (object.groupType) { + default: + if (typeof object.groupType === "number") { + message.groupType = object.groupType; + break; + } + break; + case "GROUP_TYPE_UNSPECIFIED": + case 0: + message.groupType = 0; + break; + case "GROUP_TYPE_TOXIC_COMBINATION": + case 1: + message.groupType = 1; + break; + } + if (object.groupId != null) + message.groupId = String(object.groupId); + return message; + }; + + /** + * Creates a plain object from a GroupMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {google.cloud.securitycenter.v2.GroupMembership} message GroupMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.groupType = options.enums === String ? "GROUP_TYPE_UNSPECIFIED" : 0; + object.groupId = ""; + } + if (message.groupType != null && message.hasOwnProperty("groupType")) + object.groupType = options.enums === String ? $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] === undefined ? message.groupType : $root.google.cloud.securitycenter.v2.GroupMembership.GroupType[message.groupType] : message.groupType; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + return object; + }; + + /** + * Converts this GroupMembership to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @instance + * @returns {Object.} JSON object + */ + GroupMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupMembership + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.GroupMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.GroupMembership"; + }; + + /** + * GroupType enum. + * @name google.cloud.securitycenter.v2.GroupMembership.GroupType + * @enum {number} + * @property {number} GROUP_TYPE_UNSPECIFIED=0 GROUP_TYPE_UNSPECIFIED value + * @property {number} GROUP_TYPE_TOXIC_COMBINATION=1 GROUP_TYPE_TOXIC_COMBINATION value + */ + GroupMembership.GroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GROUP_TYPE_TOXIC_COMBINATION"] = 1; + return values; + })(); + + return GroupMembership; + })(); + v2.IamBinding = (function() { /** @@ -85115,6 +86036,249 @@ return SecurityPosture; })(); + v2.ToxicCombination = (function() { + + /** + * Properties of a ToxicCombination. + * @memberof google.cloud.securitycenter.v2 + * @interface IToxicCombination + * @property {number|null} [attackExposureScore] ToxicCombination attackExposureScore + * @property {Array.|null} [relatedFindings] ToxicCombination relatedFindings + */ + + /** + * Constructs a new ToxicCombination. + * @memberof google.cloud.securitycenter.v2 + * @classdesc Represents a ToxicCombination. + * @implements IToxicCombination + * @constructor + * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set + */ + function ToxicCombination(properties) { + this.relatedFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToxicCombination attackExposureScore. + * @member {number} attackExposureScore + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + */ + ToxicCombination.prototype.attackExposureScore = 0; + + /** + * ToxicCombination relatedFindings. + * @member {Array.} relatedFindings + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + */ + ToxicCombination.prototype.relatedFindings = $util.emptyArray; + + /** + * Creates a new ToxicCombination instance using the specified properties. + * @function create + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination=} [properties] Properties to set + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination instance + */ + ToxicCombination.create = function create(properties) { + return new ToxicCombination(properties); + }; + + /** + * Encodes the specified ToxicCombination message. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @function encode + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attackExposureScore != null && Object.hasOwnProperty.call(message, "attackExposureScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.attackExposureScore); + if (message.relatedFindings != null && message.relatedFindings.length) + for (var i = 0; i < message.relatedFindings.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relatedFindings[i]); + return writer; + }; + + /** + * Encodes the specified ToxicCombination message, length delimited. Does not implicitly {@link google.cloud.securitycenter.v2.ToxicCombination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.IToxicCombination} message ToxicCombination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToxicCombination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attackExposureScore = reader.double(); + break; + } + case 2: { + if (!(message.relatedFindings && message.relatedFindings.length)) + message.relatedFindings = []; + message.relatedFindings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToxicCombination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToxicCombination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToxicCombination message. + * @function verify + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToxicCombination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + if (typeof message.attackExposureScore !== "number") + return "attackExposureScore: number expected"; + if (message.relatedFindings != null && message.hasOwnProperty("relatedFindings")) { + if (!Array.isArray(message.relatedFindings)) + return "relatedFindings: array expected"; + for (var i = 0; i < message.relatedFindings.length; ++i) + if (!$util.isString(message.relatedFindings[i])) + return "relatedFindings: string[] expected"; + } + return null; + }; + + /** + * Creates a ToxicCombination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.securitycenter.v2.ToxicCombination} ToxicCombination + */ + ToxicCombination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.securitycenter.v2.ToxicCombination) + return object; + var message = new $root.google.cloud.securitycenter.v2.ToxicCombination(); + if (object.attackExposureScore != null) + message.attackExposureScore = Number(object.attackExposureScore); + if (object.relatedFindings) { + if (!Array.isArray(object.relatedFindings)) + throw TypeError(".google.cloud.securitycenter.v2.ToxicCombination.relatedFindings: array expected"); + message.relatedFindings = []; + for (var i = 0; i < object.relatedFindings.length; ++i) + message.relatedFindings[i] = String(object.relatedFindings[i]); + } + return message; + }; + + /** + * Creates a plain object from a ToxicCombination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {google.cloud.securitycenter.v2.ToxicCombination} message ToxicCombination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToxicCombination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedFindings = []; + if (options.defaults) + object.attackExposureScore = 0; + if (message.attackExposureScore != null && message.hasOwnProperty("attackExposureScore")) + object.attackExposureScore = options.json && !isFinite(message.attackExposureScore) ? String(message.attackExposureScore) : message.attackExposureScore; + if (message.relatedFindings && message.relatedFindings.length) { + object.relatedFindings = []; + for (var j = 0; j < message.relatedFindings.length; ++j) + object.relatedFindings[j] = message.relatedFindings[j]; + } + return object; + }; + + /** + * Converts this ToxicCombination to JSON. + * @function toJSON + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @instance + * @returns {Object.} JSON object + */ + ToxicCombination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToxicCombination + * @function getTypeUrl + * @memberof google.cloud.securitycenter.v2.ToxicCombination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToxicCombination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.securitycenter.v2.ToxicCombination"; + }; + + return ToxicCombination; + })(); + v2.Vulnerability = (function() { /** diff --git a/packages/google-cloud-securitycenter/protos/protos.json b/packages/google-cloud-securitycenter/protos/protos.json index 9159468bdf4..689ed2406b2 100644 --- a/packages/google-cloud-securitycenter/protos/protos.json +++ b/packages/google-cloud-securitycenter/protos/protos.json @@ -1088,6 +1088,15 @@ "notebook": { "type": "Notebook", "id": 63 + }, + "toxicCombination": { + "type": "ToxicCombination", + "id": 64 + }, + "groupMemberships": { + "rule": "repeated", + "type": "GroupMembership", + "id": 65 } }, "nested": { @@ -1123,7 +1132,28 @@ "MISCONFIGURATION": 3, "OBSERVATION": 4, "SCC_ERROR": 5, - "POSTURE_VIOLATION": 6 + "POSTURE_VIOLATION": 6, + "TOXIC_COMBINATION": 7 + } + } + } + }, + "GroupMembership": { + "fields": { + "groupType": { + "type": "GroupType", + "id": 1 + }, + "groupId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "GroupType": { + "values": { + "GROUP_TYPE_UNSPECIFIED": 0, + "GROUP_TYPE_TOXIC_COMBINATION": 1 } } } @@ -1800,6 +1830,19 @@ } } }, + "ToxicCombination": { + "fields": { + "attackExposureScore": { + "type": "double", + "id": 1 + }, + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, "Vulnerability": { "fields": { "cve": { @@ -8417,6 +8460,15 @@ "rule": "repeated", "type": "LoadBalancer", "id": 50 + }, + "toxicCombination": { + "type": "ToxicCombination", + "id": 56 + }, + "groupMemberships": { + "rule": "repeated", + "type": "GroupMembership", + "id": 57 } }, "nested": { @@ -8452,7 +8504,28 @@ "MISCONFIGURATION": 3, "OBSERVATION": 4, "SCC_ERROR": 5, - "POSTURE_VIOLATION": 6 + "POSTURE_VIOLATION": 6, + "TOXIC_COMBINATION": 7 + } + } + } + }, + "GroupMembership": { + "fields": { + "groupType": { + "type": "GroupType", + "id": 1 + }, + "groupId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "GroupType": { + "values": { + "GROUP_TYPE_UNSPECIFIED": 0, + "GROUP_TYPE_TOXIC_COMBINATION": 1 } } } @@ -9130,6 +9203,19 @@ } } }, + "ToxicCombination": { + "fields": { + "attackExposureScore": { + "type": "double", + "id": 1 + }, + "relatedFindings": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, "Vulnerability": { "fields": { "cve": { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json index e2cfe458ff1..f00b2cc239c 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata.google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json index a05f2f7e077..aa2b0d5bf13 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1/snippet_metadata_google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json index 0d4d2b58e8f..034785e35d0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata.google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json index 0d4d2b58e8f..034785e35d0 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1beta1/snippet_metadata_google.cloud.securitycenter.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json index a5c5d3d372f..b8ab9b607ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata.google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json index a5c5d3d372f..b8ab9b607ac 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json +++ b/packages/google-cloud-securitycenter/samples/generated/v1p1beta1/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json b/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json index 8c51ad1f3f5..30139ebf100 100644 --- a/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json +++ b/packages/google-cloud-securitycenter/samples/generated/v2/snippet_metadata_google.cloud.securitycenter.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycenter", - "version": "8.8.0", + "version": "8.9.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-securitycenter/samples/package.json b/packages/google-cloud-securitycenter/samples/package.json index ead0e6677e8..c42fc176f05 100644 --- a/packages/google-cloud-securitycenter/samples/package.json +++ b/packages/google-cloud-securitycenter/samples/package.json @@ -14,7 +14,7 @@ "license": "Apache-2.0", "dependencies": { "@google-cloud/pubsub": "^4.0.0", - "@google-cloud/security-center": "^8.8.0" + "@google-cloud/security-center": "^8.9.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json index 9cd3ca275c2..e28a93bb8b4 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v1/security_center_proto_list.json @@ -18,6 +18,7 @@ "../../protos/google/cloud/securitycenter/v1/file.proto", "../../protos/google/cloud/securitycenter/v1/finding.proto", "../../protos/google/cloud/securitycenter/v1/folder.proto", + "../../protos/google/cloud/securitycenter/v1/group_membership.proto", "../../protos/google/cloud/securitycenter/v1/iam_binding.proto", "../../protos/google/cloud/securitycenter/v1/indicator.proto", "../../protos/google/cloud/securitycenter/v1/kernel_rootkit.proto", @@ -41,5 +42,6 @@ "../../protos/google/cloud/securitycenter/v1/security_posture.proto", "../../protos/google/cloud/securitycenter/v1/securitycenter_service.proto", "../../protos/google/cloud/securitycenter/v1/source.proto", + "../../protos/google/cloud/securitycenter/v1/toxic_combination.proto", "../../protos/google/cloud/securitycenter/v1/vulnerability.proto" ] diff --git a/packages/google-cloud-securitycenter/src/v2/security_center_proto_list.json b/packages/google-cloud-securitycenter/src/v2/security_center_proto_list.json index 646b0a3a8a8..9271fe5c766 100644 --- a/packages/google-cloud-securitycenter/src/v2/security_center_proto_list.json +++ b/packages/google-cloud-securitycenter/src/v2/security_center_proto_list.json @@ -16,6 +16,7 @@ "../../protos/google/cloud/securitycenter/v2/external_system.proto", "../../protos/google/cloud/securitycenter/v2/file.proto", "../../protos/google/cloud/securitycenter/v2/finding.proto", + "../../protos/google/cloud/securitycenter/v2/group_membership.proto", "../../protos/google/cloud/securitycenter/v2/iam_binding.proto", "../../protos/google/cloud/securitycenter/v2/indicator.proto", "../../protos/google/cloud/securitycenter/v2/kernel_rootkit.proto", @@ -36,6 +37,7 @@ "../../protos/google/cloud/securitycenter/v2/securitycenter_service.proto", "../../protos/google/cloud/securitycenter/v2/simulation.proto", "../../protos/google/cloud/securitycenter/v2/source.proto", + "../../protos/google/cloud/securitycenter/v2/toxic_combination.proto", "../../protos/google/cloud/securitycenter/v2/valued_resource.proto", "../../protos/google/cloud/securitycenter/v2/vulnerability.proto" ] diff --git a/packages/google-cloud-securitycentermanagement/CHANGELOG.md b/packages/google-cloud-securitycentermanagement/CHANGELOG.md index ccdd938bf01..066266bb727 100644 --- a/packages/google-cloud-securitycentermanagement/CHANGELOG.md +++ b/packages/google-cloud-securitycentermanagement/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/securitycentermanagement-v0.3.0...securitycentermanagement-v0.4.0) (2024-06-21) + + +### Features + +* [securitycentermanagement] add `TOXIC_COMBINATION` to `FindingClass` enum ([#5489](https://github.com/googleapis/google-cloud-node/issues/5489)) ([458d04e](https://github.com/googleapis/google-cloud-node/commit/458d04e25c339b4bce483f2535e86af8b323f169)) +* [securitycentermanagement] add an INGEST_ONLY EnablementState ([#5445](https://github.com/googleapis/google-cloud-node/issues/5445)) ([5073655](https://github.com/googleapis/google-cloud-node/commit/50736554b0433c16534e771d6673dffe3efac7c9)) + ## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/securitycentermanagement-v0.2.0...securitycentermanagement-v0.3.0) (2024-05-23) diff --git a/packages/google-cloud-securitycentermanagement/package.json b/packages/google-cloud-securitycentermanagement/package.json index e0d93f25014..a72dc33a057 100644 --- a/packages/google-cloud-securitycentermanagement/package.json +++ b/packages/google-cloud-securitycentermanagement/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/securitycentermanagement", - "version": "0.3.0", + "version": "0.4.0", "description": "Security Center Management API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto b/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto index bf63b1b5311..dca152b5bc4 100644 --- a/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto +++ b/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto @@ -493,6 +493,11 @@ message SecurityCenterService { // State is disabled. DISABLED = 3; + + // SCC is configured to ingest findings from this service but not enable + // this service. Not a valid intended_enablement_state (that is, this is a + // readonly state). + INGEST_ONLY = 4; } // Identifier. The name of the service. @@ -1103,6 +1108,10 @@ message SimulatedFinding { // Describes a potential security risk due to a change in the security // posture. POSTURE_VIOLATION = 6; + + // Describes a combination of security issues that represent a more severe + // security problem when taken together. + TOXIC_COMBINATION = 7; } // Identifier. The [relative resource @@ -1619,6 +1628,10 @@ message GetSecurityCenterServiceRequest { type: "securitycentermanagement.googleapis.com/SecurityCenterService" } ]; + + // Flag that, when set, will be used to filter the ModuleSettings that are + // in scope. The default setting is that all modules will be shown. + bool show_eligible_modules_only = 2; } // Request message for listing Security Command Center services. @@ -1643,6 +1656,10 @@ message ListSecurityCenterServicesRequest { // Optional. The value returned by the last call indicating a continuation. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Flag that, when set, will be used to filter the ModuleSettings that are + // in scope. The default setting is that all modules will be shown. + bool show_eligible_modules_only = 4; } // Response message for listing Security Command Center services. @@ -1667,12 +1684,12 @@ message UpdateSecurityCenterServiceRequest { google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will + // Optional. When set to true, only validations (including IAM checks) will be // done for the request (service will not be updated). An OK response - // indicates the request is valid while an error response indicates the - // request is invalid. Note that a subsequent request to actually update the - // service could still fail because 1. the state could have changed (e.g. IAM - // permission lost) or - // 2. A failure occurred while trying to delete the module. + // indicates that the request is valid, while an error response indicates that + // the request is invalid. Note that a subsequent request to actually update + // the service could still fail for one of the following reasons: + // - The state could have changed (e.g. IAM permission lost). + // - A failure occurred while trying to delete the module. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-securitycentermanagement/protos/protos.d.ts b/packages/google-cloud-securitycentermanagement/protos/protos.d.ts index 5cab91fbb90..b72c28d9115 100644 --- a/packages/google-cloud-securitycentermanagement/protos/protos.d.ts +++ b/packages/google-cloud-securitycentermanagement/protos/protos.d.ts @@ -728,7 +728,8 @@ export namespace google { ENABLEMENT_STATE_UNSPECIFIED = 0, INHERITED = 1, ENABLED = 2, - DISABLED = 3 + DISABLED = 3, + INGEST_ONLY = 4 } } @@ -2983,7 +2984,8 @@ export namespace google { MISCONFIGURATION = 3, OBSERVATION = 4, SCC_ERROR = 5, - POSTURE_VIOLATION = 6 + POSTURE_VIOLATION = 6, + TOXIC_COMBINATION = 7 } } @@ -5081,6 +5083,9 @@ export namespace google { /** GetSecurityCenterServiceRequest name */ name?: (string|null); + + /** GetSecurityCenterServiceRequest showEligibleModulesOnly */ + showEligibleModulesOnly?: (boolean|null); } /** Represents a GetSecurityCenterServiceRequest. */ @@ -5095,6 +5100,9 @@ export namespace google { /** GetSecurityCenterServiceRequest name. */ public name: string; + /** GetSecurityCenterServiceRequest showEligibleModulesOnly. */ + public showEligibleModulesOnly: boolean; + /** * Creates a new GetSecurityCenterServiceRequest instance using the specified properties. * @param [properties] Properties to set @@ -5184,6 +5192,9 @@ export namespace google { /** ListSecurityCenterServicesRequest pageToken */ pageToken?: (string|null); + + /** ListSecurityCenterServicesRequest showEligibleModulesOnly */ + showEligibleModulesOnly?: (boolean|null); } /** Represents a ListSecurityCenterServicesRequest. */ @@ -5204,6 +5215,9 @@ export namespace google { /** ListSecurityCenterServicesRequest pageToken. */ public pageToken: string; + /** ListSecurityCenterServicesRequest showEligibleModulesOnly. */ + public showEligibleModulesOnly: boolean; + /** * Creates a new ListSecurityCenterServicesRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-securitycentermanagement/protos/protos.js b/packages/google-cloud-securitycentermanagement/protos/protos.js index a6ffceeb68e..843c82ed633 100644 --- a/packages/google-cloud-securitycentermanagement/protos/protos.js +++ b/packages/google-cloud-securitycentermanagement/protos/protos.js @@ -1034,6 +1034,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.effectiveEnablementState != null && message.hasOwnProperty("effectiveEnablementState")) @@ -1044,6 +1045,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.modules != null && message.hasOwnProperty("modules")) { @@ -1106,6 +1108,10 @@ case 3: message.intendedEnablementState = 3; break; + case "INGEST_ONLY": + case 4: + message.intendedEnablementState = 4; + break; } switch (object.effectiveEnablementState) { default: @@ -1130,6 +1136,10 @@ case 3: message.effectiveEnablementState = 3; break; + case "INGEST_ONLY": + case 4: + message.effectiveEnablementState = 4; + break; } if (object.modules) { if (typeof object.modules !== "object") @@ -1375,6 +1385,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.effectiveEnablementState != null && message.hasOwnProperty("effectiveEnablementState")) @@ -1385,6 +1396,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -1425,6 +1437,10 @@ case 3: message.intendedEnablementState = 3; break; + case "INGEST_ONLY": + case 4: + message.intendedEnablementState = 4; + break; } switch (object.effectiveEnablementState) { default: @@ -1449,6 +1465,10 @@ case 3: message.effectiveEnablementState = 3; break; + case "INGEST_ONLY": + case 4: + message.effectiveEnablementState = 4; + break; } return message; }; @@ -1514,6 +1534,7 @@ * @property {number} INHERITED=1 INHERITED value * @property {number} ENABLED=2 ENABLED value * @property {number} DISABLED=3 DISABLED value + * @property {number} INGEST_ONLY=4 INGEST_ONLY value */ SecurityCenterService.EnablementState = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -1521,6 +1542,7 @@ values[valuesById[1] = "INHERITED"] = 1; values[valuesById[2] = "ENABLED"] = 2; values[valuesById[3] = "DISABLED"] = 3; + values[valuesById[4] = "INGEST_ONLY"] = 4; return values; })(); @@ -6801,6 +6823,7 @@ case 4: case 5: case 6: + case 7: break; } return null; @@ -6924,6 +6947,10 @@ case 6: message.findingClass = 6; break; + case "TOXIC_COMBINATION": + case 7: + message.findingClass = 7; + break; } return message; }; @@ -7051,6 +7078,7 @@ * @property {number} OBSERVATION=4 OBSERVATION value * @property {number} SCC_ERROR=5 SCC_ERROR value * @property {number} POSTURE_VIOLATION=6 POSTURE_VIOLATION value + * @property {number} TOXIC_COMBINATION=7 TOXIC_COMBINATION value */ SimulatedFinding.FindingClass = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7061,6 +7089,7 @@ values[valuesById[4] = "OBSERVATION"] = 4; values[valuesById[5] = "SCC_ERROR"] = 5; values[valuesById[6] = "POSTURE_VIOLATION"] = 6; + values[valuesById[7] = "TOXIC_COMBINATION"] = 7; return values; })(); @@ -12050,6 +12079,7 @@ * @memberof google.cloud.securitycentermanagement.v1 * @interface IGetSecurityCenterServiceRequest * @property {string|null} [name] GetSecurityCenterServiceRequest name + * @property {boolean|null} [showEligibleModulesOnly] GetSecurityCenterServiceRequest showEligibleModulesOnly */ /** @@ -12075,6 +12105,14 @@ */ GetSecurityCenterServiceRequest.prototype.name = ""; + /** + * GetSecurityCenterServiceRequest showEligibleModulesOnly. + * @member {boolean} showEligibleModulesOnly + * @memberof google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest + * @instance + */ + GetSecurityCenterServiceRequest.prototype.showEligibleModulesOnly = false; + /** * Creates a new GetSecurityCenterServiceRequest instance using the specified properties. * @function create @@ -12101,6 +12139,8 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.showEligibleModulesOnly != null && Object.hasOwnProperty.call(message, "showEligibleModulesOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.showEligibleModulesOnly); return writer; }; @@ -12139,6 +12179,10 @@ message.name = reader.string(); break; } + case 2: { + message.showEligibleModulesOnly = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -12177,6 +12221,9 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.showEligibleModulesOnly != null && message.hasOwnProperty("showEligibleModulesOnly")) + if (typeof message.showEligibleModulesOnly !== "boolean") + return "showEligibleModulesOnly: boolean expected"; return null; }; @@ -12194,6 +12241,8 @@ var message = new $root.google.cloud.securitycentermanagement.v1.GetSecurityCenterServiceRequest(); if (object.name != null) message.name = String(object.name); + if (object.showEligibleModulesOnly != null) + message.showEligibleModulesOnly = Boolean(object.showEligibleModulesOnly); return message; }; @@ -12210,10 +12259,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.showEligibleModulesOnly = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.showEligibleModulesOnly != null && message.hasOwnProperty("showEligibleModulesOnly")) + object.showEligibleModulesOnly = message.showEligibleModulesOnly; return object; }; @@ -12255,6 +12308,7 @@ * @property {string|null} [parent] ListSecurityCenterServicesRequest parent * @property {number|null} [pageSize] ListSecurityCenterServicesRequest pageSize * @property {string|null} [pageToken] ListSecurityCenterServicesRequest pageToken + * @property {boolean|null} [showEligibleModulesOnly] ListSecurityCenterServicesRequest showEligibleModulesOnly */ /** @@ -12296,6 +12350,14 @@ */ ListSecurityCenterServicesRequest.prototype.pageToken = ""; + /** + * ListSecurityCenterServicesRequest showEligibleModulesOnly. + * @member {boolean} showEligibleModulesOnly + * @memberof google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesRequest + * @instance + */ + ListSecurityCenterServicesRequest.prototype.showEligibleModulesOnly = false; + /** * Creates a new ListSecurityCenterServicesRequest instance using the specified properties. * @function create @@ -12326,6 +12388,8 @@ 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.showEligibleModulesOnly != null && Object.hasOwnProperty.call(message, "showEligibleModulesOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showEligibleModulesOnly); return writer; }; @@ -12372,6 +12436,10 @@ message.pageToken = reader.string(); break; } + case 4: { + message.showEligibleModulesOnly = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -12416,6 +12484,9 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.showEligibleModulesOnly != null && message.hasOwnProperty("showEligibleModulesOnly")) + if (typeof message.showEligibleModulesOnly !== "boolean") + return "showEligibleModulesOnly: boolean expected"; return null; }; @@ -12437,6 +12508,8 @@ message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.showEligibleModulesOnly != null) + message.showEligibleModulesOnly = Boolean(object.showEligibleModulesOnly); return message; }; @@ -12457,6 +12530,7 @@ object.parent = ""; object.pageSize = 0; object.pageToken = ""; + object.showEligibleModulesOnly = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -12464,6 +12538,8 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.showEligibleModulesOnly != null && message.hasOwnProperty("showEligibleModulesOnly")) + object.showEligibleModulesOnly = message.showEligibleModulesOnly; return object; }; diff --git a/packages/google-cloud-securitycentermanagement/protos/protos.json b/packages/google-cloud-securitycentermanagement/protos/protos.json index a3b8e69870c..60e69ef3ba8 100644 --- a/packages/google-cloud-securitycentermanagement/protos/protos.json +++ b/packages/google-cloud-securitycentermanagement/protos/protos.json @@ -701,7 +701,8 @@ "ENABLEMENT_STATE_UNSPECIFIED": 0, "INHERITED": 1, "ENABLED": 2, - "DISABLED": 3 + "DISABLED": 3, + "INGEST_ONLY": 4 } } } @@ -1264,7 +1265,8 @@ "MISCONFIGURATION": 3, "OBSERVATION": 4, "SCC_ERROR": 5, - "POSTURE_VIOLATION": 6 + "POSTURE_VIOLATION": 6, + "TOXIC_COMBINATION": 7 } } } @@ -1756,6 +1758,10 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "securitycentermanagement.googleapis.com/SecurityCenterService" } + }, + "showEligibleModulesOnly": { + "type": "bool", + "id": 2 } } }, @@ -1782,6 +1788,10 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "showEligibleModulesOnly": { + "type": "bool", + "id": 4 } } }, diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js index 28e2681d585..570e74065f9 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js @@ -42,6 +42,11 @@ function main(name) { * * web-security-scanner */ // const name = 'abc123' + /** + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. + */ + // const showEligibleModulesOnly = true // Imports the Securitycentermanagement library const {SecurityCenterManagementClient} = require('@google-cloud/securitycentermanagement').v1; diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js index 586bec1d9a1..82db48cf0e8 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js @@ -45,6 +45,11 @@ function main(parent) { * Optional. The value returned by the last call indicating a continuation. */ // const pageToken = 'abc123' + /** + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. + */ + // const showEligibleModulesOnly = true // Imports the Securitycentermanagement library const {SecurityCenterManagementClient} = require('@google-cloud/securitycentermanagement').v1; diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js index a569bfd7c1f..045b894a221 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js @@ -39,13 +39,13 @@ function main(securityCenterService, updateMask) { */ // const updateMask = {} /** - * Optional. When set to true, only validations (including IAM checks) will + * Optional. When set to true, only validations (including IAM checks) will be * done for the request (service will not be updated). An OK response - * indicates the request is valid while an error response indicates the - * request is invalid. Note that a subsequent request to actually update the - * service could still fail because 1. the state could have changed (e.g. IAM - * permission lost) or - * 2. A failure occurred while trying to delete the module. + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json index 2bae9ada603..df7530bc666 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-securitycentermanagement", - "version": "0.3.0", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { @@ -846,7 +846,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 68, "type": "FULL" } ], @@ -858,6 +858,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "show_eligible_modules_only", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.securitycentermanagement.v1.SecurityCenterService", @@ -886,7 +890,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 73, "type": "FULL" } ], @@ -906,6 +910,10 @@ { "name": "page_token", "type": "TYPE_STRING" + }, + { + "name": "show_eligible_modules_only", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.securitycentermanagement.v1.ListSecurityCenterServicesResponse", diff --git a/packages/google-cloud-securitycentermanagement/samples/package.json b/packages/google-cloud-securitycentermanagement/samples/package.json index eae0c7e27e7..476ac3f05b4 100644 --- a/packages/google-cloud-securitycentermanagement/samples/package.json +++ b/packages/google-cloud-securitycentermanagement/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/securitycentermanagement": "^0.3.0" + "@google-cloud/securitycentermanagement": "^0.4.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts b/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts index 52976b680ab..ca8096fbd74 100644 --- a/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts +++ b/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts @@ -1888,6 +1888,9 @@ export class SecurityCenterManagementClient { * * security-health-analytics * * vm-threat-detection * * web-security-scanner + * @param {boolean} request.showEligibleModulesOnly + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1994,13 +1997,13 @@ export class SecurityCenterManagementClient { * * "intended_enablement_state" * * "modules" * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will + * Optional. When set to true, only validations (including IAM checks) will be * done for the request (service will not be updated). An OK response - * indicates the request is valid while an error response indicates the - * request is invalid. Note that a subsequent request to actually update the - * service could still fail because 1. the state could have changed (e.g. IAM - * permission lost) or - * 2. A failure occurred while trying to delete the module. + * indicates that the request is valid, while an error response indicates that + * the request is invalid. Note that a subsequent request to actually update + * the service could still fail for one of the following reasons: + * - The state could have changed (e.g. IAM permission lost). + * - A failure occurred while trying to delete the module. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3413,6 +3416,9 @@ export class SecurityCenterManagementClient { * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] * Optional. The value returned by the last call indicating a continuation. + * @param {boolean} request.showEligibleModulesOnly + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3521,6 +3527,9 @@ export class SecurityCenterManagementClient { * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] * Optional. The value returned by the last call indicating a continuation. + * @param {boolean} request.showEligibleModulesOnly + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3573,6 +3582,9 @@ export class SecurityCenterManagementClient { * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] * Optional. The value returned by the last call indicating a continuation. + * @param {boolean} request.showEligibleModulesOnly + * Flag that, when set, will be used to filter the ModuleSettings that are + * in scope. The default setting is that all modules will be shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-speech/CHANGELOG.md b/packages/google-cloud-speech/CHANGELOG.md index 8a11108e83c..cc14e83a6d3 100644 --- a/packages/google-cloud-speech/CHANGELOG.md +++ b/packages/google-cloud-speech/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/speech?activeTab=versions +## [6.6.1](https://github.com/googleapis/google-cloud-node/compare/speech-v6.6.0...speech-v6.6.1) (2024-06-21) + + +### Bug Fixes + +* Avoid unhandled exception on streamingRecognize ([#5465](https://github.com/googleapis/google-cloud-node/issues/5465)) ([30aef59](https://github.com/googleapis/google-cloud-node/commit/30aef59a85ea7d9835b08694f9be482b84e30c94)) + ## [6.6.0](https://github.com/googleapis/google-cloud-node/compare/speech-v6.5.0...speech-v6.6.0) (2024-05-21) diff --git a/packages/google-cloud-speech/package.json b/packages/google-cloud-speech/package.json index f9b751103e0..3b28a10186b 100644 --- a/packages/google-cloud-speech/package.json +++ b/packages/google-cloud-speech/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/speech", "description": "Cloud Speech Client Library for Node.js", - "version": "6.6.0", + "version": "6.6.1", "license": "Apache-2.0", "author": "Google Inc.", "engines": { diff --git a/packages/google-cloud-speech/samples/generated/v1/snippet_metadata.google.cloud.speech.v1.json b/packages/google-cloud-speech/samples/generated/v1/snippet_metadata.google.cloud.speech.v1.json index 8c485b3b2cb..1174a015b99 100644 --- a/packages/google-cloud-speech/samples/generated/v1/snippet_metadata.google.cloud.speech.v1.json +++ b/packages/google-cloud-speech/samples/generated/v1/snippet_metadata.google.cloud.speech.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json b/packages/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json index 8c485b3b2cb..1174a015b99 100644 --- a/packages/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json +++ b/packages/google-cloud-speech/samples/generated/v1/snippet_metadata_google.cloud.speech.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata.google.cloud.speech.v1p1beta1.json b/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata.google.cloud.speech.v1p1beta1.json index 15cb5388b28..bef539c5944 100644 --- a/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata.google.cloud.speech.v1p1beta1.json +++ b/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata.google.cloud.speech.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json b/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json index 15cb5388b28..bef539c5944 100644 --- a/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json +++ b/packages/google-cloud-speech/samples/generated/v1p1beta1/snippet_metadata_google.cloud.speech.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/generated/v2/snippet_metadata.google.cloud.speech.v2.json b/packages/google-cloud-speech/samples/generated/v2/snippet_metadata.google.cloud.speech.v2.json index 240e5a9f4c7..6c48bf74671 100644 --- a/packages/google-cloud-speech/samples/generated/v2/snippet_metadata.google.cloud.speech.v2.json +++ b/packages/google-cloud-speech/samples/generated/v2/snippet_metadata.google.cloud.speech.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json b/packages/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json index 240e5a9f4c7..6c48bf74671 100644 --- a/packages/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json +++ b/packages/google-cloud-speech/samples/generated/v2/snippet_metadata_google.cloud.speech.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-speech", - "version": "6.6.0", + "version": "6.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-speech/samples/package.json b/packages/google-cloud-speech/samples/package.json index 31c481b3be2..2852303fc15 100644 --- a/packages/google-cloud-speech/samples/package.json +++ b/packages/google-cloud-speech/samples/package.json @@ -15,7 +15,7 @@ "test": "c8 mocha test --timeout 600000" }, "dependencies": { - "@google-cloud/speech": "^6.6.0", + "@google-cloud/speech": "^6.6.1", "@google-cloud/storage": "^7.0.0", "chalk": "^5.0.0", "fs.promises": "^0.1.2", diff --git a/packages/google-cloud-speech/src/v1/speech_client.ts b/packages/google-cloud-speech/src/v1/speech_client.ts index c197f29521d..a9f26023fc0 100644 --- a/packages/google-cloud-speech/src/v1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1/speech_client.ts @@ -317,7 +317,7 @@ export class SpeechClient { (...args: Array<{}>) => { if (this._terminated) { if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); + const stream = new PassThrough({objectMode: true}); setImmediate(() => { stream.emit( 'error', diff --git a/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts index acdae04de0f..aef9143d26d 100644 --- a/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts +++ b/packages/google-cloud-speech/src/v1p1beta1/speech_client.ts @@ -317,7 +317,7 @@ export class SpeechClient { (...args: Array<{}>) => { if (this._terminated) { if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); + const stream = new PassThrough({objectMode: true}); setImmediate(() => { stream.emit( 'error', diff --git a/packages/google-cloud-speech/src/v2/speech_client.ts b/packages/google-cloud-speech/src/v2/speech_client.ts index 9772e978344..6280a044b80 100644 --- a/packages/google-cloud-speech/src/v2/speech_client.ts +++ b/packages/google-cloud-speech/src/v2/speech_client.ts @@ -534,7 +534,7 @@ export class SpeechClient { (...args: Array<{}>) => { if (this._terminated) { if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); + const stream = new PassThrough({objectMode: true}); setImmediate(() => { stream.emit( 'error', diff --git a/packages/google-cloud-sql/CHANGELOG.md b/packages/google-cloud-sql/CHANGELOG.md index bdff2c91ec1..32ecd4709f8 100644 --- a/packages/google-cloud-sql/CHANGELOG.md +++ b/packages/google-cloud-sql/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.15.0](https://github.com/googleapis/google-cloud-node/compare/sql-v0.14.0...sql-v0.15.0) (2024-06-26) + + +### Features + +* [sql] A new field `upgradable_database_versions` is added to message `.google.cloud.sql.v1beta4.DatabaseInstance` ([#5478](https://github.com/googleapis/google-cloud-node/issues/5478)) ([e0f0fd2](https://github.com/googleapis/google-cloud-node/commit/e0f0fd24a745bb3b072456aa012c37946f2084a4)) + ## [0.14.0](https://github.com/googleapis/google-cloud-node/compare/sql-v0.13.0...sql-v0.14.0) (2024-06-12) diff --git a/packages/google-cloud-sql/package.json b/packages/google-cloud-sql/package.json index f459d7f71bc..6a2071d219b 100644 --- a/packages/google-cloud-sql/package.json +++ b/packages/google-cloud-sql/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/sql", - "version": "0.14.0", + "version": "0.15.0", "description": "Sql client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto index f16cab2f514..ba42b677231 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_instances.proto @@ -971,9 +971,9 @@ message CloneContext { // instance. Clone all databases if empty. repeated string database_names = 9; - // Optional. (Point-in-time recovery for PostgreSQL only) Clone to an instance - // in the specified zone. If no zone is specified, clone to the same zone as - // the source instance. + // Optional. Copy clone and point-in-time recovery clone of an instance to the + // specified zone. If no zone is specified, clone to the same primary zone as + // the source instance. This field applies to all DB types. optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL]; } @@ -1208,8 +1208,9 @@ message DatabaseInstance { // The start time of any upcoming scheduled maintenance for this instance. SqlScheduledMaintenance scheduled_maintenance = 30; - // The status indicating if instance satisfiesPzs. - // Reserved for future use. + // This status indicates whether the instance satisfies PZS. + // + // The status is reserved for future use. google.protobuf.BoolValue satisfies_pzs = 35; // Output only. Stores the current database version running on the instance @@ -1238,6 +1239,10 @@ message DatabaseInstance { // The current software version on the instance. string maintenance_version = 42; + // Output only. All database versions that are available for upgrade. + repeated AvailableDatabaseVersion upgradable_database_versions = 45 + [(google.api.field_behavior) = OUTPUT_ONLY]; + optional SqlNetworkArchitecture sql_network_architecture = 47; // Output only. The link to service attachment of PSC instance. @@ -1297,6 +1302,15 @@ message GeminiInstanceConfig { // the event that the primary instance experiences regional failure. // Only applicable to MySQL. message ReplicationCluster { + // Output only. If set, it indicates this instance has a private service + // access (PSA) dns endpoint that is pointing to the primary instance of the + // cluster. If this instance is the primary, the dns should be pointing to + // this instance. After Switchover or Replica failover, this DNS endpoint + // points to the promoted instance. This is a read-only field, returned to the + // user as information. This field can exist even if a standalone instance + // does not yet have a replica, or had a DR replica that was deleted. + string psa_write_endpoint = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. If the instance is a primary instance, then this field identifies // the disaster recovery (DR) replica. A DR replica is an optional // configuration for Enterprise Plus edition instances. If the instance is a @@ -1310,6 +1324,19 @@ message ReplicationCluster { bool dr_replica = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// An available database version. It can be a major or a minor version. +message AvailableDatabaseVersion { + // The version's major version name. + optional string major_version = 3; + + // The database version name. For MySQL 8.0, this string provides the database + // major and minor version. + optional string name = 8; + + // The database version's display name. + optional string display_name = 9; +} + // Reschedule options for maintenance windows. message SqlInstancesRescheduleMaintenanceRequestBody { enum RescheduleType { @@ -1572,6 +1599,18 @@ message SqlExternalSyncSettingError { // cores of the replica instance is less than 8, and the memory of the // replica is less than 32 GB. INSUFFICIENT_MACHINE_TIER = 44; + + // The warning message indicates the unsupported extensions will not be + // migrated to the destination. + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + + // The warning message indicates the pg_cron extension and settings will not + // be migrated to the destination. + EXTENSIONS_NOT_MIGRATED = 46; + + // The error message indicates that pg_cron flags are enabled on the + // destination which is not supported during the migration. + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; } // Can be `sql#externalSyncSettingError` or diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto index d70fb1dfe02..27b07fb61d4 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1/cloud_sql_resources.proto @@ -967,7 +967,8 @@ message Operation { // Re-encrypts CMEK instances with latest key version. REENCRYPT = 38; - // Switches over to replica instance from primary. + // Switches the roles of the primary and replica pair. The target instance + // should be the replica. SWITCHOVER = 39; // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). @@ -994,6 +995,10 @@ message Operation { // Maintenance typically causes the instance to be unavailable for 1-3 // minutes. SELF_SERVICE_MAINTENANCE = 46; + + // Switches a primary instance to a replica. This operation runs as part of + // a switchover operation to the original primary instance. + SWITCHOVER_TO_REPLICA = 47; } // The status of an operation. @@ -1327,8 +1332,8 @@ message Settings { // Server timezone, relevant only for Cloud SQL for SQL Server. string time_zone = 34; - // Specifies advance machine configuration for the instance - // relevant only for SQL Server. + // Specifies advanced machine configuration for the instances relevant only + // for SQL Server. AdvancedMachineFeatures advanced_machine_features = 35; // Configuration for data cache. @@ -1503,6 +1508,9 @@ enum SqlDatabaseVersion { // The database version is PostgreSQL 15. POSTGRES_15 = 172; + // The database version is PostgreSQL 16. + POSTGRES_16 = 272; + // The database version is MySQL 8. MYSQL_8_0 = 20; @@ -1557,6 +1565,9 @@ enum SqlDatabaseVersion { // The database version is MySQL 8.4. MYSQL_8_4 = 398; + // The database version is MySQL 8.4 and the patch version is 0. + MYSQL_8_4_0 = 399; + // The database version is SQL Server 2019 Standard. SQLSERVER_2019_STANDARD = 26; diff --git a/packages/google-cloud-sql/protos/google/cloud/sql/v1beta4/cloud_sql_resources.proto b/packages/google-cloud-sql/protos/google/cloud/sql/v1beta4/cloud_sql_resources.proto index f8aa79a67be..828998d2df1 100644 --- a/packages/google-cloud-sql/protos/google/cloud/sql/v1beta4/cloud_sql_resources.proto +++ b/packages/google-cloud-sql/protos/google/cloud/sql/v1beta4/cloud_sql_resources.proto @@ -294,10 +294,17 @@ message CloneContext { // instance. Clone all databases if empty. repeated string database_names = 9; - // Optional. (Point-in-time recovery for PostgreSQL only) Clone to an instance - // in the specified zone. If no zone is specified, clone to the same zone as + // Optional. Copy clone and point-in-time recovery clone of an instance to the + // specified zone. If no zone is specified, clone to the same primary zone as // the source instance. optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Copy clone and point-in-time recovery clone of a regional + // instance in the specified zones. If not specified, clone to the same + // secondary zone as the source instance. This value cannot be the same as the + // preferred_zone field. + optional string preferred_secondary_zone = 11 + [(google.api.field_behavior) = OPTIONAL]; } // Represents a SQL database on the Cloud SQL instance. @@ -602,8 +609,9 @@ message DatabaseInstance { // The start time of any upcoming scheduled maintenance for this instance. SqlScheduledMaintenance scheduled_maintenance = 30; - // The status indicating if instance satisfiesPzs. - // Reserved for future use. + // This status indicates whether the instance satisfies PZS. + // + // The status is reserved for future use. google.protobuf.BoolValue satisfies_pzs = 35; // Output only. Stores the current database version running on the instance @@ -632,6 +640,10 @@ message DatabaseInstance { // The current software version on the instance. string maintenance_version = 42; + // Output only. All database versions that are available for upgrade. + repeated AvailableDatabaseVersion upgradable_database_versions = 45 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // The SQL network architecture for the instance. optional SqlNetworkArchitecture sql_network_architecture = 47; @@ -691,6 +703,16 @@ message GeminiInstanceConfig { // in the event that the primary instance has regional failure. // Only applicable to MySQL. message ReplicationCluster { + // Output only. If set, it indicates this instance has a private service + // access (PSA) dns endpoint that is pointing to the primary instance of the + // cluster. If this instance is the primary, the dns should be pointing to + // this instance. After Switchover or Replica failover, this DNS endpoint + // points to the promoted instance. This is a read-only field, returned to the + // user as information. This field can exist even if a standalone instance + // does not yet have a replica, or had a DR replica that was deleted. + optional string psa_write_endpoint = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. If the instance is a primary instance, then this field identifies // the disaster recovery (DR) replica. A DR replica is an optional // configuration for Enterprise Plus edition instances. If the instance is a @@ -705,6 +727,19 @@ message ReplicationCluster { optional bool dr_replica = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// An available database version. It can be a major or a minor version. +message AvailableDatabaseVersion { + // The version's major version name. + optional string major_version = 3; + + // The database version name. For MySQL 8.0, this string provides the database + // major and minor version. + optional string name = 8; + + // The database version's display name. + optional string display_name = 9; +} + // Database list response. message DatabasesListResponse { // This is always `sql#databasesList`. @@ -1389,6 +1424,18 @@ message SqlExternalSyncSettingError { // cores of the replica instance is less than 8, and the memory of the // replica is less than 32 GB. INSUFFICIENT_MACHINE_TIER = 44; + + // The warning message indicates the unsupported extensions will not be + // migrated to the destination. + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45; + + // The warning message indicates the pg_cron extension and settings will not + // be migrated to the destination. + EXTENSIONS_NOT_MIGRATED = 46; + + // The error message indicates that pg_cron flags are enabled on the + // destination which is not supported during the migration. + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47; } // Can be `sql#externalSyncSettingError` or @@ -1838,7 +1885,8 @@ message Operation { // Re-encrypts CMEK instances with latest key version. REENCRYPT = 38; - // Switches over to replica instance from primary. + // Switches the roles of the primary and replica pair. The target instance + // should be the replica. SWITCHOVER = 39; // Acquire a lease for the setup of SQL Server Reporting Services (SSRS). @@ -1865,6 +1913,10 @@ message Operation { // Maintenance typically causes the instance to be unavailable for 1-3 // minutes. SELF_SERVICE_MAINTENANCE = 46; + + // Switches a primary instance to a replica. This operation runs as part of + // a switchover operation to the original primary instance. + SWITCHOVER_TO_REPLICA = 47; } // The status of an operation. @@ -2264,8 +2316,8 @@ message Settings { // Server timezone, relevant only for Cloud SQL for SQL Server. string time_zone = 34; - // Specifies advance machine configuration for the instance - // relevant only for SQL Server. + // Specifies advanced machine configuration for the instances relevant only + // for SQL Server. AdvancedMachineFeatures advanced_machine_features = 35; // Configuration for data cache. @@ -2599,6 +2651,9 @@ enum SqlDatabaseVersion { // The database version is PostgreSQL 15. POSTGRES_15 = 172; + // The database version is PostgreSQL 16. + POSTGRES_16 = 272; + // The database version is MySQL 8. MYSQL_8_0 = 20; @@ -2653,6 +2708,9 @@ enum SqlDatabaseVersion { // The database version is MySQL 8.4. MYSQL_8_4 = 398; + // The database version is MySQL 8.4 and the patch version is 0. + MYSQL_8_4_0 = 399; + // The database version is SQL Server 2019 Standard. SQLSERVER_2019_STANDARD = 26; diff --git a/packages/google-cloud-sql/protos/protos.d.ts b/packages/google-cloud-sql/protos/protos.d.ts index ea7f5b4d988..4c4eaa95dbe 100644 --- a/packages/google-cloud-sql/protos/protos.d.ts +++ b/packages/google-cloud-sql/protos/protos.d.ts @@ -5209,7 +5209,8 @@ export namespace google { RELEASE_SSRS_LEASE = 43, RECONFIGURE_OLD_PRIMARY = 44, CLUSTER_MAINTENANCE = 45, - SELF_SERVICE_MAINTENANCE = 46 + SELF_SERVICE_MAINTENANCE = 46, + SWITCHOVER_TO_REPLICA = 47 } /** SqlOperationStatus enum. */ @@ -6584,6 +6585,7 @@ export namespace google { POSTGRES_13 = 23, POSTGRES_14 = 110, POSTGRES_15 = 172, + POSTGRES_16 = 272, MYSQL_8_0 = 20, MYSQL_8_0_18 = 41, MYSQL_8_0_26 = 85, @@ -6602,6 +6604,7 @@ export namespace google { MYSQL_8_0_39 = 357, MYSQL_8_0_40 = 358, MYSQL_8_4 = 398, + MYSQL_8_4_0 = 399, SQLSERVER_2019_STANDARD = 26, SQLSERVER_2019_ENTERPRISE = 27, SQLSERVER_2019_EXPRESS = 28, @@ -15027,6 +15030,9 @@ export namespace google { /** DatabaseInstance maintenanceVersion */ maintenanceVersion?: (string|null); + /** DatabaseInstance upgradableDatabaseVersions */ + upgradableDatabaseVersions?: (google.cloud.sql.v1.IAvailableDatabaseVersion[]|null); + /** DatabaseInstance sqlNetworkArchitecture */ sqlNetworkArchitecture?: (google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|keyof typeof google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|null); @@ -15166,6 +15172,9 @@ export namespace google { /** DatabaseInstance maintenanceVersion. */ public maintenanceVersion: string; + /** DatabaseInstance upgradableDatabaseVersions. */ + public upgradableDatabaseVersions: google.cloud.sql.v1.IAvailableDatabaseVersion[]; + /** DatabaseInstance sqlNetworkArchitecture. */ public sqlNetworkArchitecture?: (google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|keyof typeof google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|null); @@ -15796,6 +15805,9 @@ export namespace google { /** Properties of a ReplicationCluster. */ interface IReplicationCluster { + /** ReplicationCluster psaWriteEndpoint */ + psaWriteEndpoint?: (string|null); + /** ReplicationCluster failoverDrReplicaName */ failoverDrReplicaName?: (string|null); @@ -15812,6 +15824,9 @@ export namespace google { */ constructor(properties?: google.cloud.sql.v1.IReplicationCluster); + /** ReplicationCluster psaWriteEndpoint. */ + public psaWriteEndpoint: string; + /** ReplicationCluster failoverDrReplicaName. */ public failoverDrReplicaName: string; @@ -15896,6 +15911,124 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AvailableDatabaseVersion. */ + interface IAvailableDatabaseVersion { + + /** AvailableDatabaseVersion majorVersion */ + majorVersion?: (string|null); + + /** AvailableDatabaseVersion name */ + name?: (string|null); + + /** AvailableDatabaseVersion displayName */ + displayName?: (string|null); + } + + /** Represents an AvailableDatabaseVersion. */ + class AvailableDatabaseVersion implements IAvailableDatabaseVersion { + + /** + * Constructs a new AvailableDatabaseVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.sql.v1.IAvailableDatabaseVersion); + + /** AvailableDatabaseVersion majorVersion. */ + public majorVersion?: (string|null); + + /** AvailableDatabaseVersion name. */ + public name?: (string|null); + + /** AvailableDatabaseVersion displayName. */ + public displayName?: (string|null); + + /** AvailableDatabaseVersion _majorVersion. */ + public _majorVersion?: "majorVersion"; + + /** AvailableDatabaseVersion _name. */ + public _name?: "name"; + + /** AvailableDatabaseVersion _displayName. */ + public _displayName?: "displayName"; + + /** + * Creates a new AvailableDatabaseVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailableDatabaseVersion instance + */ + public static create(properties?: google.cloud.sql.v1.IAvailableDatabaseVersion): google.cloud.sql.v1.AvailableDatabaseVersion; + + /** + * Encodes the specified AvailableDatabaseVersion message. Does not implicitly {@link google.cloud.sql.v1.AvailableDatabaseVersion.verify|verify} messages. + * @param message AvailableDatabaseVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.sql.v1.IAvailableDatabaseVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailableDatabaseVersion message, length delimited. Does not implicitly {@link google.cloud.sql.v1.AvailableDatabaseVersion.verify|verify} messages. + * @param message AvailableDatabaseVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.sql.v1.IAvailableDatabaseVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.sql.v1.AvailableDatabaseVersion; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.sql.v1.AvailableDatabaseVersion; + + /** + * Verifies an AvailableDatabaseVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvailableDatabaseVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailableDatabaseVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.sql.v1.AvailableDatabaseVersion; + + /** + * Creates a plain object from an AvailableDatabaseVersion message. Also converts values to other types if specified. + * @param message AvailableDatabaseVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.sql.v1.AvailableDatabaseVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvailableDatabaseVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvailableDatabaseVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SqlInstancesRescheduleMaintenanceRequestBody. */ interface ISqlInstancesRescheduleMaintenanceRequestBody { @@ -16912,7 +17045,10 @@ export namespace google { PG_SUBSCRIPTION_COUNT = 41, PG_SYNC_PARALLEL_LEVEL = 42, INSUFFICIENT_DISK_SIZE = 43, - INSUFFICIENT_MACHINE_TIER = 44 + INSUFFICIENT_MACHINE_TIER = 44, + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45, + EXTENSIONS_NOT_MIGRATED = 46, + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47 } } @@ -29035,6 +29171,9 @@ export namespace google { /** CloneContext preferredZone */ preferredZone?: (string|null); + + /** CloneContext preferredSecondaryZone */ + preferredSecondaryZone?: (string|null); } /** Represents a CloneContext. */ @@ -29070,9 +29209,15 @@ export namespace google { /** CloneContext preferredZone. */ public preferredZone?: (string|null); + /** CloneContext preferredSecondaryZone. */ + public preferredSecondaryZone?: (string|null); + /** CloneContext _preferredZone. */ public _preferredZone?: "preferredZone"; + /** CloneContext _preferredSecondaryZone. */ + public _preferredSecondaryZone?: "preferredSecondaryZone"; + /** * Creates a new CloneContext instance using the specified properties. * @param [properties] Properties to set @@ -29828,6 +29973,9 @@ export namespace google { /** DatabaseInstance maintenanceVersion */ maintenanceVersion?: (string|null); + /** DatabaseInstance upgradableDatabaseVersions */ + upgradableDatabaseVersions?: (google.cloud.sql.v1beta4.IAvailableDatabaseVersion[]|null); + /** DatabaseInstance sqlNetworkArchitecture */ sqlNetworkArchitecture?: (google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|keyof typeof google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|null); @@ -29967,6 +30115,9 @@ export namespace google { /** DatabaseInstance maintenanceVersion. */ public maintenanceVersion: string; + /** DatabaseInstance upgradableDatabaseVersions. */ + public upgradableDatabaseVersions: google.cloud.sql.v1beta4.IAvailableDatabaseVersion[]; + /** DatabaseInstance sqlNetworkArchitecture. */ public sqlNetworkArchitecture?: (google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|keyof typeof google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|null); @@ -30600,6 +30751,9 @@ export namespace google { /** Properties of a ReplicationCluster. */ interface IReplicationCluster { + /** ReplicationCluster psaWriteEndpoint */ + psaWriteEndpoint?: (string|null); + /** ReplicationCluster failoverDrReplicaName */ failoverDrReplicaName?: (string|null); @@ -30616,12 +30770,18 @@ export namespace google { */ constructor(properties?: google.cloud.sql.v1beta4.IReplicationCluster); + /** ReplicationCluster psaWriteEndpoint. */ + public psaWriteEndpoint?: (string|null); + /** ReplicationCluster failoverDrReplicaName. */ public failoverDrReplicaName?: (string|null); /** ReplicationCluster drReplica. */ public drReplica?: (boolean|null); + /** ReplicationCluster _psaWriteEndpoint. */ + public _psaWriteEndpoint?: "psaWriteEndpoint"; + /** ReplicationCluster _failoverDrReplicaName. */ public _failoverDrReplicaName?: "failoverDrReplicaName"; @@ -30706,6 +30866,124 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AvailableDatabaseVersion. */ + interface IAvailableDatabaseVersion { + + /** AvailableDatabaseVersion majorVersion */ + majorVersion?: (string|null); + + /** AvailableDatabaseVersion name */ + name?: (string|null); + + /** AvailableDatabaseVersion displayName */ + displayName?: (string|null); + } + + /** Represents an AvailableDatabaseVersion. */ + class AvailableDatabaseVersion implements IAvailableDatabaseVersion { + + /** + * Constructs a new AvailableDatabaseVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.sql.v1beta4.IAvailableDatabaseVersion); + + /** AvailableDatabaseVersion majorVersion. */ + public majorVersion?: (string|null); + + /** AvailableDatabaseVersion name. */ + public name?: (string|null); + + /** AvailableDatabaseVersion displayName. */ + public displayName?: (string|null); + + /** AvailableDatabaseVersion _majorVersion. */ + public _majorVersion?: "majorVersion"; + + /** AvailableDatabaseVersion _name. */ + public _name?: "name"; + + /** AvailableDatabaseVersion _displayName. */ + public _displayName?: "displayName"; + + /** + * Creates a new AvailableDatabaseVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailableDatabaseVersion instance + */ + public static create(properties?: google.cloud.sql.v1beta4.IAvailableDatabaseVersion): google.cloud.sql.v1beta4.AvailableDatabaseVersion; + + /** + * Encodes the specified AvailableDatabaseVersion message. Does not implicitly {@link google.cloud.sql.v1beta4.AvailableDatabaseVersion.verify|verify} messages. + * @param message AvailableDatabaseVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.sql.v1beta4.IAvailableDatabaseVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailableDatabaseVersion message, length delimited. Does not implicitly {@link google.cloud.sql.v1beta4.AvailableDatabaseVersion.verify|verify} messages. + * @param message AvailableDatabaseVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.sql.v1beta4.IAvailableDatabaseVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.sql.v1beta4.AvailableDatabaseVersion; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.sql.v1beta4.AvailableDatabaseVersion; + + /** + * Verifies an AvailableDatabaseVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AvailableDatabaseVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailableDatabaseVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.sql.v1beta4.AvailableDatabaseVersion; + + /** + * Creates a plain object from an AvailableDatabaseVersion message. Also converts values to other types if specified. + * @param message AvailableDatabaseVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.sql.v1beta4.AvailableDatabaseVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvailableDatabaseVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvailableDatabaseVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DatabasesListResponse. */ interface IDatabasesListResponse { @@ -34621,7 +34899,10 @@ export namespace google { PG_SUBSCRIPTION_COUNT = 41, PG_SYNC_PARALLEL_LEVEL = 42, INSUFFICIENT_DISK_SIZE = 43, - INSUFFICIENT_MACHINE_TIER = 44 + INSUFFICIENT_MACHINE_TIER = 44, + UNSUPPORTED_EXTENSIONS_NOT_MIGRATED = 45, + EXTENSIONS_NOT_MIGRATED = 46, + PG_CRON_FLAG_ENABLED_IN_REPLICA = 47 } } @@ -36207,7 +36488,8 @@ export namespace google { RELEASE_SSRS_LEASE = 43, RECONFIGURE_OLD_PRIMARY = 44, CLUSTER_MAINTENANCE = 45, - SELF_SERVICE_MAINTENANCE = 46 + SELF_SERVICE_MAINTENANCE = 46, + SWITCHOVER_TO_REPLICA = 47 } /** SqlOperationStatus enum. */ @@ -38792,6 +39074,7 @@ export namespace google { POSTGRES_13 = 23, POSTGRES_14 = 110, POSTGRES_15 = 172, + POSTGRES_16 = 272, MYSQL_8_0 = 20, MYSQL_8_0_18 = 41, MYSQL_8_0_26 = 85, @@ -38810,6 +39093,7 @@ export namespace google { MYSQL_8_0_39 = 357, MYSQL_8_0_40 = 358, MYSQL_8_4 = 398, + MYSQL_8_4_0 = 399, SQLSERVER_2019_STANDARD = 26, SQLSERVER_2019_ENTERPRISE = 27, SQLSERVER_2019_EXPRESS = 28, diff --git a/packages/google-cloud-sql/protos/protos.js b/packages/google-cloud-sql/protos/protos.js index a5bcbe0a7e2..b556bf0c8cc 100644 --- a/packages/google-cloud-sql/protos/protos.js +++ b/packages/google-cloud-sql/protos/protos.js @@ -13147,6 +13147,7 @@ case 44: case 45: case 46: + case 47: break; } if (message.importContext != null && message.hasOwnProperty("importContext")) { @@ -13434,6 +13435,10 @@ case 46: message.operationType = 46; break; + case "SWITCHOVER_TO_REPLICA": + case 47: + message.operationType = 47; + break; } if (object.importContext != null) { if (typeof object.importContext !== "object") @@ -13612,6 +13617,7 @@ * @property {number} RECONFIGURE_OLD_PRIMARY=44 RECONFIGURE_OLD_PRIMARY value * @property {number} CLUSTER_MAINTENANCE=45 CLUSTER_MAINTENANCE value * @property {number} SELF_SERVICE_MAINTENANCE=46 SELF_SERVICE_MAINTENANCE value + * @property {number} SWITCHOVER_TO_REPLICA=47 SWITCHOVER_TO_REPLICA value */ Operation.SqlOperationType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -13659,6 +13665,7 @@ values[valuesById[44] = "RECONFIGURE_OLD_PRIMARY"] = 44; values[valuesById[45] = "CLUSTER_MAINTENANCE"] = 45; values[valuesById[46] = "SELF_SERVICE_MAINTENANCE"] = 46; + values[valuesById[47] = "SWITCHOVER_TO_REPLICA"] = 47; return values; })(); @@ -17544,6 +17551,7 @@ * @property {number} POSTGRES_13=23 POSTGRES_13 value * @property {number} POSTGRES_14=110 POSTGRES_14 value * @property {number} POSTGRES_15=172 POSTGRES_15 value + * @property {number} POSTGRES_16=272 POSTGRES_16 value * @property {number} MYSQL_8_0=20 MYSQL_8_0 value * @property {number} MYSQL_8_0_18=41 MYSQL_8_0_18 value * @property {number} MYSQL_8_0_26=85 MYSQL_8_0_26 value @@ -17562,6 +17570,7 @@ * @property {number} MYSQL_8_0_39=357 MYSQL_8_0_39 value * @property {number} MYSQL_8_0_40=358 MYSQL_8_0_40 value * @property {number} MYSQL_8_4=398 MYSQL_8_4 value + * @property {number} MYSQL_8_4_0=399 MYSQL_8_4_0 value * @property {number} SQLSERVER_2019_STANDARD=26 SQLSERVER_2019_STANDARD value * @property {number} SQLSERVER_2019_ENTERPRISE=27 SQLSERVER_2019_ENTERPRISE value * @property {number} SQLSERVER_2019_EXPRESS=28 SQLSERVER_2019_EXPRESS value @@ -17589,6 +17598,7 @@ values[valuesById[23] = "POSTGRES_13"] = 23; values[valuesById[110] = "POSTGRES_14"] = 110; values[valuesById[172] = "POSTGRES_15"] = 172; + values[valuesById[272] = "POSTGRES_16"] = 272; values[valuesById[20] = "MYSQL_8_0"] = 20; values[valuesById[41] = "MYSQL_8_0_18"] = 41; values[valuesById[85] = "MYSQL_8_0_26"] = 85; @@ -17607,6 +17617,7 @@ values[valuesById[357] = "MYSQL_8_0_39"] = 357; values[valuesById[358] = "MYSQL_8_0_40"] = 358; values[valuesById[398] = "MYSQL_8_4"] = 398; + values[valuesById[399] = "MYSQL_8_4_0"] = 399; values[valuesById[26] = "SQLSERVER_2019_STANDARD"] = 26; values[valuesById[27] = "SQLSERVER_2019_ENTERPRISE"] = 27; values[valuesById[28] = "SQLSERVER_2019_EXPRESS"] = 28; @@ -18679,6 +18690,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -18697,6 +18709,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -18828,6 +18841,10 @@ case 172: message.databaseVersion = 172; break; + case "POSTGRES_16": + case 272: + message.databaseVersion = 272; + break; case "MYSQL_8_0": case 20: message.databaseVersion = 20; @@ -18900,6 +18917,10 @@ case 398: message.databaseVersion = 398; break; + case "MYSQL_8_4_0": + case 399: + message.databaseVersion = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.databaseVersion = 26; @@ -22205,6 +22226,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -22223,6 +22245,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -22403,6 +22426,10 @@ case 172: message.appliesTo[i] = 172; break; + case "POSTGRES_16": + case 272: + message.appliesTo[i] = 272; + break; case "MYSQL_8_0": case 20: message.appliesTo[i] = 20; @@ -22475,6 +22502,10 @@ case 398: message.appliesTo[i] = 398; break; + case "MYSQL_8_4_0": + case 399: + message.appliesTo[i] = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.appliesTo[i] = 26; @@ -37134,6 +37165,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] DatabaseInstance createTime * @property {Array.|null} [availableMaintenanceVersions] DatabaseInstance availableMaintenanceVersions * @property {string|null} [maintenanceVersion] DatabaseInstance maintenanceVersion + * @property {Array.|null} [upgradableDatabaseVersions] DatabaseInstance upgradableDatabaseVersions * @property {google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|null} [sqlNetworkArchitecture] DatabaseInstance sqlNetworkArchitecture * @property {string|null} [pscServiceAttachmentLink] DatabaseInstance pscServiceAttachmentLink * @property {string|null} [dnsName] DatabaseInstance dnsName @@ -37156,6 +37188,7 @@ this.ipAddresses = []; this.suspensionReason = []; this.availableMaintenanceVersions = []; + this.upgradableDatabaseVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37450,6 +37483,14 @@ */ DatabaseInstance.prototype.maintenanceVersion = ""; + /** + * DatabaseInstance upgradableDatabaseVersions. + * @member {Array.} upgradableDatabaseVersions + * @memberof google.cloud.sql.v1.DatabaseInstance + * @instance + */ + DatabaseInstance.prototype.upgradableDatabaseVersions = $util.emptyArray; + /** * DatabaseInstance sqlNetworkArchitecture. * @member {google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture|null|undefined} sqlNetworkArchitecture @@ -37689,6 +37730,9 @@ writer.uint32(/* id 41, wireType 2 =*/330).string(message.availableMaintenanceVersions[i]); if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) writer.uint32(/* id 42, wireType 2 =*/338).string(message.maintenanceVersion); + if (message.upgradableDatabaseVersions != null && message.upgradableDatabaseVersions.length) + for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) + $root.google.cloud.sql.v1.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) writer.uint32(/* id 47, wireType 0 =*/376).int32(message.sqlNetworkArchitecture); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) @@ -37894,6 +37938,12 @@ message.maintenanceVersion = reader.string(); break; } + case 45: { + if (!(message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length)) + message.upgradableDatabaseVersions = []; + message.upgradableDatabaseVersions.push($root.google.cloud.sql.v1.AvailableDatabaseVersion.decode(reader, reader.uint32())); + break; + } case 47: { message.sqlNetworkArchitecture = reader.int32(); break; @@ -37995,6 +38045,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -38013,6 +38064,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -38191,6 +38243,15 @@ if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) if (!$util.isString(message.maintenanceVersion)) return "maintenanceVersion: string expected"; + if (message.upgradableDatabaseVersions != null && message.hasOwnProperty("upgradableDatabaseVersions")) { + if (!Array.isArray(message.upgradableDatabaseVersions)) + return "upgradableDatabaseVersions: array expected"; + for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) { + var error = $root.google.cloud.sql.v1.AvailableDatabaseVersion.verify(message.upgradableDatabaseVersions[i]); + if (error) + return "upgradableDatabaseVersions." + error; + } + } if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { properties._sqlNetworkArchitecture = 1; switch (message.sqlNetworkArchitecture) { @@ -38363,6 +38424,10 @@ case 172: message.databaseVersion = 172; break; + case "POSTGRES_16": + case 272: + message.databaseVersion = 272; + break; case "MYSQL_8_0": case 20: message.databaseVersion = 20; @@ -38435,6 +38500,10 @@ case 398: message.databaseVersion = 398; break; + case "MYSQL_8_4_0": + case 399: + message.databaseVersion = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.databaseVersion = 26; @@ -38666,6 +38735,16 @@ } if (object.maintenanceVersion != null) message.maintenanceVersion = String(object.maintenanceVersion); + if (object.upgradableDatabaseVersions) { + if (!Array.isArray(object.upgradableDatabaseVersions)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.upgradableDatabaseVersions: array expected"); + message.upgradableDatabaseVersions = []; + for (var i = 0; i < object.upgradableDatabaseVersions.length; ++i) { + if (typeof object.upgradableDatabaseVersions[i] !== "object") + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.upgradableDatabaseVersions: object expected"); + message.upgradableDatabaseVersions[i] = $root.google.cloud.sql.v1.AvailableDatabaseVersion.fromObject(object.upgradableDatabaseVersions[i]); + } + } switch (object.sqlNetworkArchitecture) { default: if (typeof object.sqlNetworkArchitecture === "number") { @@ -38725,6 +38804,7 @@ object.ipAddresses = []; object.suspensionReason = []; object.availableMaintenanceVersions = []; + object.upgradableDatabaseVersions = []; } if (options.defaults) { object.kind = ""; @@ -38847,6 +38927,11 @@ } if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) object.maintenanceVersion = message.maintenanceVersion; + if (message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length) { + object.upgradableDatabaseVersions = []; + for (var j = 0; j < message.upgradableDatabaseVersions.length; ++j) + object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options); + } if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { object.sqlNetworkArchitecture = options.enums === String ? $root.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] === undefined ? message.sqlNetworkArchitecture : $root.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] : message.sqlNetworkArchitecture; if (options.oneofs) @@ -40204,6 +40289,7 @@ * Properties of a ReplicationCluster. * @memberof google.cloud.sql.v1 * @interface IReplicationCluster + * @property {string|null} [psaWriteEndpoint] ReplicationCluster psaWriteEndpoint * @property {string|null} [failoverDrReplicaName] ReplicationCluster failoverDrReplicaName * @property {boolean|null} [drReplica] ReplicationCluster drReplica */ @@ -40223,6 +40309,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * ReplicationCluster psaWriteEndpoint. + * @member {string} psaWriteEndpoint + * @memberof google.cloud.sql.v1.ReplicationCluster + * @instance + */ + ReplicationCluster.prototype.psaWriteEndpoint = ""; + /** * ReplicationCluster failoverDrReplicaName. * @member {string} failoverDrReplicaName @@ -40263,6 +40357,8 @@ ReplicationCluster.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.psaWriteEndpoint); if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.failoverDrReplicaName); if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) @@ -40301,6 +40397,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.psaWriteEndpoint = reader.string(); + break; + } case 2: { message.failoverDrReplicaName = reader.string(); break; @@ -40344,6 +40444,9 @@ ReplicationCluster.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) + if (!$util.isString(message.psaWriteEndpoint)) + return "psaWriteEndpoint: string expected"; if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) if (!$util.isString(message.failoverDrReplicaName)) return "failoverDrReplicaName: string expected"; @@ -40365,6 +40468,8 @@ if (object instanceof $root.google.cloud.sql.v1.ReplicationCluster) return object; var message = new $root.google.cloud.sql.v1.ReplicationCluster(); + if (object.psaWriteEndpoint != null) + message.psaWriteEndpoint = String(object.psaWriteEndpoint); if (object.failoverDrReplicaName != null) message.failoverDrReplicaName = String(object.failoverDrReplicaName); if (object.drReplica != null) @@ -40386,9 +40491,12 @@ options = {}; var object = {}; if (options.defaults) { + object.psaWriteEndpoint = ""; object.failoverDrReplicaName = ""; object.drReplica = false; } + if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) + object.psaWriteEndpoint = message.psaWriteEndpoint; if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) object.failoverDrReplicaName = message.failoverDrReplicaName; if (message.drReplica != null && message.hasOwnProperty("drReplica")) @@ -40425,6 +40533,303 @@ return ReplicationCluster; })(); + v1.AvailableDatabaseVersion = (function() { + + /** + * Properties of an AvailableDatabaseVersion. + * @memberof google.cloud.sql.v1 + * @interface IAvailableDatabaseVersion + * @property {string|null} [majorVersion] AvailableDatabaseVersion majorVersion + * @property {string|null} [name] AvailableDatabaseVersion name + * @property {string|null} [displayName] AvailableDatabaseVersion displayName + */ + + /** + * Constructs a new AvailableDatabaseVersion. + * @memberof google.cloud.sql.v1 + * @classdesc Represents an AvailableDatabaseVersion. + * @implements IAvailableDatabaseVersion + * @constructor + * @param {google.cloud.sql.v1.IAvailableDatabaseVersion=} [properties] Properties to set + */ + function AvailableDatabaseVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvailableDatabaseVersion majorVersion. + * @member {string|null|undefined} majorVersion + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.majorVersion = null; + + /** + * AvailableDatabaseVersion name. + * @member {string|null|undefined} name + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.name = null; + + /** + * AvailableDatabaseVersion displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.displayName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AvailableDatabaseVersion _majorVersion. + * @member {"majorVersion"|undefined} _majorVersion + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_majorVersion", { + get: $util.oneOfGetter($oneOfFields = ["majorVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AvailableDatabaseVersion _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AvailableDatabaseVersion _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AvailableDatabaseVersion instance using the specified properties. + * @function create + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1.IAvailableDatabaseVersion=} [properties] Properties to set + * @returns {google.cloud.sql.v1.AvailableDatabaseVersion} AvailableDatabaseVersion instance + */ + AvailableDatabaseVersion.create = function create(properties) { + return new AvailableDatabaseVersion(properties); + }; + + /** + * Encodes the specified AvailableDatabaseVersion message. Does not implicitly {@link google.cloud.sql.v1.AvailableDatabaseVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1.IAvailableDatabaseVersion} message AvailableDatabaseVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableDatabaseVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.majorVersion); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AvailableDatabaseVersion message, length delimited. Does not implicitly {@link google.cloud.sql.v1.AvailableDatabaseVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1.IAvailableDatabaseVersion} message AvailableDatabaseVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableDatabaseVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.sql.v1.AvailableDatabaseVersion} AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableDatabaseVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.sql.v1.AvailableDatabaseVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.majorVersion = reader.string(); + break; + } + case 8: { + message.name = reader.string(); + break; + } + case 9: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.sql.v1.AvailableDatabaseVersion} AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableDatabaseVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvailableDatabaseVersion message. + * @function verify + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvailableDatabaseVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + properties._majorVersion = 1; + if (!$util.isString(message.majorVersion)) + return "majorVersion: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + return null; + }; + + /** + * Creates an AvailableDatabaseVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.sql.v1.AvailableDatabaseVersion} AvailableDatabaseVersion + */ + AvailableDatabaseVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.sql.v1.AvailableDatabaseVersion) + return object; + var message = new $root.google.cloud.sql.v1.AvailableDatabaseVersion(); + if (object.majorVersion != null) + message.majorVersion = String(object.majorVersion); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AvailableDatabaseVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1.AvailableDatabaseVersion} message AvailableDatabaseVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvailableDatabaseVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + object.majorVersion = message.majorVersion; + if (options.oneofs) + object._majorVersion = "majorVersion"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + return object; + }; + + /** + * Converts this AvailableDatabaseVersion to JSON. + * @function toJSON + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @instance + * @returns {Object.} JSON object + */ + AvailableDatabaseVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvailableDatabaseVersion + * @function getTypeUrl + * @memberof google.cloud.sql.v1.AvailableDatabaseVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvailableDatabaseVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.sql.v1.AvailableDatabaseVersion"; + }; + + return AvailableDatabaseVersion; + })(); + v1.SqlInstancesRescheduleMaintenanceRequestBody = (function() { /** @@ -42640,6 +43045,9 @@ case 42: case 43: case 44: + case 45: + case 46: + case 47: break; } if (message.detail != null && message.hasOwnProperty("detail")) @@ -42849,6 +43257,18 @@ case 44: message.type = 44; break; + case "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED": + case 45: + message.type = 45; + break; + case "EXTENSIONS_NOT_MIGRATED": + case 46: + message.type = 46; + break; + case "PG_CRON_FLAG_ENABLED_IN_REPLICA": + case 47: + message.type = 47; + break; } if (object.detail != null) message.detail = String(object.detail); @@ -42957,6 +43377,9 @@ * @property {number} PG_SYNC_PARALLEL_LEVEL=42 PG_SYNC_PARALLEL_LEVEL value * @property {number} INSUFFICIENT_DISK_SIZE=43 INSUFFICIENT_DISK_SIZE value * @property {number} INSUFFICIENT_MACHINE_TIER=44 INSUFFICIENT_MACHINE_TIER value + * @property {number} UNSUPPORTED_EXTENSIONS_NOT_MIGRATED=45 UNSUPPORTED_EXTENSIONS_NOT_MIGRATED value + * @property {number} EXTENSIONS_NOT_MIGRATED=46 EXTENSIONS_NOT_MIGRATED value + * @property {number} PG_CRON_FLAG_ENABLED_IN_REPLICA=47 PG_CRON_FLAG_ENABLED_IN_REPLICA value */ SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -43005,6 +43428,9 @@ values[valuesById[42] = "PG_SYNC_PARALLEL_LEVEL"] = 42; values[valuesById[43] = "INSUFFICIENT_DISK_SIZE"] = 43; values[valuesById[44] = "INSUFFICIENT_MACHINE_TIER"] = 44; + values[valuesById[45] = "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED"] = 45; + values[valuesById[46] = "EXTENSIONS_NOT_MIGRATED"] = 46; + values[valuesById[47] = "PG_CRON_FLAG_ENABLED_IN_REPLICA"] = 47; return values; })(); @@ -70706,6 +71132,7 @@ * @property {string|null} [allocatedIpRange] CloneContext allocatedIpRange * @property {Array.|null} [databaseNames] CloneContext databaseNames * @property {string|null} [preferredZone] CloneContext preferredZone + * @property {string|null} [preferredSecondaryZone] CloneContext preferredSecondaryZone */ /** @@ -70788,6 +71215,14 @@ */ CloneContext.prototype.preferredZone = null; + /** + * CloneContext preferredSecondaryZone. + * @member {string|null|undefined} preferredSecondaryZone + * @memberof google.cloud.sql.v1beta4.CloneContext + * @instance + */ + CloneContext.prototype.preferredSecondaryZone = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -70802,6 +71237,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * CloneContext _preferredSecondaryZone. + * @member {"preferredSecondaryZone"|undefined} _preferredSecondaryZone + * @memberof google.cloud.sql.v1beta4.CloneContext + * @instance + */ + Object.defineProperty(CloneContext.prototype, "_preferredSecondaryZone", { + get: $util.oneOfGetter($oneOfFields = ["preferredSecondaryZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new CloneContext instance using the specified properties. * @function create @@ -70843,6 +71289,8 @@ writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseNames[i]); if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.preferredZone); + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.preferredSecondaryZone); return writer; }; @@ -70911,6 +71359,10 @@ message.preferredZone = reader.string(); break; } + case 11: { + message.preferredSecondaryZone = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -70981,6 +71433,11 @@ if (!$util.isString(message.preferredZone)) return "preferredZone: string expected"; } + if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + properties._preferredSecondaryZone = 1; + if (!$util.isString(message.preferredSecondaryZone)) + return "preferredSecondaryZone: string expected"; + } return null; }; @@ -71030,6 +71487,8 @@ } if (object.preferredZone != null) message.preferredZone = String(object.preferredZone); + if (object.preferredSecondaryZone != null) + message.preferredSecondaryZone = String(object.preferredSecondaryZone); return message; }; @@ -71085,6 +71544,11 @@ if (options.oneofs) object._preferredZone = "preferredZone"; } + if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + object.preferredSecondaryZone = message.preferredSecondaryZone; + if (options.oneofs) + object._preferredSecondaryZone = "preferredSecondaryZone"; + } return object; }; @@ -72503,6 +72967,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] DatabaseInstance createTime * @property {Array.|null} [availableMaintenanceVersions] DatabaseInstance availableMaintenanceVersions * @property {string|null} [maintenanceVersion] DatabaseInstance maintenanceVersion + * @property {Array.|null} [upgradableDatabaseVersions] DatabaseInstance upgradableDatabaseVersions * @property {google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|null} [sqlNetworkArchitecture] DatabaseInstance sqlNetworkArchitecture * @property {string|null} [pscServiceAttachmentLink] DatabaseInstance pscServiceAttachmentLink * @property {string|null} [dnsName] DatabaseInstance dnsName @@ -72525,6 +72990,7 @@ this.ipAddresses = []; this.suspensionReason = []; this.availableMaintenanceVersions = []; + this.upgradableDatabaseVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -72819,6 +73285,14 @@ */ DatabaseInstance.prototype.maintenanceVersion = ""; + /** + * DatabaseInstance upgradableDatabaseVersions. + * @member {Array.} upgradableDatabaseVersions + * @memberof google.cloud.sql.v1beta4.DatabaseInstance + * @instance + */ + DatabaseInstance.prototype.upgradableDatabaseVersions = $util.emptyArray; + /** * DatabaseInstance sqlNetworkArchitecture. * @member {google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture|null|undefined} sqlNetworkArchitecture @@ -73069,6 +73543,9 @@ writer.uint32(/* id 41, wireType 2 =*/330).string(message.availableMaintenanceVersions[i]); if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) writer.uint32(/* id 42, wireType 2 =*/338).string(message.maintenanceVersion); + if (message.upgradableDatabaseVersions != null && message.upgradableDatabaseVersions.length) + for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) + $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) writer.uint32(/* id 47, wireType 0 =*/376).int32(message.sqlNetworkArchitecture); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) @@ -73274,6 +73751,12 @@ message.maintenanceVersion = reader.string(); break; } + case 45: { + if (!(message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length)) + message.upgradableDatabaseVersions = []; + message.upgradableDatabaseVersions.push($root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.decode(reader, reader.uint32())); + break; + } case 47: { message.sqlNetworkArchitecture = reader.int32(); break; @@ -73375,6 +73858,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -73393,6 +73877,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -73571,6 +74056,15 @@ if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) if (!$util.isString(message.maintenanceVersion)) return "maintenanceVersion: string expected"; + if (message.upgradableDatabaseVersions != null && message.hasOwnProperty("upgradableDatabaseVersions")) { + if (!Array.isArray(message.upgradableDatabaseVersions)) + return "upgradableDatabaseVersions: array expected"; + for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) { + var error = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.verify(message.upgradableDatabaseVersions[i]); + if (error) + return "upgradableDatabaseVersions." + error; + } + } if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { properties._sqlNetworkArchitecture = 1; switch (message.sqlNetworkArchitecture) { @@ -73746,6 +74240,10 @@ case 172: message.databaseVersion = 172; break; + case "POSTGRES_16": + case 272: + message.databaseVersion = 272; + break; case "MYSQL_8_0": case 20: message.databaseVersion = 20; @@ -73818,6 +74316,10 @@ case 398: message.databaseVersion = 398; break; + case "MYSQL_8_4_0": + case 399: + message.databaseVersion = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.databaseVersion = 26; @@ -74049,6 +74551,16 @@ } if (object.maintenanceVersion != null) message.maintenanceVersion = String(object.maintenanceVersion); + if (object.upgradableDatabaseVersions) { + if (!Array.isArray(object.upgradableDatabaseVersions)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.upgradableDatabaseVersions: array expected"); + message.upgradableDatabaseVersions = []; + for (var i = 0; i < object.upgradableDatabaseVersions.length; ++i) { + if (typeof object.upgradableDatabaseVersions[i] !== "object") + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.upgradableDatabaseVersions: object expected"); + message.upgradableDatabaseVersions[i] = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.fromObject(object.upgradableDatabaseVersions[i]); + } + } switch (object.sqlNetworkArchitecture) { default: if (typeof object.sqlNetworkArchitecture === "number") { @@ -74108,6 +74620,7 @@ object.ipAddresses = []; object.suspensionReason = []; object.availableMaintenanceVersions = []; + object.upgradableDatabaseVersions = []; } if (options.defaults) { object.kind = ""; @@ -74229,6 +74742,11 @@ } if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) object.maintenanceVersion = message.maintenanceVersion; + if (message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length) { + object.upgradableDatabaseVersions = []; + for (var j = 0; j < message.upgradableDatabaseVersions.length; ++j) + object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options); + } if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { object.sqlNetworkArchitecture = options.enums === String ? $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] === undefined ? message.sqlNetworkArchitecture : $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] : message.sqlNetworkArchitecture; if (options.oneofs) @@ -75589,6 +76107,7 @@ * Properties of a ReplicationCluster. * @memberof google.cloud.sql.v1beta4 * @interface IReplicationCluster + * @property {string|null} [psaWriteEndpoint] ReplicationCluster psaWriteEndpoint * @property {string|null} [failoverDrReplicaName] ReplicationCluster failoverDrReplicaName * @property {boolean|null} [drReplica] ReplicationCluster drReplica */ @@ -75608,6 +76127,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * ReplicationCluster psaWriteEndpoint. + * @member {string|null|undefined} psaWriteEndpoint + * @memberof google.cloud.sql.v1beta4.ReplicationCluster + * @instance + */ + ReplicationCluster.prototype.psaWriteEndpoint = null; + /** * ReplicationCluster failoverDrReplicaName. * @member {string|null|undefined} failoverDrReplicaName @@ -75627,6 +76154,17 @@ // OneOf field names bound to virtual getters and setters var $oneOfFields; + /** + * ReplicationCluster _psaWriteEndpoint. + * @member {"psaWriteEndpoint"|undefined} _psaWriteEndpoint + * @memberof google.cloud.sql.v1beta4.ReplicationCluster + * @instance + */ + Object.defineProperty(ReplicationCluster.prototype, "_psaWriteEndpoint", { + get: $util.oneOfGetter($oneOfFields = ["psaWriteEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * ReplicationCluster _failoverDrReplicaName. * @member {"failoverDrReplicaName"|undefined} _failoverDrReplicaName @@ -75673,6 +76211,8 @@ ReplicationCluster.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.psaWriteEndpoint); if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.failoverDrReplicaName); if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) @@ -75711,6 +76251,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.psaWriteEndpoint = reader.string(); + break; + } case 2: { message.failoverDrReplicaName = reader.string(); break; @@ -75755,6 +76299,11 @@ if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; + if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) { + properties._psaWriteEndpoint = 1; + if (!$util.isString(message.psaWriteEndpoint)) + return "psaWriteEndpoint: string expected"; + } if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) { properties._failoverDrReplicaName = 1; if (!$util.isString(message.failoverDrReplicaName)) @@ -75780,6 +76329,8 @@ if (object instanceof $root.google.cloud.sql.v1beta4.ReplicationCluster) return object; var message = new $root.google.cloud.sql.v1beta4.ReplicationCluster(); + if (object.psaWriteEndpoint != null) + message.psaWriteEndpoint = String(object.psaWriteEndpoint); if (object.failoverDrReplicaName != null) message.failoverDrReplicaName = String(object.failoverDrReplicaName); if (object.drReplica != null) @@ -75800,6 +76351,11 @@ if (!options) options = {}; var object = {}; + if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) { + object.psaWriteEndpoint = message.psaWriteEndpoint; + if (options.oneofs) + object._psaWriteEndpoint = "psaWriteEndpoint"; + } if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) { object.failoverDrReplicaName = message.failoverDrReplicaName; if (options.oneofs) @@ -75842,6 +76398,303 @@ return ReplicationCluster; })(); + v1beta4.AvailableDatabaseVersion = (function() { + + /** + * Properties of an AvailableDatabaseVersion. + * @memberof google.cloud.sql.v1beta4 + * @interface IAvailableDatabaseVersion + * @property {string|null} [majorVersion] AvailableDatabaseVersion majorVersion + * @property {string|null} [name] AvailableDatabaseVersion name + * @property {string|null} [displayName] AvailableDatabaseVersion displayName + */ + + /** + * Constructs a new AvailableDatabaseVersion. + * @memberof google.cloud.sql.v1beta4 + * @classdesc Represents an AvailableDatabaseVersion. + * @implements IAvailableDatabaseVersion + * @constructor + * @param {google.cloud.sql.v1beta4.IAvailableDatabaseVersion=} [properties] Properties to set + */ + function AvailableDatabaseVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvailableDatabaseVersion majorVersion. + * @member {string|null|undefined} majorVersion + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.majorVersion = null; + + /** + * AvailableDatabaseVersion name. + * @member {string|null|undefined} name + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.name = null; + + /** + * AvailableDatabaseVersion displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + AvailableDatabaseVersion.prototype.displayName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AvailableDatabaseVersion _majorVersion. + * @member {"majorVersion"|undefined} _majorVersion + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_majorVersion", { + get: $util.oneOfGetter($oneOfFields = ["majorVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AvailableDatabaseVersion _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AvailableDatabaseVersion _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + */ + Object.defineProperty(AvailableDatabaseVersion.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AvailableDatabaseVersion instance using the specified properties. + * @function create + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1beta4.IAvailableDatabaseVersion=} [properties] Properties to set + * @returns {google.cloud.sql.v1beta4.AvailableDatabaseVersion} AvailableDatabaseVersion instance + */ + AvailableDatabaseVersion.create = function create(properties) { + return new AvailableDatabaseVersion(properties); + }; + + /** + * Encodes the specified AvailableDatabaseVersion message. Does not implicitly {@link google.cloud.sql.v1beta4.AvailableDatabaseVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1beta4.IAvailableDatabaseVersion} message AvailableDatabaseVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableDatabaseVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.majorVersion); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified AvailableDatabaseVersion message, length delimited. Does not implicitly {@link google.cloud.sql.v1beta4.AvailableDatabaseVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1beta4.IAvailableDatabaseVersion} message AvailableDatabaseVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableDatabaseVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.sql.v1beta4.AvailableDatabaseVersion} AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableDatabaseVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.majorVersion = reader.string(); + break; + } + case 8: { + message.name = reader.string(); + break; + } + case 9: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvailableDatabaseVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.sql.v1beta4.AvailableDatabaseVersion} AvailableDatabaseVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableDatabaseVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvailableDatabaseVersion message. + * @function verify + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvailableDatabaseVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + properties._majorVersion = 1; + if (!$util.isString(message.majorVersion)) + return "majorVersion: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + return null; + }; + + /** + * Creates an AvailableDatabaseVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.sql.v1beta4.AvailableDatabaseVersion} AvailableDatabaseVersion + */ + AvailableDatabaseVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion) + return object; + var message = new $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion(); + if (object.majorVersion != null) + message.majorVersion = String(object.majorVersion); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AvailableDatabaseVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {google.cloud.sql.v1beta4.AvailableDatabaseVersion} message AvailableDatabaseVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvailableDatabaseVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + object.majorVersion = message.majorVersion; + if (options.oneofs) + object._majorVersion = "majorVersion"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + return object; + }; + + /** + * Converts this AvailableDatabaseVersion to JSON. + * @function toJSON + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @instance + * @returns {Object.} JSON object + */ + AvailableDatabaseVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvailableDatabaseVersion + * @function getTypeUrl + * @memberof google.cloud.sql.v1beta4.AvailableDatabaseVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvailableDatabaseVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.sql.v1beta4.AvailableDatabaseVersion"; + }; + + return AvailableDatabaseVersion; + })(); + v1beta4.DatabasesListResponse = (function() { /** @@ -79380,6 +80233,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -79398,6 +80252,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -79578,6 +80433,10 @@ case 172: message.appliesTo[i] = 172; break; + case "POSTGRES_16": + case 272: + message.appliesTo[i] = 272; + break; case "MYSQL_8_0": case 20: message.appliesTo[i] = 20; @@ -79650,6 +80509,10 @@ case 398: message.appliesTo[i] = 398; break; + case "MYSQL_8_4_0": + case 399: + message.appliesTo[i] = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.appliesTo[i] = 26; @@ -85595,6 +86458,9 @@ case 42: case 43: case 44: + case 45: + case 46: + case 47: break; } if (message.detail != null && message.hasOwnProperty("detail")) @@ -85804,6 +86670,18 @@ case 44: message.type = 44; break; + case "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED": + case 45: + message.type = 45; + break; + case "EXTENSIONS_NOT_MIGRATED": + case 46: + message.type = 46; + break; + case "PG_CRON_FLAG_ENABLED_IN_REPLICA": + case 47: + message.type = 47; + break; } if (object.detail != null) message.detail = String(object.detail); @@ -85912,6 +86790,9 @@ * @property {number} PG_SYNC_PARALLEL_LEVEL=42 PG_SYNC_PARALLEL_LEVEL value * @property {number} INSUFFICIENT_DISK_SIZE=43 INSUFFICIENT_DISK_SIZE value * @property {number} INSUFFICIENT_MACHINE_TIER=44 INSUFFICIENT_MACHINE_TIER value + * @property {number} UNSUPPORTED_EXTENSIONS_NOT_MIGRATED=45 UNSUPPORTED_EXTENSIONS_NOT_MIGRATED value + * @property {number} EXTENSIONS_NOT_MIGRATED=46 EXTENSIONS_NOT_MIGRATED value + * @property {number} PG_CRON_FLAG_ENABLED_IN_REPLICA=47 PG_CRON_FLAG_ENABLED_IN_REPLICA value */ SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -85960,6 +86841,9 @@ values[valuesById[42] = "PG_SYNC_PARALLEL_LEVEL"] = 42; values[valuesById[43] = "INSUFFICIENT_DISK_SIZE"] = 43; values[valuesById[44] = "INSUFFICIENT_MACHINE_TIER"] = 44; + values[valuesById[45] = "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED"] = 45; + values[valuesById[46] = "EXTENSIONS_NOT_MIGRATED"] = 46; + values[valuesById[47] = "PG_CRON_FLAG_ENABLED_IN_REPLICA"] = 47; return values; })(); @@ -89905,6 +90789,7 @@ case 44: case 45: case 46: + case 47: break; } if (message.importContext != null && message.hasOwnProperty("importContext")) { @@ -90192,6 +91077,10 @@ case 46: message.operationType = 46; break; + case "SWITCHOVER_TO_REPLICA": + case 47: + message.operationType = 47; + break; } if (object.importContext != null) { if (typeof object.importContext !== "object") @@ -90370,6 +91259,7 @@ * @property {number} RECONFIGURE_OLD_PRIMARY=44 RECONFIGURE_OLD_PRIMARY value * @property {number} CLUSTER_MAINTENANCE=45 CLUSTER_MAINTENANCE value * @property {number} SELF_SERVICE_MAINTENANCE=46 SELF_SERVICE_MAINTENANCE value + * @property {number} SWITCHOVER_TO_REPLICA=47 SWITCHOVER_TO_REPLICA value */ Operation.SqlOperationType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -90417,6 +91307,7 @@ values[valuesById[44] = "RECONFIGURE_OLD_PRIMARY"] = 44; values[valuesById[45] = "CLUSTER_MAINTENANCE"] = 45; values[valuesById[46] = "SELF_SERVICE_MAINTENANCE"] = 46; + values[valuesById[47] = "SWITCHOVER_TO_REPLICA"] = 47; return values; })(); @@ -97136,6 +98027,7 @@ * @property {number} POSTGRES_13=23 POSTGRES_13 value * @property {number} POSTGRES_14=110 POSTGRES_14 value * @property {number} POSTGRES_15=172 POSTGRES_15 value + * @property {number} POSTGRES_16=272 POSTGRES_16 value * @property {number} MYSQL_8_0=20 MYSQL_8_0 value * @property {number} MYSQL_8_0_18=41 MYSQL_8_0_18 value * @property {number} MYSQL_8_0_26=85 MYSQL_8_0_26 value @@ -97154,6 +98046,7 @@ * @property {number} MYSQL_8_0_39=357 MYSQL_8_0_39 value * @property {number} MYSQL_8_0_40=358 MYSQL_8_0_40 value * @property {number} MYSQL_8_4=398 MYSQL_8_4 value + * @property {number} MYSQL_8_4_0=399 MYSQL_8_4_0 value * @property {number} SQLSERVER_2019_STANDARD=26 SQLSERVER_2019_STANDARD value * @property {number} SQLSERVER_2019_ENTERPRISE=27 SQLSERVER_2019_ENTERPRISE value * @property {number} SQLSERVER_2019_EXPRESS=28 SQLSERVER_2019_EXPRESS value @@ -97181,6 +98074,7 @@ values[valuesById[23] = "POSTGRES_13"] = 23; values[valuesById[110] = "POSTGRES_14"] = 110; values[valuesById[172] = "POSTGRES_15"] = 172; + values[valuesById[272] = "POSTGRES_16"] = 272; values[valuesById[20] = "MYSQL_8_0"] = 20; values[valuesById[41] = "MYSQL_8_0_18"] = 41; values[valuesById[85] = "MYSQL_8_0_26"] = 85; @@ -97199,6 +98093,7 @@ values[valuesById[357] = "MYSQL_8_0_39"] = 357; values[valuesById[358] = "MYSQL_8_0_40"] = 358; values[valuesById[398] = "MYSQL_8_4"] = 398; + values[valuesById[399] = "MYSQL_8_4_0"] = 399; values[valuesById[26] = "SQLSERVER_2019_STANDARD"] = 26; values[valuesById[27] = "SQLSERVER_2019_ENTERPRISE"] = 27; values[valuesById[28] = "SQLSERVER_2019_EXPRESS"] = 28; @@ -98317,6 +99212,7 @@ case 23: case 110: case 172: + case 272: case 20: case 41: case 85: @@ -98335,6 +99231,7 @@ case 357: case 358: case 398: + case 399: case 26: case 27: case 28: @@ -98466,6 +99363,10 @@ case 172: message.databaseVersion = 172; break; + case "POSTGRES_16": + case 272: + message.databaseVersion = 272; + break; case "MYSQL_8_0": case 20: message.databaseVersion = 20; @@ -98538,6 +99439,10 @@ case 398: message.databaseVersion = 398; break; + case "MYSQL_8_4_0": + case 399: + message.databaseVersion = 399; + break; case "SQLSERVER_2019_STANDARD": case 26: message.databaseVersion = 26; diff --git a/packages/google-cloud-sql/protos/protos.json b/packages/google-cloud-sql/protos/protos.json index 2fb175ab4b9..769f5e27432 100644 --- a/packages/google-cloud-sql/protos/protos.json +++ b/packages/google-cloud-sql/protos/protos.json @@ -1258,7 +1258,8 @@ "RELEASE_SSRS_LEASE": 43, "RECONFIGURE_OLD_PRIMARY": 44, "CLUSTER_MAINTENANCE": 45, - "SELF_SERVICE_MAINTENANCE": 46 + "SELF_SERVICE_MAINTENANCE": 46, + "SWITCHOVER_TO_REPLICA": 47 } }, "SqlOperationStatus": { @@ -1678,6 +1679,7 @@ "POSTGRES_13": 23, "POSTGRES_14": 110, "POSTGRES_15": 172, + "POSTGRES_16": 272, "MYSQL_8_0": 20, "MYSQL_8_0_18": 41, "MYSQL_8_0_26": 85, @@ -1696,6 +1698,7 @@ "MYSQL_8_0_39": 357, "MYSQL_8_0_40": 358, "MYSQL_8_4": 398, + "MYSQL_8_4_0": 399, "SQLSERVER_2019_STANDARD": 26, "SQLSERVER_2019_ENTERPRISE": 27, "SQLSERVER_2019_EXPRESS": 28, @@ -3857,6 +3860,14 @@ "type": "string", "id": 42 }, + "upgradableDatabaseVersions": { + "rule": "repeated", + "type": "AvailableDatabaseVersion", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "sqlNetworkArchitecture": { "type": "SqlNetworkArchitecture", "id": 47, @@ -4109,6 +4120,13 @@ }, "ReplicationCluster": { "fields": { + "psaWriteEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "failoverDrReplicaName": { "type": "string", "id": 2, @@ -4125,6 +4143,48 @@ } } }, + "AvailableDatabaseVersion": { + "oneofs": { + "_majorVersion": { + "oneof": [ + "majorVersion" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_displayName": { + "oneof": [ + "displayName" + ] + } + }, + "fields": { + "majorVersion": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "displayName": { + "type": "string", + "id": 9, + "options": { + "proto3_optional": true + } + } + } + }, "SqlInstancesRescheduleMaintenanceRequestBody": { "fields": { "reschedule": { @@ -4315,7 +4375,10 @@ "PG_SUBSCRIPTION_COUNT": 41, "PG_SYNC_PARALLEL_LEVEL": 42, "INSUFFICIENT_DISK_SIZE": 43, - "INSUFFICIENT_MACHINE_TIER": 44 + "INSUFFICIENT_MACHINE_TIER": 44, + "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED": 45, + "EXTENSIONS_NOT_MIGRATED": 46, + "PG_CRON_FLAG_ENABLED_IN_REPLICA": 47 } } } @@ -7205,6 +7268,11 @@ "oneof": [ "preferredZone" ] + }, + "_preferredSecondaryZone": { + "oneof": [ + "preferredSecondaryZone" + ] } }, "fields": { @@ -7244,6 +7312,14 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "preferredSecondaryZone": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -7559,6 +7635,14 @@ "type": "string", "id": 42 }, + "upgradableDatabaseVersions": { + "rule": "repeated", + "type": "AvailableDatabaseVersion", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "sqlNetworkArchitecture": { "type": "SqlNetworkArchitecture", "id": 47, @@ -7811,6 +7895,11 @@ }, "ReplicationCluster": { "oneofs": { + "_psaWriteEndpoint": { + "oneof": [ + "psaWriteEndpoint" + ] + }, "_failoverDrReplicaName": { "oneof": [ "failoverDrReplicaName" @@ -7823,6 +7912,14 @@ } }, "fields": { + "psaWriteEndpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, "failoverDrReplicaName": { "type": "string", "id": 2, @@ -7841,6 +7938,48 @@ } } }, + "AvailableDatabaseVersion": { + "oneofs": { + "_majorVersion": { + "oneof": [ + "majorVersion" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_displayName": { + "oneof": [ + "displayName" + ] + } + }, + "fields": { + "majorVersion": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "displayName": { + "type": "string", + "id": 9, + "options": { + "proto3_optional": true + } + } + } + }, "DatabasesListResponse": { "fields": { "kind": { @@ -8531,7 +8670,10 @@ "PG_SUBSCRIPTION_COUNT": 41, "PG_SYNC_PARALLEL_LEVEL": 42, "INSUFFICIENT_DISK_SIZE": 43, - "INSUFFICIENT_MACHINE_TIER": 44 + "INSUFFICIENT_MACHINE_TIER": 44, + "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED": 45, + "EXTENSIONS_NOT_MIGRATED": 46, + "PG_CRON_FLAG_ENABLED_IN_REPLICA": 47 } } } @@ -8968,7 +9110,8 @@ "RELEASE_SSRS_LEASE": 43, "RECONFIGURE_OLD_PRIMARY": 44, "CLUSTER_MAINTENANCE": 45, - "SELF_SERVICE_MAINTENANCE": 46 + "SELF_SERVICE_MAINTENANCE": 46, + "SWITCHOVER_TO_REPLICA": 47 } }, "SqlOperationStatus": { @@ -9594,6 +9737,7 @@ "POSTGRES_13": 23, "POSTGRES_14": 110, "POSTGRES_15": 172, + "POSTGRES_16": 272, "MYSQL_8_0": 20, "MYSQL_8_0_18": 41, "MYSQL_8_0_26": 85, @@ -9612,6 +9756,7 @@ "MYSQL_8_0_39": 357, "MYSQL_8_0_40": 358, "MYSQL_8_4": 398, + "MYSQL_8_4_0": 399, "SQLSERVER_2019_STANDARD": 26, "SQLSERVER_2019_ENTERPRISE": 27, "SQLSERVER_2019_EXPRESS": 28, diff --git a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json index b6be2ae7dc8..9d7849c8cd3 100644 --- a/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json +++ b/packages/google-cloud-sql/samples/generated/v1/snippet_metadata_google.cloud.sql.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-sql", - "version": "0.14.0", + "version": "0.15.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json b/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json index ea7abf87163..4f94db39e4d 100644 --- a/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json +++ b/packages/google-cloud-sql/samples/generated/v1beta4/snippet_metadata_google.cloud.sql.v1beta4.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-sql", - "version": "0.14.0", + "version": "0.15.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-sql/samples/package.json b/packages/google-cloud-sql/samples/package.json index f1cbde2345a..cb045628e8a 100644 --- a/packages/google-cloud-sql/samples/package.json +++ b/packages/google-cloud-sql/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/sql": "^0.14.0" + "@google-cloud/sql": "^0.15.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-talent/CHANGELOG.md b/packages/google-cloud-talent/CHANGELOG.md index 64e46a758d7..09bc423eba7 100644 --- a/packages/google-cloud-talent/CHANGELOG.md +++ b/packages/google-cloud-talent/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/talent?activeTab=versions +## [6.3.1](https://github.com/googleapis/google-cloud-node/compare/talent-v6.3.0...talent-v6.3.1) (2024-06-21) + + +### Bug Fixes + +* **deps:** Update gax ([#5487](https://github.com/googleapis/google-cloud-node/issues/5487)) ([616dee9](https://github.com/googleapis/google-cloud-node/commit/616dee9c69245409909487ee9ebfd68121dab85e)) + ## [6.3.0](https://github.com/googleapis/google-cloud-node/compare/talent-v6.2.0...talent-v6.3.0) (2024-05-21) diff --git a/packages/google-cloud-talent/package.json b/packages/google-cloud-talent/package.json index 4f23f5d35db..b871e350177 100644 --- a/packages/google-cloud-talent/package.json +++ b/packages/google-cloud-talent/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/talent", "description": "Cloud Talent Solution API client for Node.js", - "version": "6.3.0", + "version": "6.3.1", "license": "Apache-2.0", "author": "Google LLC", "engines": { @@ -48,7 +48,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^4.3.7" }, "devDependencies": { "@types/mocha": "^9.0.0", @@ -68,4 +68,4 @@ "typescript": "^5.1.6" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-talent" -} \ No newline at end of file +} diff --git a/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json index ac5d49e9d7c..f24b79916f2 100644 --- a/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json +++ b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata.google.cloud.talent.v4.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-talent", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-talent/samples/generated/v4/snippet_metadata_google.cloud.talent.v4.json b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata_google.cloud.talent.v4.json index ac5d49e9d7c..f24b79916f2 100644 --- a/packages/google-cloud-talent/samples/generated/v4/snippet_metadata_google.cloud.talent.v4.json +++ b/packages/google-cloud-talent/samples/generated/v4/snippet_metadata_google.cloud.talent.v4.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-talent", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json index f76154ee8b8..6eb58b2f384 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json +++ b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata.google.cloud.talent.v4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-talent", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata_google.cloud.talent.v4beta1.json b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata_google.cloud.talent.v4beta1.json index f76154ee8b8..6eb58b2f384 100644 --- a/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata_google.cloud.talent.v4beta1.json +++ b/packages/google-cloud-talent/samples/generated/v4beta1/snippet_metadata_google.cloud.talent.v4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-talent", - "version": "6.3.0", + "version": "6.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-talent/samples/package.json b/packages/google-cloud-talent/samples/package.json index dbaa290f287..8297a8caf42 100644 --- a/packages/google-cloud-talent/samples/package.json +++ b/packages/google-cloud-talent/samples/package.json @@ -17,7 +17,7 @@ "lint:fix": "npm run lint -- --fix" }, "dependencies": { - "@google-cloud/talent": "^6.3.0", + "@google-cloud/talent": "^6.3.1", "uuid": "^9.0.0", "yargs": "^17.0.0" }, diff --git a/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto b/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto index 75664560478..574ba45191a 100644 --- a/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto +++ b/packages/google-shopping-css/protos/google/shopping/css/v1/css_product_common.proto @@ -172,7 +172,7 @@ message Attributes { // Date on which the item should expire, as specified upon insertion, in // [ISO // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual - // expiration date in Google Shopping is exposed in `productstatuses` as + // expiration date is exposed in `productstatuses` as // [googleExpirationDate](https://support.google.com/merchants/answer/6324499) // and might be earlier if `expirationDate` is too far in the future. // Note: It may take 2+ days from the expiration date for the item to @@ -325,7 +325,7 @@ message CssProductStatus { // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. google.protobuf.Timestamp last_update_date = 6; - // Date on which the item expires in Google Shopping, in [ISO + // Date on which the item expires, in [ISO // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. google.protobuf.Timestamp google_expiration_date = 7; } diff --git a/packages/google-storage-control/.repo-metadata.json b/packages/google-storage-control/.repo-metadata.json index a1003a28147..d2cc18fb57c 100644 --- a/packages/google-storage-control/.repo-metadata.json +++ b/packages/google-storage-control/.repo-metadata.json @@ -1,10 +1,10 @@ { "name": "storage", "name_pretty": "Cloud Storage API", - "product_documentation": "https://cloud.google.com/storage/docs/overview", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage/latest", + "product_documentation": "https://cloud.google.com/storage/docs/reference/rpc", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/storage-control/latest", "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "preview", + "release_level": "stable", "language": "nodejs", "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/storage-control", diff --git a/packages/google-storage-control/README.md b/packages/google-storage-control/README.md index 026bd20791a..0aef677fbbd 100644 --- a/packages/google-storage-control/README.md +++ b/packages/google-storage-control/README.md @@ -4,7 +4,7 @@ # [Cloud Storage API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-storage-control) -[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![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/storage-control.svg)](https://www.npmjs.org/package/@google-cloud/storage-control) @@ -150,13 +150,14 @@ 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. -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] @@ -179,8 +180,8 @@ 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/storage/latest -[product-docs]: https://cloud.google.com/storage/docs/overview +[client-docs]: https://cloud.google.com/nodejs/docs/reference/storage-control/latest +[product-docs]: https://cloud.google.com/storage/docs/reference/rpc [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 diff --git a/packages/google-storage-control/protos/google/storage/control/v2/storage_control.proto b/packages/google-storage-control/protos/google/storage/control/v2/storage_control.proto index 373e2cfd016..28551e3ef34 100644 --- a/packages/google-storage-control/protos/google/storage/control/v2/storage_control.proto +++ b/packages/google-storage-control/protos/google/storage/control/v2/storage_control.proto @@ -49,7 +49,6 @@ service StorageControl { // Creates a new folder. This operation is only applicable to a hierarchical // namespace enabled bucket. - // Hierarchical namespace buckets are in allowlist preview. rpc CreateFolder(CreateFolderRequest) returns (Folder) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{bucket=**}" } @@ -59,7 +58,6 @@ service StorageControl { // Permanently deletes an empty folder. This operation is only applicable to a // hierarchical namespace enabled bucket. - // Hierarchical namespace buckets are in allowlist preview. rpc DeleteFolder(DeleteFolderRequest) returns (google.protobuf.Empty) { option (google.api.routing) = { routing_parameters { @@ -72,7 +70,6 @@ service StorageControl { // Returns metadata for the specified folder. This operation is only // applicable to a hierarchical namespace enabled bucket. - // Hierarchical namespace buckets are in allowlist preview. rpc GetFolder(GetFolderRequest) returns (Folder) { option (google.api.routing) = { routing_parameters { @@ -85,7 +82,6 @@ service StorageControl { // Retrieves a list of folders. This operation is only applicable to a // hierarchical namespace enabled bucket. - // Hierarchical namespace buckets are in allowlist preview. rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) { option (google.api.routing) = { routing_parameters { field: "parent" path_template: "{bucket=**}" } @@ -97,7 +93,6 @@ service StorageControl { // applicable to a hierarchical namespace enabled bucket. During a rename, the // source and destination folders are locked until the long running operation // completes. - // Hierarchical namespace buckets are in allowlist preview. rpc RenameFolder(RenameFolderRequest) returns (google.longrunning.Operation) { option (google.api.routing) = { routing_parameters { @@ -173,7 +168,6 @@ message PendingRenameInfo { // A folder resource. This resource can only exist in a hierarchical namespace // enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message Folder { option (google.api.resource) = { type: "storage.googleapis.com/Folder" @@ -209,7 +203,6 @@ message Folder { // Request message for GetFolder. This operation is only applicable to a // hierarchical namespace enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message GetFolderRequest { // Required. Name of the folder. // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` @@ -236,7 +229,6 @@ message GetFolderRequest { // Request message for CreateFolder. This operation is only applicable to a // hierarchical namespace enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message CreateFolderRequest { // Required. Name of the bucket in which the folder will reside. The bucket // must be a hierarchical namespace enabled bucket. @@ -274,7 +266,6 @@ message CreateFolderRequest { // Request message for DeleteFolder. This operation is only applicable to a // hierarchical namespace enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message DeleteFolderRequest { // Required. Name of the folder. // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` @@ -301,7 +292,6 @@ message DeleteFolderRequest { // Request message for ListFolders. This operation is only applicable to a // hierarchical namespace enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message ListFoldersRequest { // Required. Name of the bucket in which to look for folders. The bucket must // be a hierarchical namespace enabled bucket. @@ -361,7 +351,6 @@ message ListFoldersResponse { // Request message for RenameFolder. This operation is only applicable to a // hierarchical namespace enabled bucket. -// Hierarchical namespace buckets are in allowlist preview. message RenameFolderRequest { // Required. Name of the source folder being renamed. // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` diff --git a/packages/google-storage-control/samples/README.md b/packages/google-storage-control/samples/README.md index a902199236f..98c7d8c7257 100644 --- a/packages/google-storage-control/samples/README.md +++ b/packages/google-storage-control/samples/README.md @@ -317,4 +317,4 @@ __Usage:__ [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/storage/docs/overview +[product-docs]: https://cloud.google.com/storage/docs/reference/rpc diff --git a/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json b/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json index e8b423c6a0c..2ed7092b4b6 100644 --- a/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json +++ b/packages/google-storage-control/samples/generated/v2/snippet_metadata_google.storage.control.v2.json @@ -15,7 +15,7 @@ "regionTag": "storage_v2_generated_StorageControl_CreateFolder_async", "title": "StorageControl createFolder Sample", "origin": "API_DEFINITION", - "description": " Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket. Hierarchical namespace buckets are in allowlist preview.", + "description": " Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.", "canonical": true, "file": "storage_control.create_folder.js", "language": "JAVASCRIPT", @@ -71,7 +71,7 @@ "regionTag": "storage_v2_generated_StorageControl_DeleteFolder_async", "title": "StorageControl deleteFolder Sample", "origin": "API_DEFINITION", - "description": " Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket. Hierarchical namespace buckets are in allowlist preview.", + "description": " Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.", "canonical": true, "file": "storage_control.delete_folder.js", "language": "JAVASCRIPT", @@ -123,7 +123,7 @@ "regionTag": "storage_v2_generated_StorageControl_GetFolder_async", "title": "StorageControl getFolder Sample", "origin": "API_DEFINITION", - "description": " Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket. Hierarchical namespace buckets are in allowlist preview.", + "description": " Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.", "canonical": true, "file": "storage_control.get_folder.js", "language": "JAVASCRIPT", @@ -175,7 +175,7 @@ "regionTag": "storage_v2_generated_StorageControl_ListFolders_async", "title": "StorageControl listFolders Sample", "origin": "API_DEFINITION", - "description": " Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket. Hierarchical namespace buckets are in allowlist preview.", + "description": " Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.", "canonical": true, "file": "storage_control.list_folders.js", "language": "JAVASCRIPT", @@ -243,7 +243,7 @@ "regionTag": "storage_v2_generated_StorageControl_RenameFolder_async", "title": "StorageControl renameFolder Sample", "origin": "API_DEFINITION", - "description": " Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes. Hierarchical namespace buckets are in allowlist preview.", + "description": " Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.", "canonical": true, "file": "storage_control.rename_folder.js", "language": "JAVASCRIPT", diff --git a/packages/google-storage-control/src/v2/storage_control_client.ts b/packages/google-storage-control/src/v2/storage_control_client.ts index 5541c4a3372..e9b88a2b813 100644 --- a/packages/google-storage-control/src/v2/storage_control_client.ts +++ b/packages/google-storage-control/src/v2/storage_control_client.ts @@ -451,7 +451,6 @@ export class StorageControlClient { /** * Creates a new folder. This operation is only applicable to a hierarchical * namespace enabled bucket. - * Hierarchical namespace buckets are in allowlist preview. * * @param {Object} request * The request object that will be sent. @@ -567,7 +566,6 @@ export class StorageControlClient { /** * Permanently deletes an empty folder. This operation is only applicable to a * hierarchical namespace enabled bucket. - * Hierarchical namespace buckets are in allowlist preview. * * @param {Object} request * The request object that will be sent. @@ -677,7 +675,6 @@ export class StorageControlClient { /** * Returns metadata for the specified folder. This operation is only * applicable to a hierarchical namespace enabled bucket. - * Hierarchical namespace buckets are in allowlist preview. * * @param {Object} request * The request object that will be sent. @@ -1247,7 +1244,6 @@ export class StorageControlClient { * applicable to a hierarchical namespace enabled bucket. During a rename, the * source and destination folders are locked until the long running operation * completes. - * Hierarchical namespace buckets are in allowlist preview. * * @param {Object} request * The request object that will be sent. @@ -1412,7 +1408,6 @@ export class StorageControlClient { /** * Retrieves a list of folders. This operation is only applicable to a * hierarchical namespace enabled bucket. - * Hierarchical namespace buckets are in allowlist preview. * * @param {Object} request * The request object that will be sent.